File tree 4 files changed +10
-22
lines changed
4 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -2002,6 +2002,7 @@ linters:
2002
2002
- forcetypeassert
2003
2003
- funlen
2004
2004
- gci
2005
+ - ginkgolinter
2005
2006
- gochecknoglobals
2006
2007
- gochecknoinits
2007
2008
- gocognit
@@ -2109,6 +2110,7 @@ linters:
2109
2110
- forcetypeassert
2110
2111
- funlen
2111
2112
- gci
2113
+ - ginkgolinter
2112
2114
- gochecknoglobals
2113
2115
- gochecknoinits
2114
2116
- gocognit
Original file line number Diff line number Diff line change @@ -40,9 +40,6 @@ var defaultLintersSettings = LintersSettings{
40
40
Sections : []string {"standard" , "default" },
41
41
SkipGenerated : true ,
42
42
},
43
- GinkgoLinter : GinkgolinterSettings {
44
- SuppressLenAssertion : false ,
45
- },
46
43
Gocognit : GocognitSettings {
47
44
MinComplexity : 30 ,
48
45
},
@@ -153,7 +150,7 @@ type LintersSettings struct {
153
150
Forbidigo ForbidigoSettings
154
151
Funlen FunlenSettings
155
152
Gci GciSettings
156
- GinkgoLinter GinkgolinterSettings
153
+ GinkgoLinter GinkgoLinterSettings
157
154
Gocognit GocognitSettings
158
155
Goconst GoConstSettings
159
156
Gocritic GoCriticSettings
@@ -325,7 +322,7 @@ type GciSettings struct {
325
322
CustomOrder bool `mapstructure:"custom-order"`
326
323
}
327
324
328
- type GinkgolinterSettings struct {
325
+ type GinkgoLinterSettings struct {
329
326
SuppressLenAssertion bool `mapstructure:"suppress-len-assertion"`
330
327
SuppressNilAssertion bool `mapstructure:"suppress-nil-assertion"`
331
328
SuppressErrAssertion bool `mapstructure:"suppress-err-assertion"`
Original file line number Diff line number Diff line change @@ -8,26 +8,15 @@ import (
8
8
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
9
9
)
10
10
11
- func NewGinkgoLinter (cfg * config.GinkgolinterSettings ) * goanalysis.Linter {
11
+ func NewGinkgoLinter (cfg * config.GinkgoLinterSettings ) * goanalysis.Linter {
12
12
a := ginkgolinter .NewAnalyzer ()
13
13
14
14
cfgMap := make (map [string ]map [string ]interface {})
15
15
if cfg != nil {
16
- settings := make (map [string ]interface {})
17
- if cfg .SuppressLenAssertion {
18
- settings ["suppress-len-assertion" ] = true
19
- }
20
-
21
- if cfg .SuppressNilAssertion {
22
- settings ["suppress-nil-assertion" ] = true
23
- }
24
-
25
- if cfg .SuppressErrAssertion {
26
- settings ["suppress-err-assertion" ] = true
27
- }
28
-
29
- if len (settings ) > 0 {
30
- cfgMap [a .Name ] = settings
16
+ cfgMap [a .Name ] = map [string ]interface {}{
17
+ "suppress-len-assertion" : cfg .SuppressLenAssertion ,
18
+ "suppress-nil-assertion" : cfg .SuppressNilAssertion ,
19
+ "suppress-err-assertion" : cfg .SuppressErrAssertion ,
31
20
}
32
21
}
33
22
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
118
118
forbidigoCfg * config.ForbidigoSettings
119
119
funlenCfg * config.FunlenSettings
120
120
gciCfg * config.GciSettings
121
- ginkgolinterCfg * config.GinkgolinterSettings
121
+ ginkgolinterCfg * config.GinkgoLinterSettings
122
122
gocognitCfg * config.GocognitSettings
123
123
goconstCfg * config.GoConstSettings
124
124
gocriticCfg * config.GoCriticSettings
You can’t perform that action at this time.
0 commit comments