Skip to content

Commit 30feef0

Browse files
committed
chore: rename PluginBuilder to PluginGoBuilder
1 parent f349891 commit 30feef0

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

pkg/commands/help.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (c *helpCommand) preRunE(_ *cobra.Command, _ []string) error {
5454
// The command doesn't depend on the real configuration.
5555
// It just needs the list of all plugins and all presets.
5656
dbManager, err := lintersdb.NewManager(c.log.Child(logutils.DebugKeyLintersDB), config.NewDefault(),
57-
lintersdb.NewPluginBuilder(c.log), lintersdb.NewLinterBuilder())
57+
lintersdb.NewPluginGoBuilder(c.log), lintersdb.NewLinterBuilder())
5858
if err != nil {
5959
return err
6060
}

pkg/commands/linters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (c *lintersCommand) preRunE(cmd *cobra.Command, _ []string) error {
6565
}
6666

6767
dbManager, err := lintersdb.NewManager(c.log.Child(logutils.DebugKeyLintersDB), c.cfg,
68-
lintersdb.NewPluginBuilder(c.log), lintersdb.NewLinterBuilder())
68+
lintersdb.NewPluginGoBuilder(c.log), lintersdb.NewLinterBuilder())
6969
if err != nil {
7070
return err
7171
}

pkg/commands/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (c *runCommand) persistentPostRunE(_ *cobra.Command, _ []string) error {
177177

178178
func (c *runCommand) preRunE(_ *cobra.Command, _ []string) error {
179179
dbManager, err := lintersdb.NewManager(c.log.Child(logutils.DebugKeyLintersDB), c.cfg,
180-
lintersdb.NewPluginBuilder(c.log), lintersdb.NewLinterBuilder())
180+
lintersdb.NewPluginGoBuilder(c.log), lintersdb.NewLinterBuilder())
181181
if err != nil {
182182
return err
183183
}

pkg/lint/lintersdb/builder_plugin_go.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ type AnalyzerPlugin interface {
1818
GetAnalyzers() []*analysis.Analyzer
1919
}
2020

21-
// PluginBuilder builds the custom linters (plugins) based on the configuration.
22-
type PluginBuilder struct {
21+
// PluginGoBuilder builds the custom linters (Go plugin) based on the configuration.
22+
type PluginGoBuilder struct {
2323
log logutils.Log
2424
}
2525

26-
// NewPluginBuilder creates new PluginBuilder.
27-
func NewPluginBuilder(log logutils.Log) *PluginBuilder {
28-
return &PluginBuilder{log: log}
26+
// NewPluginGoBuilder creates new PluginGoBuilder.
27+
func NewPluginGoBuilder(log logutils.Log) *PluginGoBuilder {
28+
return &PluginGoBuilder{log: log}
2929
}
3030

3131
// Build loads custom linters that are specified in the golangci-lint config file.
32-
func (b *PluginBuilder) Build(cfg *config.Config) []*linter.Config {
32+
func (b *PluginGoBuilder) Build(cfg *config.Config) []*linter.Config {
3333
if cfg == nil || b.log == nil {
3434
return nil
3535
}
@@ -51,7 +51,7 @@ func (b *PluginBuilder) Build(cfg *config.Config) []*linter.Config {
5151

5252
// loadConfig loads the configuration of private linters.
5353
// Private linters are dynamically loaded from .so plugin files.
54-
func (b *PluginBuilder) loadConfig(cfg *config.Config, name string, settings *config.CustomLinterSettings) (*linter.Config, error) {
54+
func (b *PluginGoBuilder) loadConfig(cfg *config.Config, name string, settings *config.CustomLinterSettings) (*linter.Config, error) {
5555
analyzers, err := b.getAnalyzerPlugin(cfg, settings.Path, settings.Settings)
5656
if err != nil {
5757
return nil, err
@@ -75,7 +75,7 @@ func (b *PluginBuilder) loadConfig(cfg *config.Config, name string, settings *co
7575
// and returns the 'AnalyzerPlugin' interface implemented by the private plugin.
7676
// An error is returned if the private linter cannot be loaded
7777
// or the linter does not implement the AnalyzerPlugin interface.
78-
func (b *PluginBuilder) getAnalyzerPlugin(cfg *config.Config, path string, settings any) ([]*analysis.Analyzer, error) {
78+
func (b *PluginGoBuilder) getAnalyzerPlugin(cfg *config.Config, path string, settings any) ([]*analysis.Analyzer, error) {
7979
if !filepath.IsAbs(path) {
8080
// resolve non-absolute paths relative to config file's directory
8181
path = filepath.Join(cfg.GetConfigDir(), path)
@@ -94,7 +94,7 @@ func (b *PluginBuilder) getAnalyzerPlugin(cfg *config.Config, path string, setti
9494
return analyzers, nil
9595
}
9696

97-
func (b *PluginBuilder) lookupPlugin(plug *plugin.Plugin, settings any) ([]*analysis.Analyzer, error) {
97+
func (b *PluginGoBuilder) lookupPlugin(plug *plugin.Plugin, settings any) ([]*analysis.Analyzer, error) {
9898
symbol, err := plug.Lookup("New")
9999
if err != nil {
100100
analyzers, errP := b.lookupAnalyzerPlugin(plug)
@@ -114,7 +114,7 @@ func (b *PluginBuilder) lookupPlugin(plug *plugin.Plugin, settings any) ([]*anal
114114
return constructor(settings)
115115
}
116116

117-
func (b *PluginBuilder) lookupAnalyzerPlugin(plug *plugin.Plugin) ([]*analysis.Analyzer, error) {
117+
func (b *PluginGoBuilder) lookupAnalyzerPlugin(plug *plugin.Plugin) ([]*analysis.Analyzer, error) {
118118
symbol, err := plug.Lookup("AnalyzerPlugin")
119119
if err != nil {
120120
return nil, err

pkg/result/processors/nolint_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func newNolint2FileIssue(line int) result.Issue {
3535

3636
func newTestNolintProcessor(log logutils.Log) *Nolint {
3737
dbManager, _ := lintersdb.NewManager(log, config.NewDefault(),
38-
lintersdb.NewPluginBuilder(log), lintersdb.NewLinterBuilder())
38+
lintersdb.NewPluginGoBuilder(log), lintersdb.NewLinterBuilder())
3939

4040
return NewNolint(log, dbManager, nil)
4141
}

0 commit comments

Comments
 (0)