-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yml
276 lines (272 loc) · 6.03 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
# Copyright 2022 "Holloway" Chew, Kean Ho <[email protected]>
# Copyright 2022 ZORALab Enterprise <[email protected]>
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# 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: 30
gocognit:
min-complexity: 30
maligned:
suggest-new: true
gocritic:
enabled-checks: # https://go-critic.github.io/overview#checks-overview
- appendCombine
- argOrder
- assignOp
- badCond
- badLock
- boolExprSimplify
- builtinShadow
- builtinShadowDecl
- captLocal
- caseOrder
- codegenComment
- commentFormatting
- commentedOutImport
- defaultCaseOrder
- deferUnlambda
- deprecatedComment
- docStub
- dupArg
- dupBranchBody
- dupCase
- dupImport
- dupSubExpr
- elseif
- emptyDecl
- emptyStringTest
- equalFold
- exitAfterDefer
- exposedSyncMutex
- externalErrorReassign
- filepathJoin
- flagDeref
- flagName
- hexLiteral
- hugeParam
- ifElseChain
- importShadow
- indexAlloc
- initClause
- ioutilDeprecated
- mapKey
- methodExprCall
- nilValReturn
- octalLiteral
- offBy1
- preferDecodeRune
- preferFilepathJoin
- rangeExprCopy
- rangeValCopy
- redundantSprint
- regexpSimplify
- singleCaseSwitch
- sliceClear
- sloppyLen
- sloppyReassign
- sloppyTypeAssert
- stringXbytes
- switchTrue
- syncMapLoadAndDelete
- timeExprSimplify
- truncateCmp
- typeAssertChain
- typeDefFirst
- typeSwitchVar
- typeUnparen
- underef
- unlabelStmt
- unlambda
- unnamedResult
- unnecessaryBlock
- unnecessaryDefer
- unslice
- valSwap
- weakCond
- wrapperFunc
- yodaStyleExpr
settings:
captLocal:
paramsOnly: true
rangeValCopy:
sizeThreshold: 32
godox:
keywords:
- TODO
- BUG
- FIXME
- OPTIMIZE
- HACK
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
- errcheck
- depguard
- dogsled
- exhaustive
- exportloopref
- godox
- gocognit
- goconst
- gochecknoinits
- gochecknoglobals
- gocritic
- gofmt
- goimports
- gomodguard
- gosec
- gosimple
- govet
- ineffassign
- lll
- megacheck
- misspell
- nakedret
- nolintlint
- prealloc
- revive
- sqlclosecheck
- staticcheck
- stylecheck
- tparallel
- typecheck
- unconvert
- unparam
- unused
- 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`"
- linters:
- stylecheck
text: "ST1003: should not use MixedCaps in package name;"