-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
518 lines (507 loc) · 13 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
---
linters-settings:
cyclop:
max-complexity: 30
dupl:
threshold: 500
exhaustive:
default-signifies-exhaustive: true
funlen:
lines: 267 # revert to 100
statements: 150 # revert to 50
gci:
sections:
- standard
- default
- prefix(github.com/jufemaiz/go-aemo)
gocognit:
min-complexity: 50
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 30
gofmt:
simplify: true
gomoddirectives:
replace-allow-list:
- github.com/vektah/gqlparser/v2
govet:
enable-all: true
disable:
- fieldalignment
settings:
shadow:
# Whether to be strict about shadowing; can be noisy.
strict: false
importas:
# Do not allow unaliased imports of aliased packages.
# Default: false
no-unaliased: true
# Do not allow non-required aliases.
# Default: false
no-extra-aliases: false
inamedparam:
skip-single-param: true
lll:
line-length: 300
misspell:
locale: UK
ignore-words:
- amortized
- apologize
- apologizing
- artifact
- artifacts
- authorized
- authorizes
- behavior
- behavioral
- behaviors
- capitalize
- capitalized
- capitalizes
- categorize
- categorized
- categorizes
- centralize
- centralized
- centralizes
- characterized
- color
- colored
- colorful
- coloring
- colorize
- colorized
- colorizing
- contextualize
- contextualized
- contextualizes
- customize
- customized
- customizes
- customizing
- decentralized
- disorganized
- emphasize
- emphasized
- emphasizes
- emphasizing
- equalization
- equalize
- equalizer
- externalize
- externalized
- externalizes
- externalizing
- factorize
- factorizing
- familiarize
- familiarized
- favor
- favoring
- favorite
- favorites
- favors
- finalization
- finalize
- finalized
- finalizes
- finalizing
- flavor
- flavored
- flavors
- formalization
- formalize
- formalized
- generalization
- generalize
- generalized
- globalize
- globalized
- harmonized
- horiztonal
- humanize
- humanized
- humanizing
- initalization
- initalizing
- initialize
- initialized
- initializes
- initializing
- internalization
- internalize
- italicized
- itemize
- localize
- localized
- localizes
- localizing
- marginalize
- materialize
- materialized
- materializing
- maximize
- maximized
- maximizes
- maximizing
- memorize
- memorized
- minimize
- minimized
- minimizes
- minimizing
- modernize
- modernized
- neighbor
- neighborhood
- neighboring
- neighbors
- neutralized
- normalization
- normalize
- normalized
- normalizes
- normalizing
- optimize
- optimized
- optimizes
- optimizing
- organization
- organizational
- organizations
- organize
- organized
- organizer
- organizes
- organizing
- penalize
- penalized
- personalize
- personalized
- popularized
- popularizing
- prioritization
- prioritize
- prioritized
- prioritizes
- prioritizing
- publicize
- publicized
- randomize
- randomized
- randomizes
- realize
- realized
- realizes
- recognizable
- recognizably
- recognize
- recognized
- recognizes
- recognizing
- recongized
- reorganization
- reorganize
- reorganized
- sanitize
- sanitized
- sanitizes
- sanitizing
- serialization
- serializations
- serialize
- serialized
- serializes
- serializing
- signalize
- specialization
- specialize
- specialized
- stabilize
- stabilized
- stabilizes
- standardization
- standardize
- standardized
- standardizes
- standardizing
- summarize
- summarized
- summarizes
- summarizing
- symbolize
- synchronization
- synchronize
- synchronized
- synchronizes
- synchronizing
- synthesized
- synthesizes
- synthesizing
- systematization
- unauthorized
- unrecognizable
- unrecognized
- utilization
- utilize
- utilized
- utilizes
- utilizing
- visualization
- visualizations
- visualize
- visualized
- visualizes
- visualizing
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
revive:
severity: warning
confidence: 0.8
rules:
- name: exported
arguments:
- disableStutteringCheck
tagliatelle:
# check the struck tag name case
case:
# use the struct field name to check the name of the struct tag
use-field-name: true
rules:
# any struct tag type can be used.
# support string case: 'camel', 'pascal', 'kebab', 'snake', 'goCamel', 'goPascal', 'goKebab', 'goSnake', 'upper', 'lower'
json: camel
yaml: camel
xml: camel
bson: camel
avro: snake
mapstructure: kebab
wrapcheck:
ignorePackageGlobs:
- github.com/storozhukBM/verifier*
linters:
# please, do not use 'enable-all': it's deprecated and will be removed soon.
# inverted configuration with 'enable-all' and 'disable' is not scalable during updates of golangci-lint
disable-all: true
enable:
- asasalint
# - asciicheck # TODO: determine if ASCII should be allowed.
- bidichk
- bodyclose
- containedctx
- contextcheck
# - copyloopvar # Requires as yet unreleased 1.57 of golangci-lint
- cyclop
# - deadcode # Deprecated since v1.49.0: The owner seems to have abandoned the linter. Replaced by unused.
- decorder
# - depguard # Too onerous in the common package.
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errcheck
- errchkjson
- errname
- errorlint
# - execinquery # Deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner.
- exhaustive
# - exhaustivestruct # Deprecated since v1.46.0: The owner seems to have abandoned the linter. Replaced by exhaustruct.
# - exhaustruct # TODO: determine if we should implement.
- exportloopref
- forbidigo
- forcetypeassert
- funlen
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- gofmt
# - gofumpt # TODO: determine how we should implement.
- goheader
- goimports
# - golint # Deprecated since v1.41.0: The repository of the linter has been archived by the owner. Replaced by revive.
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
# - ifshort # Deprecated.
- importas
# - inamedparam # Disabled for now - too noisy for little value
- ineffassign
- interfacebloat
# - interfacer # Deprecated since v1.38.0: The repository of the linter has been archived by the owner.
# - intrange # Requires as yet unreleased 1.57 of golangci-lint
# - ireturn # Do not enable. As per Rob Pike <https://github.com/go-proverbs/go-proverbs.github.io/issues/37#issuecomment-571288298>.
- lll
- loggercheck
- maintidx
- makezero
# - maligned # Deprecated since v1.38.0: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'.
- mirror
- misspell
- mnd
- musttag
- nakedret
- nestif
- nilerr
# - nilnil # TODO: determine if we should implement.
- nlreturn
- noctx
- nolintlint
# - nonamedreturns # Do not enable. Bad opinion.
# - nosnakecase # Deprecated since v1.48.1: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming).
- nosprintfhostport
# - paralleltest # TODO: determine if we should implement.
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
# - scopelint # Deprecated since v1.39.0: The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
- sloglint
# - spancheck # Disabled until gobserver is running under go v1.22 so we can regenerate the observers.
- sqlclosecheck
- staticcheck
# - structcheck # Deprecated since v1.49.0: The owner seems to have abandoned the linter. Replaced by unused.
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
# - testpackage # TODO: should a separate test package be used? :thinking_face:
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
# - varcheck # Deprecated since v1.49.0: The owner seems to have abandoned the linter. Replaced by unused.
# - varnamelen # TODO: review the configuration options.
- wastedassign
- whitespace
- wrapcheck
- wsl
- zerologlint
issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by 'exclude-use-default: false'. To list all
# excluded by default patterns execute 'golangci-lint run --help'
exclude:
- 'declaration of "(err|ctx)" shadows declaration at'
include:
- EXC0012 # EXC0012 revive: should have comment( \(or a comment on this block\))? or be unexported
- EXC0014 # EXC0014 revive: comment on exported (.+) should be of the form "(.+)..."
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- containedctx
- contextcheck
- cyclop
- dupl
- dupword
- err113
- errcheck
- exhaustive
- funlen
- gocognit
- goconst
- gocyclo
- gosec
- lll
- maintidx
- mnd
- wrapcheck
- path: .*observer_impl\.go
linters:
- unparam
# Exclude known linters from partially hard-vendored code,
# which is impossible to exclude via "nolint" comments.
- path: internal/hmac/
text: 'weak cryptographic primitive'
linters:
- gosec
# Exclude some staticcheck messages
- linters:
- staticcheck
text: 'SA9003:'
# Exclude lll issues for long lines with go:generate
- linters:
- lll
source: '^//go:generate '
# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
text: 'unnecessaryDefer:'
exclude-dirs:
- test/testdata_etc
- internal/cache
- internal/renameio
- internal/robustio
- vendor
severity:
# Default value is empty string.
# Set the default severity for issues. If severity rules are defined and the issues
# do not match or no severity is provided to the rule this will be the default
# severity applied. Severities should match the supported severity names of the
# selected out format.
# - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity
# - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#severity
# - Github: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
default-severity: error
# The default value is false.
# If set to true severity-rules regular expressions become case sensitive.
case-sensitive: false
# Default value is empty list.
# When a list of severity rules are provided, severity information will be added to lint
# issues. Severity rules have the same filtering capability as exclude rules except you
# are allowed to specify one matcher per severity rule.
# Only affects out formats that support setting severity information.
rules:
- severity: info
linters:
- dupl