File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -9,22 +9,22 @@ import (
99)
1010
1111func NewGoFactoryLint (settings * config.GoFactoryLintSettings ) * goanalysis.Linter {
12- a := factory .NewAnalyzer ()
12+ analyzer := factory .NewAnalyzer ()
1313
1414 cfg := make (map [string ]map [string ]any )
1515 if settings != nil {
16- cfg [a .Name ] = map [string ]any {}
16+ cfg [analyzer .Name ] = map [string ]any {}
1717
1818 if len (settings .BlockedPkgs ) > 0 {
19- cfg [a .Name ]["blockedPkgs" ] = settings .BlockedPkgs
20- cfg [a .Name ]["onlyBlockedPkgs" ] = settings .OnlyBlockedPkgs
19+ cfg [analyzer .Name ]["blockedPkgs" ] = settings .BlockedPkgs
20+ cfg [analyzer .Name ]["onlyBlockedPkgs" ] = settings .OnlyBlockedPkgs
2121 }
2222 }
2323
2424 return goanalysis .NewLinter (
25- a .Name ,
26- a .Doc ,
27- []* analysis.Analyzer {a },
25+ analyzer .Name ,
26+ analyzer .Doc ,
27+ []* analysis.Analyzer {analyzer },
2828 cfg ,
2929 ).WithLoadMode (goanalysis .LoadModeTypesInfo )
3030}
Original file line number Diff line number Diff line change @@ -493,6 +493,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
493493 linter .NewConfig (golinters .NewGoFactoryLint (goFactoryCfg )).
494494 WithSince ("next_version" ).
495495 WithPresets (linter .PresetStyle ).
496+ WithLoadForGoAnalysis ().
496497 WithURL ("https://github.com/maranqz/go-factory-lint" ),
497498
498499 linter .NewConfig (golinters .NewGofmt (gofmtCfg )).
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ func TestSourcesFromTestdataSubDir(t *testing.T) {
3333 "ginkgolinter" ,
3434 "zerologlint" ,
3535 "protogetter" ,
36+ "gofactory" ,
3637 }
3738
3839 for _ , dir := range subDirs {
Original file line number Diff line number Diff line change 1+ //golangcitest:args -Egofactory
2+
13package gofactory
24
35import "github.com/golangci/golangci-lint/test/testdata/gofactory/nested"
You can’t perform that action at this time.
0 commit comments