File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -9,22 +9,22 @@ import (
9
9
)
10
10
11
11
func NewGoFactoryLint (settings * config.GoFactoryLintSettings ) * goanalysis.Linter {
12
- a := factory .NewAnalyzer ()
12
+ analyzer := factory .NewAnalyzer ()
13
13
14
14
cfg := make (map [string ]map [string ]any )
15
15
if settings != nil {
16
- cfg [a .Name ] = map [string ]any {}
16
+ cfg [analyzer .Name ] = map [string ]any {}
17
17
18
18
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
21
21
}
22
22
}
23
23
24
24
return goanalysis .NewLinter (
25
- a .Name ,
26
- a .Doc ,
27
- []* analysis.Analyzer {a },
25
+ analyzer .Name ,
26
+ analyzer .Doc ,
27
+ []* analysis.Analyzer {analyzer },
28
28
cfg ,
29
29
).WithLoadMode (goanalysis .LoadModeTypesInfo )
30
30
}
Original file line number Diff line number Diff line change @@ -493,6 +493,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
493
493
linter .NewConfig (golinters .NewGoFactoryLint (goFactoryCfg )).
494
494
WithSince ("next_version" ).
495
495
WithPresets (linter .PresetStyle ).
496
+ WithLoadForGoAnalysis ().
496
497
WithURL ("https://github.com/maranqz/go-factory-lint" ),
497
498
498
499
linter .NewConfig (golinters .NewGofmt (gofmtCfg )).
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ func TestSourcesFromTestdataSubDir(t *testing.T) {
33
33
"ginkgolinter" ,
34
34
"zerologlint" ,
35
35
"protogetter" ,
36
+ "gofactory" ,
36
37
}
37
38
38
39
for _ , dir := range subDirs {
Original file line number Diff line number Diff line change
1
+ //golangcitest:args -Egofactory
2
+
1
3
package gofactory
2
4
3
5
import "github.com/golangci/golangci-lint/test/testdata/gofactory/nested"
You can’t perform that action at this time.
0 commit comments