@@ -3,32 +3,67 @@ package config
3
3
import "github.com/pkg/errors"
4
4
5
5
var defaultLintersSettings = LintersSettings {
6
- Lll : LllSettings {
7
- LineLength : 120 ,
8
- TabWidth : 1 ,
6
+ Dogsled : DogsledSettings {
7
+ MaxBlankIdentifiers : 2 ,
9
8
},
10
- Unparam : UnparamSettings {
11
- Algo : "cha" ,
9
+ ErrorLint : ErrorLintSettings {
10
+ Errorf : true ,
11
+ Asserts : true ,
12
+ Comparison : true ,
13
+ },
14
+ Exhaustive : ExhaustiveSettings {
15
+ CheckGenerated : false ,
16
+ DefaultSignifiesExhaustive : false ,
17
+ IgnoreEnumMembers : "" ,
18
+ CheckingStrategy : "value" ,
19
+ },
20
+ Forbidigo : ForbidigoSettings {
21
+ ExcludeGodocExamples : true ,
22
+ },
23
+ Gocognit : GocognitSettings {
24
+ MinComplexity : 30 ,
25
+ },
26
+ Gocritic : GocriticSettings {
27
+ SettingsPerCheck : map [string ]GocriticCheckSettings {},
28
+ },
29
+ Godox : GodoxSettings {
30
+ Keywords : []string {},
31
+ },
32
+ Gofumpt : GofumptSettings {
33
+ LangVersion : "" ,
34
+ ExtraRules : false ,
35
+ },
36
+ Ifshort : IfshortSettings {
37
+ MaxDeclLines : 1 , MaxDeclChars : 30 ,
38
+ },
39
+ Lll : LllSettings {
40
+ LineLength : 120 , TabWidth : 1 ,
12
41
},
13
42
Nakedret : NakedretSettings {
14
43
MaxFuncLines : 30 ,
15
44
},
45
+ Nestif : NestifSettings {
46
+ MinComplexity : 5 ,
47
+ },
48
+ NoLintLint : NoLintLintSettings {
49
+ RequireExplanation : false ,
50
+ AllowLeadingSpace : true ,
51
+ RequireSpecific : false ,
52
+ AllowUnused : false ,
53
+ },
16
54
Prealloc : PreallocSettings {
17
55
Simple : true ,
18
56
RangeLoops : true ,
19
57
ForLoops : false ,
20
58
},
21
- Gocritic : GocriticSettings {
22
- SettingsPerCheck : map [string ]GocriticCheckSettings {},
23
- },
24
- Godox : GodoxSettings {
25
- Keywords : []string {},
59
+ Predeclared : PredeclaredSettings {
60
+ Ignore : "" , Qualified : false ,
26
61
},
27
- Dogsled : DogsledSettings {
28
- MaxBlankIdentifiers : 2 ,
62
+ Testpackage : TestpackageSettings {
63
+ SkipRegexp : `(export|internal)_test\.go` ,
29
64
},
30
- Gocognit : GocognitSettings {
31
- MinComplexity : 30 ,
65
+ Unparam : UnparamSettings {
66
+ Algo : "cha" ,
32
67
},
33
68
WSL : WSLSettings {
34
69
StrictAppend : true ,
@@ -42,44 +77,6 @@ var defaultLintersSettings = LintersSettings{
42
77
ForceExclusiveShortDeclarations : false ,
43
78
ForceCaseTrailingWhitespaceLimit : 0 ,
44
79
},
45
- NoLintLint : NoLintLintSettings {
46
- RequireExplanation : false ,
47
- AllowLeadingSpace : true ,
48
- RequireSpecific : false ,
49
- AllowUnused : false ,
50
- },
51
- Testpackage : TestpackageSettings {
52
- SkipRegexp : `(export|internal)_test\.go` ,
53
- },
54
- Nestif : NestifSettings {
55
- MinComplexity : 5 ,
56
- },
57
- Exhaustive : ExhaustiveSettings {
58
- CheckGenerated : false ,
59
- DefaultSignifiesExhaustive : false ,
60
- IgnoreEnumMembers : "" ,
61
- CheckingStrategy : "value" ,
62
- },
63
- Gofumpt : GofumptSettings {
64
- LangVersion : "" ,
65
- ExtraRules : false ,
66
- },
67
- ErrorLint : ErrorLintSettings {
68
- Errorf : true ,
69
- Asserts : true ,
70
- Comparison : true ,
71
- },
72
- Ifshort : IfshortSettings {
73
- MaxDeclLines : 1 ,
74
- MaxDeclChars : 30 ,
75
- },
76
- Predeclared : PredeclaredSettings {
77
- Ignore : "" ,
78
- Qualified : false ,
79
- },
80
- Forbidigo : ForbidigoSettings {
81
- ExcludeGodocExamples : true ,
82
- },
83
80
}
84
81
85
82
type LintersSettings struct {
@@ -88,14 +85,15 @@ type LintersSettings struct {
88
85
Depguard DepGuardSettings
89
86
Dogsled DogsledSettings
90
87
Dupl DuplSettings
91
- Errcheck ErrcheckSettings
92
88
ErrChkJSON ErrChkJSONSettings
89
+ Errcheck ErrcheckSettings
93
90
ErrorLint ErrorLintSettings
94
91
Exhaustive ExhaustiveSettings
95
92
ExhaustiveStruct ExhaustiveStructSettings
96
93
Forbidigo ForbidigoSettings
97
94
Funlen FunlenSettings
98
95
Gci GciSettings
96
+ GoModDirectives GoModDirectivesSettings
99
97
Gocognit GocognitSettings
100
98
Goconst GoConstSettings
101
99
Gocritic GocriticSettings
@@ -108,14 +106,13 @@ type LintersSettings struct {
108
106
Goimports GoImportsSettings
109
107
Golint GoLintSettings
110
108
Gomnd GoMndSettings
111
- GoModDirectives GoModDirectivesSettings
112
109
Gomodguard GoModGuardSettings
113
110
Gosec GoSecSettings
114
111
Gosimple StaticCheckSettings
115
112
Govet GovetSettings
116
113
Ifshort IfshortSettings
117
- Ireturn IreturnSettings
118
114
ImportAs ImportAsSettings
115
+ Ireturn IreturnSettings
119
116
Lll LllSettings
120
117
Makezero MakezeroSettings
121
118
Maligned MalignedSettings
@@ -134,16 +131,16 @@ type LintersSettings struct {
134
131
Structcheck StructCheckSettings
135
132
Stylecheck StaticCheckSettings
136
133
Tagliatelle TagliatelleSettings
134
+ Tenv TenvSettings
137
135
Testpackage TestpackageSettings
138
136
Thelper ThelperSettings
139
- Tenv TenvSettings
140
137
Unparam UnparamSettings
141
138
Unused StaticCheckSettings
142
139
Varcheck VarCheckSettings
143
140
Varnamelen VarnamelenSettings
141
+ WSL WSLSettings
144
142
Whitespace WhitespaceSettings
145
143
Wrapcheck WrapcheckSettings
146
- WSL WSLSettings
147
144
148
145
Custom map [string ]CustomLinterSettings
149
146
}
@@ -166,11 +163,6 @@ type Cyclop struct {
166
163
SkipTests bool `mapstructure:"skip-tests"`
167
164
}
168
165
169
- type ErrChkJSONSettings struct {
170
- CheckErrorFreeEncoding bool `mapstructure:"check-error-free-encoding"`
171
- ReportNoExported bool `mapstructure:"report-no-exported"`
172
- }
173
-
174
166
type DepGuardSettings struct {
175
167
ListType string `mapstructure:"list-type"`
176
168
Packages []string
@@ -196,6 +188,11 @@ type ErrcheckSettings struct {
196
188
Exclude string `mapstructure:"exclude"`
197
189
}
198
190
191
+ type ErrChkJSONSettings struct {
192
+ CheckErrorFreeEncoding bool `mapstructure:"check-error-free-encoding"`
193
+ ReportNoExported bool `mapstructure:"report-no-exported"`
194
+ }
195
+
199
196
type ErrorLintSettings struct {
200
197
Errorf bool `mapstructure:"errorf"`
201
198
Asserts bool `mapstructure:"asserts"`
@@ -216,11 +213,6 @@ type ExhaustiveStructSettings struct {
216
213
StructPatterns []string `mapstructure:"struct-patterns"`
217
214
}
218
215
219
- type IreturnSettings struct {
220
- Allow []string `mapstructure:"allow"`
221
- Reject []string `mapstructure:"reject"`
222
- }
223
-
224
216
type ForbidigoSettings struct {
225
217
Forbid []string `mapstructure:"forbid"`
226
218
ExcludeGodocExamples bool `mapstructure:"exclude-godoc-examples"`
@@ -366,6 +358,11 @@ type ImportAsAlias struct {
366
358
Alias string
367
359
}
368
360
361
+ type IreturnSettings struct {
362
+ Allow []string `mapstructure:"allow"`
363
+ Reject []string `mapstructure:"reject"`
364
+ }
365
+
369
366
type LllSettings struct {
370
367
LineLength int `mapstructure:"line-length"`
371
368
TabWidth int `mapstructure:"tab-width"`
0 commit comments