-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
791 lines (791 loc) · 16.8 KB
/
.golangci.yml
File metadata and controls
791 lines (791 loc) · 16.8 KB
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
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
version: "2"
linters:
default: none
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- cyclop
- decorder
- dogsled
- dupword
- durationcheck
- embeddedstructfieldcheck
- err113
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- exptostd
- fatcontext
- forcetypeassert
- funcorder
- funlen
- gocheckcompilerdirectives
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocritic
- gocyclo
- godoclint
- godot
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- govet
- grouper
- iface
- importas
- inamedparam
- ineffassign
- interfacebloat
- intrange
- iotamixing
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- mnd
- modernize
- musttag
- nakedret
- nestif
- nilerr
- nilnesserr
- nilnil
- nlreturn
- noctx
- noinlineerr
- nolintlint
- nonamedreturns
- nosprintfhostport
- paralleltest
- perfsprint
- predeclared
- promlinter
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- tagalign
- tagliatelle
- testableexamples
- testifylint
- thelper
- tparallel
- unconvert
- unparam
- unqueryvet
- unused
- usestdlibvars
- usetesting
- varnamelen
- wastedassign
- whitespace
- wrapcheck
disable: []
settings:
asasalint:
exclude:
- Append
- \.Wrapf
use-builtin-exclusions: true
bidichk:
left-to-right-embedding: true
right-to-left-embedding: true
pop-directional-formatting: true
left-to-right-override: true
right-to-left-override: true
left-to-right-isolate: true
right-to-left-isolate: true
first-strong-isolate: true
pop-directional-isolate: true
copyloopvar:
check-alias: true
cyclop:
max-complexity: 10
package-average: 0
decorder:
dec-order:
- type
- const
- var
- func
ignore-underscore-vars: false
disable-dec-order-check: false
disable-init-func-first-check: false
disable-dec-num-check: false
disable-type-dec-num-check: true
disable-const-dec-num-check: false
disable-var-dec-num-check: false
dogsled:
max-blank-identifiers: 2
dupl:
threshold: 100
dupword:
keywords: []
ignore: []
comments-only: false
embeddedstructfieldcheck:
empty-line: true
forbid-mutex: false
errcheck:
check-type-assertions: true
check-blank: true
disable-default-exclusions: false
verbose: false
errchkjson:
check-error-free-encoding: false
report-no-exported: false
errorlint:
errorf: true
errorf-multi: true
asserts: true
comparison: true
exhaustive:
check:
- switch
- map
default-signifies-exhaustive: true
package-scope-only: false
explicit-exhaustive-switch: false
explicit-exhaustive-map: false
default-case-required: false
fatcontext:
check-struct-pointers: false
funcorder:
constructor: true
struct-method: true
alphabetical: false
funlen:
lines: 60
statements: 40
ignore-comments: true
gochecksumtype:
default-signifies-exhaustive: true
include-shared-interfaces: false
gocognit:
min-complexity: 20
goconst:
min-len: 2
min-occurrences: 2
match-constant: true
numbers: true
min: 2
max: 2
ignore-calls: false
find-duplicates: true
eval-const-expressions: true
gocritic:
enable-all: false
disable-all: false
enabled-checks:
- appendCombine
- badLock
- badRegexp
- badSorting
- badSyncOnceFunc
- boolExprSimplify
- builtinShadow
- builtinShadowDecl
- commentedOutCode
- commentedOutImport
- deferInLoop
- deferUnlambda
- docStub
- dupImport
- dupOption
- dynamicFmtString
- emptyDecl
- emptyFallthrough
- emptyStringTest
- equalFold
- evalOrder
- exposedSyncMutex
- externalErrorReassign
- filepathJoin
- hexLiteral
- httpNoBody
- hugeParam
- importShadow
- indexAlloc
- initClause
- methodExprCall
- nestingReduce
- nilValReturn
- octalLiteral
- paramTypeCombine
- preferDecodeRune
- preferFilepathJoin
- preferFprint
- preferStringWriter
- preferWriteByte
- ptrToRefParam
- rangeAppendAll
- rangeExprCopy
- rangeValCopy
- redundantSprint
- regexpPattern
- regexpSimplify
- returnAfterHttpError
- sliceClear
- sloppyReassign
- sortSlice
- sprintfQuotedString
- sqlQuery
- stringConcatSimplify
- stringXbytes
- stringsCompare
- syncMapLoadAndDelete
- timeExprSimplify
- todoCommentWithoutDetail
- tooManyResultsChecker
- truncateCmp
- typeAssertChain
- typeDefFirst
- typeUnparen
- uncheckedInlineErr
- unlabelStmt
- unnamedResult
- unnecessaryBlock
- unnecessaryDefer
- weakCond
- whyNoLint
- yodaStyleExpr
- zeroByteRepeat
settings:
captLocal:
paramsOnly: false
commentedOutCode:
minLength: 10
elseif:
skipBalanced: false
hugeParam:
sizeThreshold: 70
ifElseChain:
minThreshold: 2
nestingReduce:
bodyWidth: 5
rangeExprCopy:
sizeThreshold: 512
skipTestFuncs: false
rangeValCopy:
sizeThreshold: 128
skipTestFuncs: false
tooManyResultsChecker:
maxResults: 5
truncateCmp:
skipArchDependent: false
underef:
skipRecvDeref: false
unnamedResult:
checkExported: true
gocyclo:
min-complexity: 20
godoclint:
default: none
enable:
- pkg-doc
- single-pkg-doc
- start-with-name
- deprecated
- max-len
- no-unused-link
options:
max-len:
length: 120
require-doc:
ignore-exported: false
ignore-unexported: true
start-with-name:
include-unexported: false
godot:
scope: all
period: true
capital: true
gomoddirectives:
replace-local: false
retract-allow-no-explanation: false
exclude-forbidden: true
ignore-forbidden: true
toolchain-forbidden: true
tool-forbidden: false
go-debug-forbidden: true
go-version-pattern: '\d\.\d+(\.0)?'
gomodguard:
allowed:
modules: []
domains:
- golang.org
- github.com
blocked:
modules: []
versions: []
local-replace-directives: true
gosec:
includes: []
excludes: []
severity: low
confidence: low
config:
global:
nosec: true
show-ignored: true
audit: false
gosmopolitan:
allow-time-local: false
escape-hatches: []
govet:
enable-all: false
disable-all: false
enable:
- appends
- asmdecl
- assign
- atomic
- atomicalign
- bools
- buildtag
- cgocall
- composites
- copylocks
- deepequalerrors
- defers
- directive
- errorsas
- fieldalignment
- findcall
- framepointer
- hostport
- httpmux
- httpresponse
- ifaceassert
- loopclosure
- lostcancel
- nilfunc
- nilness
- printf
- reflectvaluecompare
- shadow
- shift
- sigchanyzer
- slog
- sortslice
- stdmethods
- stdversion
- stringintconv
- structtag
- testinggoroutine
- tests
- timeformat
- unmarshal
- unreachable
- unsafeptr
- unusedresult
- unusedwrite
- waitgroup
disable: []
grouper:
const-require-single-const: true
const-require-grouping: true
import-require-single-import: true
import-require-grouping: true
type-require-single-type: true
type-require-grouping: true
var-require-single-var: false
var-require-grouping: false
iface:
enable:
- identical
- unused
- opaque
- unexported
importas:
no-unaliased: false
no-extra-aliases: false
inamedparam:
skip-single-param: false
ineffassign:
check-escaping-errors: false
interfacebloat:
max: 10
iotamixing:
report-individual: true
lll:
line-length: 120
tab-width: 1
loggercheck:
kitlog: false
klog: false
logr: false
slog: true
zap: false
require-string-key: true
no-printf-like: true
maintidx:
under: 20
makezero:
always: true
misspell:
locale: US
ignore-rules: []
mode: default
mnd:
checks:
- argument
- case
- condition
- operation
- return
- assign
ignored-files:
- '.+_test.go'
modernize:
disable: []
musttag:
functions: []
nakedret:
max-func-lines: 30
nestif:
min-complexity: 5
nilnil:
only-two: true
detect-opposite: true
checked-types:
- chan
- func
- iface
- map
- ptr
- uintptr
- unsafeptr
nlreturn:
block-size: 1
nolintlint:
allow-unused: false
allow-no-explanation: []
require-explanation: true
require-specific: true
nonamedreturns:
report-error-in-defer: true
paralleltest:
ignore-missing: false
ignore-missing-subtests: false
perfsprint:
integer-format: true
int-conversion: true
error-format: true
err-error: true
errorf: true
string-format: true
sprintf1: true
strconcat: true
bool-format: true
hex-format: true
concat-loop: true
loop-other-ops: true
predeclared:
ignore: []
qualified-name: true
promlinter:
strict: true
disabled-linters: []
protogetter:
skip-generated-by: []
skip-files: []
skip-any-generated: false
replace-first-arg-in-append: false
reassign:
patterns:
- "EOF"
- "Err.*"
recvcheck:
disable-builtin: false
exclusions: []
revive:
max-open-files: 2048
severity: error
enable-all-rules: true
directives:
- name: specify-disable-reason
severity: error
confidence: 0.8
rules:
- name: add-constant
severity: warning
disabled: false
exclude: [""]
arguments:
- max-lit-count: "3"
allow-strs: '""'
allow-ints: "0,1,2"
allow-floats: "0.0,0.,1.0,1.,2.0,2."
- name: line-length-limit
severity: warning
disabled: false
exclude: [""]
arguments: [120]
- name: flag-parameter
severity: warning
disabled: false
exclude: [""]
rowserrcheck:
packages: []
sloglint:
no-mixed-args: true
kv-only: false
attr-only: false
no-global: "all"
context: "all"
static-msg: false
msg-style: lowercased
no-raw-keys: true
key-naming-case: kebab
forbidden-keys: []
args-on-sep-lines: true
spancheck:
checks:
- end
- record-error
- set-status
ignore-check-signatures: []
extra-start-span-signatures: []
tagalign:
align: true
sort: true
order:
- json
- yaml
- yml
- toml
- mapstructure
- binding
- validate
strict: true
tagliatelle:
case:
rules:
json: camel
yaml: camel
xml: camel
toml: camel
bson: camel
avro: snake
mapstructure: kebab
env: upperSnake
envconfig: upperSnake
whatever: snake
use-field-name: true
ignored-fields: []
overrides: []
testifylint:
enable-all: false
disable-all: false
disable: []
enable:
- blank-import
- bool-compare
- compares
- contains
- empty
- encoded-compare
- equal-values
- error-is-as
- error-nil
- expected-actual
- float-compare
- formatter
- go-require
- len
- negative-positive
- nil-compare
- regexp
- require-error
- suite-broken-parallel
- suite-dont-use-pkg
- suite-extra-assert-call
- suite-method-signature
- suite-subtest-run
- suite-thelper
- useless-assert
bool-compare:
ignore-custom-types: false
formatter:
check-format-string: true
require-f-funcs: true
require-string-msg: true
go-require:
ignore-http-handlers: false
require-error:
fn-pattern: ""
suite-extra-assert-call:
mode: remove
thelper:
test:
first: true
name: true
begin: true
benchmark:
first: true
name: true
begin: true
tb:
first: true
name: true
begin: true
fuzz:
first: true
name: true
begin: true
unconvert:
fast-math: true
safe: false
unparam:
check-exported: true
unqueryvet:
check-sql-builders: true
unused:
field-writes-are-uses: true
post-statements-are-reads: true
exported-fields-are-used: true
parameters-are-used: true
local-variables-are-used: false
generated-is-used: false
usestdlibvars:
http-method: true
http-status-code: true
time-date-month: true
time-weekday: true
time-month: true
time-layout: true
crypto-hash: true
default-rpc-path: true
sql-isolation-level: true
tls-signature-scheme: true
constant-kind: true
usetesting:
os-create-temp: true
os-mkdir-temp: true
os-setenv: true
os-temp-dir: true
os-chdir: true
context-background: true
context-todo: true
varnamelen:
max-distance: 5
min-name-length: 2
check-receiver: true
check-return: true
check-type-param: true
ignore-type-assert-ok: true
ignore-map-index-ok: true
ignore-chan-recv-ok: true
ignore-names:
- err
ignore-decls: []
whitespace:
multi-if: true
multi-func: false
wrapcheck:
report-internal-errors: true
exclusions:
generated: lax
warn-unused: true
presets:
- comments
- std-error-handling
- common-false-positives
- legacy
rules:
- path: ".*_test\\.go"
linters:
- errcheck
- dupl
- lll
- revive
- varnamelen
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
- golines
- swaggo
settings:
gci:
sections:
- standard
- default
- blank
- dot
- alias
- localmodule
no-inline-comments: true
no-prefix-comments: true
custom-order: true
no-lex-order: false
gofmt:
simplify: true
rewrite-rules: []
gofumpt:
extra-rules: true
golines:
max-len: 120
tab-len: 2
shorten-comments: true
reformat-tags: true
chain-split-dots: false
exclusions:
warn-unused: true
generated: lax
issues:
max-issues-per-linter: 0
max-same-issues: 0
uniq-by-line: true
new: false
fix: false
output:
formats:
text:
path: stdout
print-linter-name: true
print-issued-lines: true
colors: true
sort-order:
- linter
- severity
- file
show-stats: true
run:
timeout: "5m"
relative-path-mode: gitroot
issues-exit-code: 1
tests: true
modules-download-mode: readonly
allow-parallel-runners: false
allow-serial-runners: false
go: "1.25"
concurrency: 4
severity:
default: eror
rules:
- linters:
- dupl
severity: info