@@ -9,53 +9,70 @@ issues:
9
9
- " .*\\ .resolvers\\ .go$"
10
10
11
11
run :
12
- # default concurrency is a available CPU number
13
12
concurrency : 4
14
- # timeout for analysis, e.g. 30s, 5m, default is 1m
15
- deadline : 20m
16
- # exit code when at least one issue was found, default is 1
13
+ timeout : 20m
17
14
issues-exit-code : 1
18
- # include test files or not, default is true
19
15
tests : false
20
-
21
- # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
22
- # If invoked with -mod=readonly, the go command is disallowed from the implicit
23
- # automatic updating of go.mod described above. Instead, it fails when any changes
24
- # to go.mod are needed. This setting is most useful to check that go.mod does
25
- # not need updates, such as in a continuous integration and testing system.
26
- # If invoked with -mod=vendor, the go command assumes that the vendor
27
- # directory holds the correct copies of dependencies and ignores
28
- # the dependency descriptions in go.mod.
29
16
modules-download-mode : readonly
30
-
31
- # Allow multiple parallel golangci-lint instances running.
32
- # If false (default) - golangci-lint acquires file lock on start.
33
17
allow-parallel-runners : false
34
18
35
19
# output configuration options
36
20
output :
37
- # colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
38
- # default is "colored-line-number"
39
- formats : colored-line-number
40
-
41
- # print lines of code with issue, default is true
42
21
print-issued-lines : true
43
-
44
- # print linter name in the end of issue text, default is true
45
22
print-linter-name : true
23
+ sort-results : true
24
+ sort-order :
25
+ - linter
26
+ - severity
27
+ - file
28
+ show-stats : true
46
29
47
- # add a prefix to the output file references; default is no prefix
48
- path-prefix : " "
49
-
50
- # sorts results by: filepath, line and column
51
- sort-results : false
30
+ linters :
31
+ enable :
32
+ - bodyclose
33
+ # - deadcode
34
+ - depguard
35
+ - dogsled
36
+ # - dupl
37
+ - errcheck
38
+ - errorlint
39
+ - copyloopvar
40
+ - exhaustive
41
+ - forbidigo
42
+ - funlen
43
+ # - gochecknoinits
44
+ - goconst
45
+ - gocritic
46
+ - gocyclo
47
+ - gofmt
48
+ - govet
49
+ - goheader
50
+ - goimports
51
+ - goprintffuncname
52
+ - gosec
53
+ - gosimple
54
+ - ineffassign
55
+ # - lll
56
+ - misspell
57
+ - nakedret
58
+ - noctx
59
+ - nolintlint
60
+ - revive
61
+ - rowserrcheck
62
+ - staticcheck
63
+ # - structcheck
64
+ - stylecheck
65
+ - typecheck
66
+ - unconvert
67
+ - unparam
68
+ - unused
69
+ # - varcheck
70
+ - whitespace
52
71
53
72
linters-settings :
54
73
dogsled :
55
- # checks assignments with too many blank identifiers; default is 2
56
74
max-blank-identifiers : 2
57
75
dupl :
58
- # tokens count to trigger issue, 150 by default
59
76
threshold : 150
60
77
depguard :
61
78
rules :
@@ -104,11 +121,10 @@ linters-settings:
104
121
- github.com/miscreant/miscreant.go
105
122
- github.com/oklog/run
106
123
- github.com/open-policy-agent/opa/rego
107
- - github.com/opencontainers/image-spec
108
124
- github.com/opencontainers/go-digest
125
+ - github.com/opencontainers/image-spec
109
126
- github.com/ory/dockertest/v3
110
127
- github.com/pelletier/go-toml
111
- - github.com/pelletier/go-toml
112
128
- github.com/pierrec/lz4
113
129
- github.com/pkg/errors
114
130
- github.com/psanford/memfs
@@ -121,37 +137,35 @@ linters-settings:
121
137
- github.com/xeipuuv/gojsonschema
122
138
- github.com/zclconf/go-cty/cty
123
139
- gitlab.com/NebulousLabs/merkletree
140
+ - go.etcd.io/etcd
141
+ - go.step.sm/crypto
142
+ - go.uber.org/zap
143
+ - golang.org/x/crypto
144
+ - golang.org/x/oauth2
145
+ - golang.org/x/ssh
146
+ - golang.org/x/sync
147
+ - golang.org/x/sys
148
+ - golang.org/x/term
149
+ - google.golang.org/genproto
150
+ - google.golang.org/protobuf
151
+ - gopkg.in/square/go-jose.v2
152
+ - gopkg.in/yaml.v3
124
153
- oras.land/oras-go
125
154
- sigs.k8s.io/yaml
126
155
- zntr.io/paseto/v3
127
156
- zntr.io/paseto/v4
128
157
129
158
errcheck :
130
- # report about not checking of errors in type assertions: `a := b.(MyStruct)`;
131
- # default is false: such cases aren't reported by default.
132
159
check-type-assertions : false
133
-
134
- # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
135
- # default is false: such cases aren't reported by default.
136
160
check-blank : false
137
-
138
- # [deprecated] comma-separated list of pairs of the form pkg:regex
139
- # the regex is used to ignore names within pkg. (default "fmt:.*").
140
- # see https://github.com/kisielk/errcheck#the-deprecated-method for details
141
- exclude-functions : fmt:.*,io/ioutil:^Read.*
161
+ exclude-functions :
162
+ - fmt:.*
163
+ - io/ioutil.Read.*
142
164
exhaustive :
143
- # check switch statements in generated files also
144
165
check-generated : false
145
- # indicates that switch statements are to be considered exhaustive if a
146
- # 'default' case is present, even if all enum members aren't listed in the
147
- # switch
148
166
default-signifies-exhaustive : false
149
- govet :
150
- shadow : true
151
167
goimports :
152
- local : " github.com/elastic"
153
- golint :
154
- min-confidence : 0.8
168
+ local-prefixes : " github.com/elastic"
155
169
gofmt :
156
170
simplify : true
157
171
gocyclo :
@@ -165,55 +179,34 @@ linters-settings:
165
179
line-length : 140
166
180
tab-width : 1
167
181
gci :
168
- # put imports beginning with prefix after 3rd-party packages;
169
- # only support one prefix
170
- # if not set, use goimports.local-prefixes
171
182
sections :
172
183
- prefix(github.com/elastic)
173
184
gocognit :
174
- # minimal code complexity to report, 30 by default (but we recommend 10-20)
175
185
min-complexity : 20
176
186
goconst :
177
- # minimal length of string constant, 3 by default
178
187
min-len : 3
179
- # minimal occurrences count to trigger, 3 by default
180
188
min-occurrences : 3
181
189
nestif :
182
- # minimal complexity of if statements to report, 5 by default
183
190
min-complexity : 4
184
191
unused :
185
- # treat code as a program (not a library) and report unused exported identifiers; default is false.
186
- # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
187
- # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
188
- # with golangci-lint call it on a directory with the changed file.
189
- check-exported : false
192
+ exported-fields-are-used : false
190
193
unparam :
191
- # call graph construction algorithm (cha, rta). In general, use cha for libraries,
192
- # and rta for programs with main packages. Default is cha.
193
- algo : cha
194
-
195
- # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
196
- # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
197
- # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
198
- # with golangci-lint call it on a directory with the changed file.
199
194
check-exported : false
200
195
nakedret :
201
196
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
202
197
max-func-lines : 30
203
198
prealloc :
204
- # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
205
- # True by default.
206
199
simple : true
207
- range-loops : true # Report preallocation suggestions on range loops, true by default
208
- for-loops : false # Report preallocation suggestions on for loops, false by default
200
+ range-loops : true
201
+ for-loops : false
209
202
funlen :
210
203
lines : 100
211
204
statements : 50
212
205
gomodguard :
213
206
blocked :
214
207
modules :
215
208
- github.com/BurntSushi/toml :
216
- recommandations :
209
+ recommendations :
217
210
- github.com/pelletier/go-toml
218
211
goheader :
219
212
template : |-
@@ -234,53 +227,9 @@ linters-settings:
234
227
specific language governing permissions and limitations
235
228
under the License.
236
229
gocritic :
237
- # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
238
- # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
239
230
enabled-tags :
240
231
- diagnostic
241
232
- performance
242
233
- style
243
234
- opinionated
244
235
- experimental
245
-
246
- linters :
247
- enable :
248
- - bodyclose
249
- # - deadcode
250
- - depguard
251
- - dogsled
252
- # - dupl
253
- - errcheck
254
- - errorlint
255
- - copyloopvar
256
- - exhaustive
257
- - forbidigo
258
- - funlen
259
- # - gochecknoinits
260
- - goconst
261
- - gocritic
262
- - gocyclo
263
- - gofmt
264
- - goheader
265
- - goimports
266
- - goprintffuncname
267
- - gosec
268
- - gosimple
269
- - govet
270
- - ineffassign
271
- # - lll
272
- - misspell
273
- - nakedret
274
- - noctx
275
- - nolintlint
276
- - revive
277
- - rowserrcheck
278
- - staticcheck
279
- # - structcheck
280
- - stylecheck
281
- - typecheck
282
- - unconvert
283
- - unparam
284
- - unused
285
- # - varcheck
286
- - whitespace
0 commit comments