4
4
concurrency : 4
5
5
6
6
# timeout for analysis, e.g. 30s, 5m, default is 1m
7
- deadline : 10m
7
+ timeout : 15m
8
8
9
9
# exit code when at least one issue was found, default is 1
10
10
issues-exit-code : 1
13
13
tests : true
14
14
15
15
# list of build tags, all linters use it. Default is empty list.
16
- # build-tags:
17
- # - mytag
16
+ build-tags :
17
+ - unit
18
+ - allcomponents
19
+ - subtlecrypto
18
20
21
+ # which files to skip: they will be analyzed, but issues from them
22
+ # won't be reported. Default value is empty list, but there is
23
+ # no need to include all autogenerated files, we confidently recognize
24
+ # autogenerated files. If it's not please let us know.
25
+ # skip-files:
26
+ # - ".*\\.my\\.go$"
27
+ # - lib/bad.go
28
+
29
+ issues :
19
30
# which dirs to skip: they won't be analyzed;
20
31
# can use regexp here: generated.*, regexp is applied on full path;
21
32
# default value is empty list, but next dirs are always skipped independently
22
33
# from this option's value:
23
34
# third_party$, testdata$, examples$, Godeps$, builtin$
24
- skip -dirs :
35
+ exclude -dirs :
25
36
- ^pkg.*client.*clientset.*versioned.*
26
37
- ^pkg.*client.*informers.*externalversions.*
27
38
- ^pkg.*proto.*
28
39
29
- # which files to skip: they will be analyzed, but issues from them
30
- # won't be reported. Default value is empty list, but there is
31
- # no need to include all autogenerated files, we confidently recognize
32
- # autogenerated files. If it's not please let us know.
33
- # skip-files:
34
- # - ".*\\.my\\.go$"
35
- # - lib/bad.go
36
-
37
40
# output configuration options
38
41
output :
39
42
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
40
- format : tab
43
+ formats :
44
+ - format : tab
41
45
42
46
# print lines of code with issue, default is true
43
47
print-issued-lines : true
@@ -57,23 +61,19 @@ linters-settings:
57
61
# default is false: such cases aren't reported by default.
58
62
check-blank : false
59
63
60
- # [deprecated] comma-separated list of pairs of the form pkg:regex
61
- # the regex is used to ignore names within pkg. (default "fmt:.*").
62
- # see https://github.com/kisielk/errcheck#the-deprecated-method for details
63
- ignore : fmt:.*,io/ioutil:^Read.*
64
+ exclude-functions :
65
+ - fmt:.*
66
+ - io/ioutil:^Read.*
64
67
65
68
# path to a file containing a list of functions to exclude from checking
66
69
# see https://github.com/kisielk/errcheck#excluding-functions for details
67
- # exclude:
70
+ # exclude:
68
71
69
72
funlen :
70
73
lines : 60
71
74
statements : 40
72
75
73
76
govet :
74
- # report about shadowed variables
75
- check-shadowing : true
76
-
77
77
# settings per analyzer
78
78
settings :
79
79
printf : # analyzer name, run `go tool vet help` to see all analyzers
@@ -86,28 +86,12 @@ linters-settings:
86
86
# enable or disable analyzers by name
87
87
enable :
88
88
- atomicalign
89
- enable-all : false
90
- disable :
91
89
- shadow
90
+ enable-all : false
92
91
disable-all : false
93
92
revive :
94
- max-open-files : 2048
95
- # enable-all-rules: true
96
- rules :
97
- - name : cyclomatic
98
- severity : warning
99
- disabled : false
100
- arguments : [20]
101
- - name : argument-limit
102
- severity : warning
103
- disabled : false
104
- arguments : [8]
105
- - name : if-return
106
- severity : warning
107
- disabled : false
108
- - name : unused-parameter
109
- severity : warning
110
- disabled : true
93
+ # minimal confidence for issues, default is 0.8
94
+ confidence : 0.8
111
95
gofmt :
112
96
# simplify code: gofmt with `-s` option, true by default
113
97
simplify : true
@@ -121,9 +105,6 @@ linters-settings:
121
105
gocognit :
122
106
# minimal code complexity to report, 30 by default (but we recommend 10-20)
123
107
min-complexity : 10
124
- maligned :
125
- # print struct with more effective memory layout or not, false by default
126
- suggest-new : true
127
108
dupl :
128
109
# tokens count to trigger issue, 150 by default
129
110
threshold : 100
@@ -152,10 +133,9 @@ linters-settings:
152
133
desc : " you must use github.com/cenkalti/backoff/v4"
153
134
misspell :
154
135
# Correct spellings using locale preferences for US or UK.
155
- # Default is to use a neutral variety of English. (Do not specify a locale value)
136
+ # Default is to use a neutral variety of English.
156
137
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
157
- # locale:
158
-
138
+ # locale: default
159
139
ignore-words :
160
140
- someword
161
141
lll :
@@ -164,12 +144,6 @@ linters-settings:
164
144
line-length : 120
165
145
# tab width in spaces. Default to 1.
166
146
tab-width : 1
167
- unparam :
168
- # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
169
- # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
170
- # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
171
- # with golangci-lint call it on a directory with the changed file.
172
- check-exported : false
173
147
nakedret :
174
148
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
175
149
max-func-lines : 30
@@ -187,7 +161,7 @@ linters-settings:
187
161
# See https://go-critic.github.io/overview#checks-overview
188
162
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
189
163
# By default list of stable checks is used.
190
- # enabled-checks:
164
+ # enabled-checks:
191
165
192
166
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
193
167
disabled-checks :
@@ -235,17 +209,20 @@ linters-settings:
235
209
allow-assign-and-call : true
236
210
# Allow multiline assignments to be cuddled. Default is true.
237
211
allow-multiline-assign : true
238
- # Allow case blocks to end with a whitespace.
239
- force-case-trailing-whitespace : 0
240
212
# Allow declarations (var) to be cuddled.
241
213
allow-cuddle-declarations : false
214
+ # If the number of lines in a case block is equal to or lager than this number,
215
+ # the case *must* end white a newline.
216
+ # https://github.com/bombsimon/wsl/blob/master/doc/configuration.md#force-case-trailing-whitespace
217
+ # Default: 0
218
+ force-case-trailing-whitespace : 1
242
219
243
220
linters :
244
221
fast : false
245
222
enable-all : true
246
223
disable :
247
224
# TODO Enforce the below linters later
248
- - nosnakecase
225
+ - musttag
249
226
- dupl
250
227
- errcheck
251
228
- funlen
@@ -254,26 +231,17 @@ linters:
254
231
- gocyclo
255
232
- gocognit
256
233
- godox
257
- - interfacer
258
234
- lll
259
- - maligned
260
- - scopelint
261
235
- unparam
262
236
- wsl
263
237
- gomnd
264
238
- testpackage
265
- - goerr113
266
239
- nestif
267
240
- nlreturn
268
- - tagliatelle
269
- - ifshort
270
- - forbidigo
271
241
- exhaustive
272
242
- exhaustruct
273
- - exhaustivestruct
274
243
- noctx
275
244
- gci
276
- - golint
277
245
- tparallel
278
246
- paralleltest
279
247
- wrapcheck
@@ -287,7 +255,6 @@ linters:
287
255
- varnamelen
288
256
- errorlint
289
257
- forcetypeassert
290
- - ifshort
291
258
- maintidx
292
259
- nilnil
293
260
- predeclared
@@ -300,14 +267,12 @@ linters:
300
267
- asasalint
301
268
- rowserrcheck
302
269
- sqlclosecheck
303
- - structcheck
304
- - varcheck
305
- - deadcode
306
- - golint
307
270
- inamedparam
308
- issues :
309
- exclude-rules :
310
- - path : .*_test.go
311
- linters :
312
- - godot
313
-
271
+ - tagalign
272
+ - mnd
273
+ - canonicalheader
274
+ - exportloopref
275
+ - execinquery
276
+ - err113
277
+ - fatcontext
278
+ - forbidigo # TODO: Re-enable and remove fmt.println
0 commit comments