-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.golangci.yml
107 lines (105 loc) · 3.12 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
# Configuration reference: https://golangci-lint.run/usage/configuration/
# Linters reference: https://golangci-lint.run/usage/linters/
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude:
# EXC0002 revive: Annoying issue about not having a comment. The rare codebase has such comments
- (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
# tparallel: Parallel subtests are not always desirable
- subtests should call t\.Parallel
exclude-use-default: false
# Disabled linters:
# - cyclop - duplicates functionality of gocyclo
# - exhaustivestruct - breaks "Make the zero value useful" proverb, meant to be used only for special cases
# - funlen - not needed - gocyclo ensures that functions complexity is not too high
# - godox - requires all TODOs to be removed - too strict
# - golint - deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner
# - gomoddirectives - does not allow "replace" directives - too strict
# - goerr113 - following check is too strict: "do not define dynamic errors, use wrapped static errors instead",
# the check cannot be disabled
# - interfacer - deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner
# - maligned - deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner
# - mnd - extracting all numbers to constants is counter-productive
# - nlreturn - leads to using too many line breaks
# - paralleltest - considered a premature optimization
# - prealloc - considered a premature optimization
# - scopelint - deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner
# - thelper - enforcing t.Helper() everywhere is too strict
# - wsl - leads to using too many line breaks
linters:
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errorlint
- exhaustive
- exportloopref
- forbidigo
- forcetypeassert
- gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- ifshort
- importas
- ineffassign
- lll
- makezero
- misspell
- nakedret
- nestif
- nilerr
- noctx
- nolintlint
- predeclared
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- testpackage
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
- whitespace
- wrapcheck
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors - too strict
errorf: false
gocyclo:
min-complexity: 10
govet:
disable:
# Reordering struct fields may decrease readability
- fieldalignment
enable-all: true
nakedret:
max-func-lines: 5