Skip to content

Commit ee93d9f

Browse files
committed
feat: filter to plugin type
1 parent 67596e8 commit ee93d9f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/lint/lintersdb/builder_plugin_go.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
"github.com/golangci/golangci-lint/pkg/logutils"
1515
)
1616

17+
const goPluginType = "goplugin"
18+
1719
type AnalyzerPlugin interface {
1820
GetAnalyzers() []*analysis.Analyzer
1921
}
@@ -37,10 +39,15 @@ func (b *PluginGoBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
3739
var linters []*linter.Config
3840

3941
for name, settings := range cfg.LintersSettings.Custom {
42+
if settings.Type != goPluginType && settings.Type != "" {
43+
continue
44+
}
45+
4046
settings := settings
47+
4148
lc, err := b.loadConfig(cfg, name, &settings)
4249
if err != nil {
43-
return nil, fmt.Errorf("unable to load custom analyzer %s:%s, %w", name, settings.Path, err)
50+
return nil, fmt.Errorf("unable to load custom analyzer %q: %s, %w", name, settings.Path, err)
4451
} else {
4552
linters = append(linters, lc)
4653
}

0 commit comments

Comments
 (0)