This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
246 lines (242 loc) · 4.96 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
# This file contains all available configuration for golangci-lint
run:
timeout: 5m
issues-exit-code: 1
tests: true
skip-dirs:
- vendor
- .bin
# output configuration options
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
# all available settings of specific linters
linters-settings:
dogsled:
max-blank-identifiers: 3
dupl:
threshold: 150
errcheck:
check-type-assertions: false
check-blank: false
exhaustive:
default-signifies-exhaustive: true
goconst:
min-len: 1
min-occurrences: 2
ignore-tests: false
match-constant: true
numbers: true
min: 3
max: 3
govet:
check-shadowing: true
settings:
printf: # analyzer name from `go tool vet help`
funcs: # `go tool vet help printf` to see available settings
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
enable:
- atomicalign
enable-all: false
disable:
- shadow
disable-all: false
gofmt:
simplify: true
goimports:
local-prefixes: github.com/org/project
gocyclo:
min-complexity: 20
gocognit:
min-complexity: 20
maligned:
suggest-new: true
goconst:
min-len: 3
min-occurrences: 3
gocritic:
enabled-checks: # https://go-critic.github.io/overview#checks-overview
- appendAssign
- appendCombine
- argOrder
- assignOp
- boolExprSimplify
- builtinShadow
- codegenComment
- commentedOutImport
- commentFormatting
- captLocal
- caseOrder
- deprecatedComment
- docStub
- dupArg
- dupBranchBody
- dupCase
- dupImport
- dupSubExpr
- elseif
- emptyStringTest
- equalFold
- exitAfterDefer
- filepathJoin
- flagDeref
- flagName
- hexLiteral
- hugeParam
- ifElseChain
- importShadow
- indexAlloc
- initClause
- methodExprCall
- nilValReturn
- rangeExprCopy
- rangeValCopy
- regexpMust
- regexpSimplify
- singleCaseSwitch
- sloppyLen
- sloppyReassign
- stringXbytes
- switchTrue
- typeAssertChain
- typeSwitchVar
- typeUnparen
- unlabelStmt
- unlambda
- unnamedResult
- unnecessaryBlock
- unslice
- valSwap
- weakCond
- wrapperFunc
- yodaStyleExpr
settings:
captLocal:
paramsOnly: true
rangeValCopy:
sizeThreshold: 32
godox:
keywords:
- TODO
- BUG
- FIXME
- OPTIMIZE
- HACK
govet:
check-shadowing: true
enable-all: true
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/sirupsen/logrus
packages-with-error-messages:
github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
misspell:
locale: US
lll:
line-length: 100
tab-width: 8
unused:
check-exported: false
unparam:
check-exported: false
nakedret:
max-func-lines: 30
prealloc:
simple: true
range-loops: true
for-loops: false
whitespace:
multi-if: false
multi-func: false
wrapcheck:
ignoreSigs:
- path/filepath.Walk(
- .Errorf(
- errors.New(
- errors.Unwrap(
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
ignoreSigRegexps:
- \.New.*Error\(
ignorePackageGlobs:
- encoding/*
- github.com/pkg/*
wsl:
allow-assign-and-call: true
allow-cuddle-declarations: true
allow-multiline-assign: true
allow-separated-leading-comment: true
allow-trailing-comment: true
strict-append: true
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- errcheck
- depguard
- dogsled
- dupl
- exhaustive
- exportloopref
- godox
- gocognit
- goconst
- gochecknoinits
- gochecknoglobals
- gocritic
- gofmt
- goimports
- gomodguard
- gosec
- gosimple
- govet
- ineffassign
- lll
- megacheck
- misspell
- nakedret
- nolintlint
- prealloc
- revive
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
- whitespace
- wrapcheck
issues:
exclude-rules:
- path: _test\.go
linters:
- dupl
- linters:
- typecheck
text: "use of internal package"
- linters:
- revive
- stylecheck
text: "use ALL_CAPS in Go names; use CamelCase"
- linters:
- revive
- stylecheck
text: "use underscores in Go names"
- linters:
- misspell
text: "misspelling of `Sebastian`"