12
12
# timeout for analysis, e.g. 30s, 5m, default is 1m
13
13
deadline : 20m
14
14
build-tags :
15
- - integ
16
- - integfuzz
15
+ - integ
16
+ - integfuzz
17
17
# which dirs to skip: they won't be analyzed;
18
18
# can use regexp here: generated.*, regexp is applied on full path;
19
19
# default value is empty list, but next dirs are always skipped independently
22
22
skip-dirs :
23
23
- genfiles$
24
24
- vendor$
25
-
26
25
# which files to skip: they will be analyzed, but issues from them
27
26
# won't be reported. Default value is empty list, but there is
28
27
# no need to include all autogenerated files, we confidently recognize
29
28
# autogenerated files. If it's not please let us know.
30
29
skip-files :
31
30
- " .*\\ .pb\\ .go"
32
31
- " .*\\ .gen\\ .go"
33
-
34
32
linters :
35
33
disable-all : true
36
34
enable :
37
- - errcheck
38
- - exportloopref
39
- - depguard
40
- - gocritic
41
- - gofumpt
42
- - goimports
43
- - revive
44
- - gosimple
45
- - govet
46
- - ineffassign
47
- - lll
48
- - misspell
49
- - staticcheck
50
- - stylecheck
51
- - typecheck
52
- - unconvert
53
- - unparam
54
- - unused
55
- - gci
56
- - gosec
35
+ - errcheck
36
+ - exportloopref
37
+ - depguard
38
+ - gocritic
39
+ - gofumpt
40
+ - goimports
41
+ - revive
42
+ - gosimple
43
+ - govet
44
+ - ineffassign
45
+ - lll
46
+ - misspell
47
+ - staticcheck
48
+ - stylecheck
49
+ - typecheck
50
+ - unconvert
51
+ - unparam
52
+ - unused
53
+ - gci
54
+ - gosec
57
55
fast : false
58
-
59
56
linters-settings :
60
57
errcheck :
61
58
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
62
59
# default is false: such cases aren't reported by default.
63
60
check-type-assertions : false
64
-
65
61
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
66
62
# default is false: such cases aren't reported by default.
67
63
check-blank : false
@@ -81,7 +77,7 @@ linters-settings:
81
77
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
82
78
locale : US
83
79
ignore-words :
84
- - cancelled
80
+ - cancelled
85
81
lll :
86
82
# max line length, lines longer will be reported. Default is 120.
87
83
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
@@ -95,60 +91,61 @@ linters-settings:
95
91
error-code : 2
96
92
warning-code : 1
97
93
rules :
98
- - name : blank-imports
99
- - name : context-keys-type
100
- - name : time-naming
101
- - name : var-declaration
102
- - name : unexported-return
103
- - name : errorf
104
- - name : context-as-argument
105
- - name : dot-imports
106
- - name : error-return
107
- - name : error-strings
108
- - name : error-naming
109
- - name : increment-decrement
110
- - name : var-naming
111
- - name : package-comments
112
- - name : range
113
- - name : receiver-naming
114
- - name : indent-error-flow
115
- - name : superfluous-else
116
- - name : modifies-parameter
117
- - name : unreachable-code
118
- - name : struct-tag
119
- - name : constant-logical-expr
120
- - name : bool-literal-in-expr
121
- - name : redefines-builtin-id
122
- - name : imports-blacklist
123
- - name : range-val-in-closure
124
- - name : range-val-address
125
- - name : waitgroup-by-value
126
- - name : atomic
127
- - name : call-to-gc
128
- - name : duplicated-imports
129
- - name : string-of-int
130
- - name : defer
131
- arguments : [["call-chain"]]
132
- - name : unconditional-recursion
133
- - name : identical-branches
134
- # the following rules can be enabled in the future
135
- # - name: empty-lines
136
- # - name: confusing-results
137
- # - name: empty-block
138
- # - name: get-return
139
- # - name: confusing-naming
140
- # - name: unexported-naming
141
- # - name: early-return
142
- # - name: unused-parameter
143
- # - name: unnecessary-stmt
144
- # - name: deep-exit
145
- # - name: import-shadowing
146
- # - name: modifies-value-receiver
147
- # - name: unused-receiver
148
- # - name: bare-return
149
- # - name: flag-parameter
150
- # - name: unhandled-error
151
- # - name: if-return
94
+ - name : blank-imports
95
+ - name : context-keys-type
96
+ - name : time-naming
97
+ - name : var-declaration
98
+ - name : unexported-return
99
+ - name : errorf
100
+ - name : context-as-argument
101
+ - name : dot-imports
102
+ - name : error-return
103
+ - name : error-strings
104
+ - name : error-naming
105
+ - name : increment-decrement
106
+ - name : var-naming
107
+ - name : package-comments
108
+ - name : range
109
+ - name : receiver-naming
110
+ - name : indent-error-flow
111
+ - name : superfluous-else
112
+ - name : modifies-parameter
113
+ - name : unreachable-code
114
+ - name : struct-tag
115
+ - name : constant-logical-expr
116
+ - name : bool-literal-in-expr
117
+ - name : redefines-builtin-id
118
+ - name : imports-blacklist
119
+ - name : range-val-in-closure
120
+ - name : range-val-address
121
+ - name : waitgroup-by-value
122
+ - name : atomic
123
+ - name : call-to-gc
124
+ - name : duplicated-imports
125
+ - name : string-of-int
126
+ - name : defer
127
+ arguments :
128
+ - - "call-chain"
129
+ - name : unconditional-recursion
130
+ - name : identical-branches
131
+ # the following rules can be enabled in the future
132
+ # - name: empty-lines
133
+ # - name: confusing-results
134
+ # - name: empty-block
135
+ # - name: get-return
136
+ # - name: confusing-naming
137
+ # - name: unexported-naming
138
+ # - name: early-return
139
+ # - name: unused-parameter
140
+ # - name: unnecessary-stmt
141
+ # - name: deep-exit
142
+ # - name: import-shadowing
143
+ # - name: modifies-value-receiver
144
+ # - name: unused-receiver
145
+ # - name: bare-return
146
+ # - name: flag-parameter
147
+ # - name: unhandled-error
148
+ # - name: if-return
152
149
unused :
153
150
# treat code as a program (not a library) and report unused exported identifiers; default is false.
154
151
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
@@ -159,7 +156,6 @@ linters-settings:
159
156
# call graph construction algorithm (cha, rta). In general, use cha for libraries,
160
157
# and rta for programs with main packages. Default is cha.
161
158
algo : cha
162
-
163
159
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
164
160
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
165
161
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
@@ -216,7 +212,6 @@ linters-settings:
216
212
- unslice
217
213
- valSwap
218
214
- weakCond
219
-
220
215
# Unused
221
216
# - yodaStyleExpr
222
217
# - appendAssign
@@ -237,46 +232,38 @@ linters-settings:
237
232
# - wrapperFunc
238
233
depguard :
239
234
packages-with-error-message :
240
- - github.com/gogo/protobuf : " gogo/protobuf is deprecated, use golang/protobuf"
241
- - golang.org/x/net/http2/h2c : " h2c.NewHandler is unsafe; use wrapper istio.io/istio/pkg/h2c"
242
- - github.com/golang/protobuf/jsonpb : " don't use the jsonpb package directly; use util/protomarshal instead"
243
- - google.golang.org/protobuf/encoding/protojson : " don't use the protojson package directly; use util/protomarshal instead"
235
+ - github.com/gogo/protobuf : " gogo/protobuf is deprecated, use golang/protobuf"
244
236
gosec :
245
237
includes :
246
- - G401
247
- - G402
248
- - G404
238
+ - G401
239
+ - G402
240
+ - G404
249
241
issues :
250
242
# List of regexps of issue texts to exclude, empty list by default.
251
243
# But independently from this option we use default exclude patterns,
252
244
# it can be disabled by `exclude-use-default: false`. To list all
253
245
# excluded by default patterns execute `golangci-lint run --help`
254
246
exclude :
255
247
- composite literal uses unkeyed fields
256
-
257
248
exclude-rules :
258
249
# Exclude some linters from running on test files.
259
250
- path : _test\.go$|^tests/|^samples/
260
251
linters :
261
252
- errcheck
262
253
- maligned
263
-
264
254
# We need to use the deprecated module since the jsonpb replacement is not backwards compatible.
265
255
- linters :
266
256
- staticcheck
267
257
text : " SA1019: package github.com/golang/protobuf/jsonpb"
268
258
- linters :
269
259
- staticcheck
270
260
text : ' SA1019: "github.com/golang/protobuf/jsonpb"'
271
-
272
261
# Independently from option `exclude` we use default exclude patterns,
273
262
# it can be disabled by this option. To list all
274
263
# excluded by default patterns execute `golangci-lint run --help`.
275
264
# Default value for this option is true.
276
265
exclude-use-default : true
277
-
278
266
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
279
267
max-per-linter : 0
280
-
281
268
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
282
269
max-same-issues : 0
0 commit comments