Skip to content

Commit 50cfc34

Browse files
jirfagtpounds
authored andcommitted
gocognit: fix default threshold from 0 to 30
1 parent fbbd245 commit 50cfc34

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pkg/config/config.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ type LintersSettings struct {
138138
Gocyclo struct {
139139
MinComplexity int `mapstructure:"min-complexity"`
140140
}
141-
Gocognit struct {
142-
MinComplexity int `mapstructure:"min-complexity"`
143-
}
144141
Varcheck struct {
145142
CheckExportedFields bool `mapstructure:"exported-fields"`
146143
}
@@ -187,6 +184,7 @@ type LintersSettings struct {
187184
Gocritic GocriticSettings
188185
Godox GodoxSettings
189186
Dogsled DogsledSettings
187+
Gocognit GocognitSettings
190188
}
191189

192190
type GovetSettings struct {
@@ -247,6 +245,10 @@ type DogsledSettings struct {
247245
MaxBlankIdentifiers int `mapstructure:"max-blank-identifiers"`
248246
}
249247

248+
type GocognitSettings struct {
249+
MinComplexity int `mapstructure:"min-complexity"`
250+
}
251+
250252
var defaultLintersSettings = LintersSettings{
251253
Lll: LllSettings{
252254
LineLength: 120,
@@ -272,6 +274,9 @@ var defaultLintersSettings = LintersSettings{
272274
Dogsled: DogsledSettings{
273275
MaxBlankIdentifiers: 2,
274276
},
277+
Gocognit: GocognitSettings{
278+
MinComplexity: 30,
279+
},
275280
}
276281

277282
type Linters struct {

0 commit comments

Comments
 (0)