5
5
# common-files repo, make the change there and check it in. Then come back to this repo and run
6
6
# "make update-common".
7
7
8
- service :
9
- # When updating this, also update the version stored in docker/build-tools/Dockerfile in the istio/tools repo.
10
- golangci-lint-version : 1.57.x # use the fixed version to not introduce new linters unexpectedly
11
8
run :
12
- # timeout for analysis, e.g. 30s, 5m, default is 1m
13
- deadline : 20m
9
+ # Timeout for analysis, e.g. 30s, 5m.
10
+ # Default: 1m
11
+ timeout : 20m
14
12
build-tags :
15
13
- integ
16
14
- integfuzz
17
- # which dirs to skip: they won't be analyzed;
18
- # can use regexp here: generated.*, regexp is applied on full path;
19
- # default value is empty list, but next dirs are always skipped independently
20
- # from this option's value:
21
- # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
22
- skip-dirs :
23
- - genfiles$
24
- - vendor$
25
- # which files to skip: they will be analyzed, but issues from them
26
- # won't be reported. Default value is empty list, but there is
27
- # no need to include all autogenerated files, we confidently recognize
28
- # autogenerated files. If it's not please let us know.
29
- skip-files :
30
- - " .*\\ .pb\\ .go"
31
- - " .*\\ .gen\\ .go"
32
15
linters :
33
16
disable-all : true
34
17
enable :
@@ -62,15 +45,13 @@ linters-settings:
62
45
# default is false: such cases aren't reported by default.
63
46
check-blank : false
64
47
govet :
65
- # report about shadowed variables
66
- check-shadowing : false
48
+ disable :
49
+ # report about shadowed variables
50
+ - shadow
67
51
goimports :
68
52
# put imports beginning with prefix after 3rd-party packages;
69
53
# it's a comma-separated list of prefixes
70
54
local-prefixes : istio.io/
71
- maligned :
72
- # print struct with more effective memory layout or not, false by default
73
- suggest-new : true
74
55
misspell :
75
56
# Correct spellings using locale preferences for US or UK.
76
57
# Default is to use a neutral variety of English.
@@ -88,8 +69,6 @@ linters-settings:
88
69
ignore-generated-header : false
89
70
severity : " warning"
90
71
confidence : 0.0
91
- error-code : 2
92
- warning-code : 1
93
72
rules :
94
73
- name : blank-imports
95
74
- name : context-keys-type
@@ -146,16 +125,7 @@ linters-settings:
146
125
# - name: flag-parameter
147
126
# - name: unhandled-error
148
127
# - name: if-return
149
- unused :
150
- # treat code as a program (not a library) and report unused exported identifiers; default is false.
151
- # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
152
- # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
153
- # with golangci-lint call it on a directory with the changed file.
154
- check-exported : false
155
128
unparam :
156
- # call graph construction algorithm (cha, rta). In general, use cha for libraries,
157
- # and rta for programs with main packages. Default is cha.
158
- algo : cha
159
129
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
160
130
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
161
131
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
@@ -167,6 +137,11 @@ linters-settings:
167
137
- default # Contains all imports that could not be matched to another section type.
168
138
- prefix(istio.io/) # Groups all imports with the specified Prefix.
169
139
gocritic :
140
+ # Disable all checks.
141
+ # Default: false
142
+ disable-all : true
143
+ # Which checks should be enabled in addition to default checks. Since we don't want
144
+ # all of the default checks, we do the disable-all first.
170
145
enabled-checks :
171
146
- appendCombine
172
147
- argOrder
@@ -212,24 +187,6 @@ linters-settings:
212
187
- unslice
213
188
- valSwap
214
189
- weakCond
215
- # Unused
216
- # - yodaStyleExpr
217
- # - appendAssign
218
- # - commentFormatting
219
- # - emptyStringTest
220
- # - exitAfterDefer
221
- # - ifElseChain
222
- # - hugeParam
223
- # - importShadow
224
- # - nestingReduce
225
- # - paramTypeCombine
226
- # - ptrToRefParam
227
- # - rangeValCopy
228
- # - singleCaseSwitch
229
- # - sloppyReassign
230
- # - unlabelStmt
231
- # - unnamedResult
232
- # - wrapperFunc
233
190
depguard :
234
191
rules :
235
192
DenyGogoProtobuf :
@@ -250,6 +207,24 @@ issues:
250
207
# excluded by default patterns execute `golangci-lint run --help`
251
208
exclude :
252
209
- composite literal uses unkeyed fields
210
+ # Which dirs to exclude: issues from them won't be reported.
211
+ # Can use regexp here: `generated.*`, regexp is applied on full path,
212
+ # including the path prefix if one is set.
213
+ # Default dirs are skipped independently of this option's value (see exclude-dirs-use-default).
214
+ # "/" will be replaced by current OS file path separator to properly work on Windows.
215
+ # Default: []
216
+ exclude-dirs :
217
+ - genfiles$
218
+ - vendor$
219
+ # Which files to exclude: they will be analyzed, but issues from them won't be reported.
220
+ # There is no need to include all autogenerated files,
221
+ # we confidently recognize autogenerated files.
222
+ # If it's not, please let us know.
223
+ # "/" will be replaced by current OS file path separator to properly work on Windows.
224
+ # Default: []
225
+ exclude-files :
226
+ - " .*\\ .pb\\ .go"
227
+ - " .*\\ .gen\\ .go"
253
228
exclude-rules :
254
229
# Exclude some linters from running on test files.
255
230
- path : _test\.go$|^tests/|^samples/
@@ -270,7 +245,9 @@ issues:
270
245
# excluded by default patterns execute `golangci-lint run --help`.
271
246
# Default value for this option is true.
272
247
exclude-use-default : true
273
- # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
274
- max-per-linter : 0
248
+ # Maximum issues count per one linter.
249
+ # Set to 0 to disable.
250
+ # Default: 50
251
+ max-issues-per-linter : 0
275
252
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
276
253
max-same-issues : 0
0 commit comments