@@ -10,16 +10,36 @@ issues:
10
10
linters :
11
11
default : none
12
12
enable :
13
- - depguard
13
+ # 1. This is the default enabled set of golanci
14
+
15
+ # We should consider enabling errcheck
16
+ # - errcheck
14
17
- govet
15
18
- ineffassign
16
- - misspell
17
- - nakedret
18
- - prealloc
19
- - revive
20
19
- staticcheck
21
- - unconvert
22
20
- unused
21
+
22
+ # 2. These are not part of the default set
23
+
24
+ # Important to prevent import of certain packages
25
+ - depguard
26
+ # Removes unnecessary conversions
27
+ - unconvert
28
+ # Flag common typos
29
+ - misspell
30
+ # A meta-linter seen as a good replacement for golint
31
+ - revive
32
+ # Gocritic
33
+ - gocritic
34
+
35
+ # 3. We used to use these, but have now removed them
36
+
37
+ # Use of prealloc is generally premature optimization and performance profiling should be done instead
38
+ # https://golangci-lint.run/usage/linters/#prealloc
39
+ # - prealloc
40
+ # Provided by revive in a better way
41
+ # - nakedret
42
+
23
43
settings :
24
44
staticcheck :
25
45
checks :
@@ -119,7 +139,6 @@ linters:
119
139
- name : line-length-limit
120
140
# Better dealt with by formatter golines
121
141
disabled : true
122
-
123
142
depguard :
124
143
rules :
125
144
no-patent :
@@ -141,67 +160,53 @@ linters:
141
160
- pkg : github.com/containerd/nerdctl/v2/cmd
142
161
desc : pkg must not depend on any cmd files
143
162
gocritic :
144
- enabled-checks :
163
+ disabled-checks :
164
+ # Below are normally enabled by default, but we do not pass
145
165
- appendAssign
146
- - argOrder
147
- - badCond
148
- - caseOrder
149
- - codegenComment
150
- - commentedOutCode
151
- - deprecatedComment
152
- - dupArg
153
- - dupBranchBody
154
- - dupCase
155
- - dupSubExpr
156
- - exitAfterDefer
157
- - flagDeref
158
- - flagName
166
+ - ifElseChain
167
+ - unslice
168
+ - badCall
169
+ - assignOp
170
+ - commentFormatting
171
+ - captLocal
172
+ - singleCaseSwitch
173
+ - wrapperFunc
174
+ - elseif
175
+ - regexpMust
176
+ enabled-checks :
177
+ # Below used to be enabled, but we do not pass anymore
178
+ # - paramTypeCombine
179
+ # - octalLiteral
180
+ # - unnamedResult
181
+ # - equalFold
182
+ # - sloppyReassign
183
+ # - emptyStringTest
184
+ # - hugeParam
185
+ # - appendCombine
186
+ # - stringXbytes
187
+ # - ptrToRefParam
188
+ # - commentedOutCode
189
+ # - rangeValCopy
190
+ # - methodExprCall
191
+ # - yodaStyleExpr
192
+ # - typeUnparen
193
+
194
+ # We enabled these and we pass
159
195
- nilValReturn
160
- - offBy1
161
- - sloppyReassign
162
196
- weakCond
163
- - octalLiteral
164
- - appendCombine
165
- - equalFold
166
- - hugeParam
167
197
- indexAlloc
168
198
- rangeExprCopy
169
- - rangeValCopy
170
- - assignOp
171
199
- boolExprSimplify
172
- - captLocal
173
- - commentFormatting
174
200
- commentedOutImport
175
- - defaultCaseOrder
176
201
- docStub
177
- - elseif
178
202
- emptyFallthrough
179
- - emptyStringTest
180
203
- hexLiteral
181
- - ifElseChain
182
- - methodExprCall
183
- - regexpMust
184
- - singleCaseSwitch
185
- - sloppyLen
186
- - stringXbytes
187
- - switchTrue
188
204
- typeAssertChain
189
- - typeSwitchVar
190
- - underef
191
205
- unlabelStmt
192
- - unlambda
193
- - unslice
194
- - valSwap
195
- - wrapperFunc
196
- - yodaStyleExpr
197
206
- builtinShadow
198
207
- importShadow
199
208
- initClause
200
209
- nestingReduce
201
- - paramTypeCombine
202
- - ptrToRefParam
203
- - typeUnparen
204
- - unnamedResult
205
210
- unnecessaryBlock
206
211
exclusions :
207
212
generated : disable
@@ -220,14 +225,14 @@ formatters:
220
225
gofumpt :
221
226
extra-rules : true
222
227
golines :
223
- max-len : 100
228
+ max-len : 500
224
229
tab-len : 4
225
230
shorten-comments : true
226
231
enable :
227
232
- gci
228
233
- gofmt
229
234
# We might consider enabling the following:
230
235
# - gofumpt
231
- # - golines
236
+ - golines
232
237
exclusions :
233
238
generated : disable
0 commit comments