Skip to content

Commit bca0548

Browse files
committed
lint and visibility fixes
1 parent f2657cf commit bca0548

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

pkg/language/protobuf/override.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func makeProtoOverrideRule(libs []protoc.ProtoLibrary) *rule.Rule {
3333
return overrideRule
3434
}
3535

36-
func resolveOverrideRule(c *config.Config, rel string, overrideRule *rule.Rule, resolver protoc.ImportResolver) {
36+
func resolveOverrideRule(_ *config.Config, rel string, overrideRule *rule.Rule, resolver protoc.ImportResolver) {
3737

3838
libs := overrideRule.PrivateAttr(protoLibrariesRuleKey).([]protoc.ProtoLibrary)
3939
if len(libs) == 0 {

pkg/plugin/bufbuild/connect_es_plugin.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ func (p *ConnectEsProto) Name() string {
2626
// Configure implements part of the Plugin interface.
2727
func (p *ConnectEsProto) Configure(ctx *protoc.PluginContext) *protoc.PluginConfiguration {
2828
flags := parseConnectEsProtoOptions(p.Name(), ctx.PluginConfig.GetFlags())
29-
imports := make(map[string]bool)
30-
for _, file := range ctx.ProtoLibrary.Files() {
31-
for _, imp := range file.Imports() {
32-
imports[imp.Filename] = true
33-
}
34-
}
29+
3530
// TODO: get target option from directive
3631
var options = []string{"keep_empty_files=true", "target=ts"}
3732
tsFiles := make([]string, 0)
@@ -55,16 +50,17 @@ func (p *ConnectEsProto) Configure(ctx *protoc.PluginContext) *protoc.PluginConf
5550
if len(pc.Outputs) == 0 {
5651
pc.Outputs = nil
5752
}
53+
5854
return pc
5955
}
6056

61-
// ConnectEsProtoOptions represents the parsed flag configuration for the
57+
// connectEsProtoOptions represents the parsed flag configuration for the
6258
// ConnectEsProto implementation.
63-
type ConnectEsProtoOptions struct {
59+
type connectEsProtoOptions struct {
6460
excludeOutput map[string]bool
6561
}
6662

67-
func parseConnectEsProtoOptions(kindName string, args []string) *ConnectEsProtoOptions {
63+
func parseConnectEsProtoOptions(kindName string, args []string) *connectEsProtoOptions {
6864
flags := flag.NewFlagSet(kindName, flag.ExitOnError)
6965

7066
var excludeOutput string
@@ -73,7 +69,7 @@ func parseConnectEsProtoOptions(kindName string, args []string) *ConnectEsProtoO
7369
if err := flags.Parse(args); err != nil {
7470
log.Fatalf("failed to parse flags for %q: %v", kindName, err)
7571
}
76-
config := &ConnectEsProtoOptions{
72+
config := &connectEsProtoOptions{
7773
excludeOutput: make(map[string]bool),
7874
}
7975
for _, value := range strings.Split(excludeOutput, ",") {

pkg/plugin/bufbuild/es_plugin.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ func (p *EsProto) Name() string {
2626
// Configure implements part of the Plugin interface.
2727
func (p *EsProto) Configure(ctx *protoc.PluginContext) *protoc.PluginConfiguration {
2828
flags := parseEsProtoOptions(p.Name(), ctx.PluginConfig.GetFlags())
29-
imports := make(map[string]bool)
30-
for _, file := range ctx.ProtoLibrary.Files() {
31-
for _, imp := range file.Imports() {
32-
imports[imp.Filename] = true
33-
}
34-
}
29+
3530
// TODO: get target option from directive
3631
var options = []string{"keep_empty_files=true", "target=ts"}
3732
tsFiles := make([]string, 0)
@@ -58,13 +53,13 @@ func (p *EsProto) Configure(ctx *protoc.PluginContext) *protoc.PluginConfigurati
5853
return pc
5954
}
6055

61-
// EsProtoOptions represents the parsed flag configuration for the
56+
// esProtoOptions represents the parsed flag configuration for the
6257
// EsProto implementation.
63-
type EsProtoOptions struct {
58+
type esProtoOptions struct {
6459
excludeOutput map[string]bool
6560
}
6661

67-
func parseEsProtoOptions(kindName string, args []string) *EsProtoOptions {
62+
func parseEsProtoOptions(kindName string, args []string) *esProtoOptions {
6863
flags := flag.NewFlagSet(kindName, flag.ExitOnError)
6964

7065
var excludeOutput string
@@ -73,7 +68,7 @@ func parseEsProtoOptions(kindName string, args []string) *EsProtoOptions {
7368
if err := flags.Parse(args); err != nil {
7469
log.Fatalf("failed to parse flags for %q: %v", kindName, err)
7570
}
76-
config := &EsProtoOptions{
71+
config := &esProtoOptions{
7772
excludeOutput: make(map[string]bool),
7873
}
7974
for _, value := range strings.Split(excludeOutput, ",") {

0 commit comments

Comments
 (0)