Skip to content

Commit bf7fb06

Browse files
committed
1. Update version after type fixes
2. Added tests in subdir
1 parent 70cd3e5 commit bf7fb06

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

pkg/golinters/gofactorylint.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ import (
99
)
1010

1111
func 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
}

pkg/lint/lintersdb/manager.go

+1
Original file line numberDiff line numberDiff 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)).

test/linters_test.go

+1
Original file line numberDiff line numberDiff 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 {

test/testdata/gofactory/app.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//golangcitest:args -Egofactory
2+
13
package gofactory
24

35
import "github.com/golangci/golangci-lint/test/testdata/gofactory/nested"

0 commit comments

Comments
 (0)