@@ -2,36 +2,38 @@ package golinters
2
2
3
3
import (
4
4
"github.com/nunnatsa/ginkgolinter"
5
+ "github.com/nunnatsa/ginkgolinter/types"
5
6
"golang.org/x/tools/go/analysis"
6
7
7
8
"github.com/golangci/golangci-lint/pkg/config"
8
9
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
9
10
)
10
11
11
12
func NewGinkgoLinter (settings * config.GinkgoLinterSettings ) * goanalysis.Linter {
12
- a := ginkgolinter . NewAnalyzer ()
13
+ cfg := & types. Config {}
13
14
14
- cfgMap := make (map [string ]map [string ]any )
15
15
if settings != nil {
16
- cfgMap [ a . Name ] = map [ string ] any {
17
- "suppress-len-assertion" : settings .SuppressLenAssertion ,
18
- "suppress-nil-assertion" : settings .SuppressNilAssertion ,
19
- "suppress-err-assertion" : settings .SuppressErrAssertion ,
20
- "suppress-compare-assertion" : settings .SuppressCompareAssertion ,
21
- "suppress-async-assertion" : settings .SuppressAsyncAssertion ,
22
- "suppress-type-compare-assertion" : settings .SuppressTypeCompareWarning ,
23
- "forbid-focus-container" : settings .ForbidFocusContainer ,
24
- "allow-havelen-0" : settings .AllowHaveLenZero ,
25
- "force-expect-to" : settings .ForceExpectTo ,
26
- "forbid-spec-pollution" : settings .ForbidSpecPollution ,
27
- "validate-async-intervals" : settings .ValidateAsyncIntervals ,
16
+ cfg = & types. Config {
17
+ SuppressLen : types . Boolean ( settings .SuppressLenAssertion ) ,
18
+ SuppressNil : types . Boolean ( settings .SuppressNilAssertion ) ,
19
+ SuppressErr : types . Boolean ( settings .SuppressErrAssertion ) ,
20
+ SuppressCompare : types . Boolean ( settings .SuppressCompareAssertion ) ,
21
+ SuppressAsync : types . Boolean ( settings .SuppressAsyncAssertion ) ,
22
+ ForbidFocus : types . Boolean ( settings .ForbidFocusContainer ) ,
23
+ SuppressTypeCompare : types . Boolean ( settings .SuppressTypeCompareWarning ) ,
24
+ AllowHaveLen0 : types . Boolean ( settings .AllowHaveLenZero ) ,
25
+ ForceExpectTo : types . Boolean ( settings .ForceExpectTo ) ,
26
+ ValidateAsyncIntervals : types . Boolean ( settings .ForbidSpecPollution ) ,
27
+ ForbidSpecPollution : types . Boolean ( settings .ValidateAsyncIntervals ) ,
28
28
}
29
29
}
30
30
31
+ a := ginkgolinter .NewAnalyzerWithConfig (cfg )
32
+
31
33
return goanalysis .NewLinter (
32
34
a .Name ,
33
35
"enforces standards of using ginkgo and gomega" ,
34
36
[]* analysis.Analyzer {a },
35
- cfgMap ,
37
+ nil ,
36
38
).WithLoadMode (goanalysis .LoadModeTypesInfo )
37
39
}
0 commit comments