6 | 6 |
# concurrency: 4
|
7 | 7 |
|
8 | 8 |
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
9 | |
# deadline: 1m
|
|
9 |
# timeout: 1m
|
10 | 10 |
|
11 | 11 |
# exit code when at least one issue was found, default is 1
|
12 | 12 |
# issues-exit-code: 1
|
|
32 | 32 |
# no need to include all autogenerated files, we confidently recognize
|
33 | 33 |
# autogenerated files. If it's not please let us know.
|
34 | 34 |
# skip-files:
|
35 | |
# - "\\.html\\.go$"
|
36 | |
# - "\\.json\\.go$"
|
37 | |
# - "\\.sql\\.go$"
|
38 | |
# - "_reform\\.go$"
|
|
35 |
# - "\\.\\w+\\.go$"
|
39 | 36 |
|
40 | 37 |
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
|
41 | 38 |
# If invoked with -mod=readonly, the go command is disallowed from the implicit
|
|
79 | 76 |
# path to a file containing a list of functions to exclude from checking
|
80 | 77 |
# see https://github.com/kisielk/errcheck#excluding-functions for details
|
81 | 78 |
# exclude: .errcheck.excludes
|
|
79 |
|
|
80 |
funlen:
|
|
81 |
lines: 60
|
|
82 |
statements: 40
|
|
83 |
|
82 | 84 |
govet:
|
83 | 85 |
# report about shadowed variables
|
84 | 86 |
check-shadowing: true
|
|
90 | 92 |
# - (github.com/powerman/structlog.Logger).Fatalf
|
91 | 93 |
# - (github.com/powerman/structlog.Logger).Panicf
|
92 | 94 |
# - (github.com/powerman/structlog.Logger).Printf
|
|
95 |
|
|
96 |
# enable or disable analyzers by name
|
|
97 |
# enable:
|
|
98 |
# - atomicalign
|
|
99 |
enable-all: true
|
|
100 |
# disable:
|
|
101 |
# - shadow
|
|
102 |
# disable-all: false
|
93 | 103 |
golint:
|
94 | 104 |
# minimal confidence for issues, default is 0.8
|
95 | 105 |
# min-confidence: 0.8
|
|
103 | 113 |
gocyclo:
|
104 | 114 |
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
105 | 115 |
min-complexity: 15
|
|
116 |
gocognit:
|
|
117 |
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
|
118 |
min-complexity: 20
|
106 | 119 |
maligned:
|
107 | 120 |
# print struct with more effective memory layout or not, false by default
|
108 | 121 |
suggest-new: true
|
|
118 | 131 |
list-type: blacklist
|
119 | 132 |
include-go-root: true
|
120 | 133 |
packages:
|
121 | |
# - log
|
|
134 |
- log
|
|
135 |
packages-with-error-messages:
|
|
136 |
# specify an error message to output when a blacklisted package is used
|
|
137 |
log: "logging is allowed only by github.com/powerman/structlog"
|
122 | 138 |
misspell:
|
123 | 139 |
# Correct spellings using locale preferences for US or UK.
|
124 | 140 |
# Default is to use a neutral variety of English.
|
|
168 | 184 |
disabled-checks:
|
169 | 185 |
- hugeParam # premature optimization
|
170 | 186 |
- paramTypeCombine # questionable
|
171 | |
- yodaStyleExpr # questionable
|
172 | 187 |
- ptrToRefParam
|
173 | 188 |
- typeUnparen # false positive
|
174 | |
- commentedOutCode
|
175 | |
|
176 | |
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
|
|
189 |
- yodaStyleExpr # questionable
|
|
190 |
|
|
191 |
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
|
177 | 192 |
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
|
178 | 193 |
enabled-tags:
|
179 | 194 |
- diagnostic
|
|
187 | 202 |
paramsOnly: true
|
188 | 203 |
rangeValCopy:
|
189 | 204 |
sizeThreshold: 32
|
|
205 |
godox:
|
|
206 |
# report any comments starting with keywords, this is useful for TODO or FIXME comments that
|
|
207 |
# might be left in the code accidentally and should be resolved before merging
|
|
208 |
keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
|
|
209 |
- BUG # marks issues that should be moved to issue tracker before merging
|
|
210 |
- FIXME # marks issues that should be resolved before merging
|
|
211 |
dogsled:
|
|
212 |
# checks assignments with too many blank identifiers; default is 2
|
|
213 |
max-blank-identifiers: 2
|
|
214 |
|
|
215 |
whitespace:
|
|
216 |
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
|
|
217 |
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
|
|
218 |
wsl:
|
|
219 |
# If true append is only allowed to be cuddled if appending value is
|
|
220 |
# matching variables, fields or types on line above. Default is true.
|
|
221 |
strict-append: true
|
|
222 |
# Allow calls and assignments to be cuddled as long as the lines have any
|
|
223 |
# matching variables, fields or types. Default is true.
|
|
224 |
allow-assign-and-call: true
|
|
225 |
# Allow multiline assignments to be cuddled. Default is true.
|
|
226 |
allow-multiline-assign: true
|
190 | 227 |
|
191 | 228 |
linters:
|
192 | 229 |
# enable:
|
|
194 | 231 |
# - govet
|
195 | 232 |
enable-all: true
|
196 | 233 |
disable:
|
|
234 |
- dogsled # questionable
|
197 | 235 |
- dupl
|
198 | 236 |
- gochecknoglobals
|
199 | 237 |
- gochecknoinits
|
200 | 238 |
- lll
|
201 | 239 |
# - misspell
|
202 | 240 |
- prealloc
|
|
241 |
- wsl # questionable
|
203 | 242 |
# disable-all: false
|
204 | 243 |
# presets:
|
205 | 244 |
# - bugs
|
|
221 | 260 |
# Exclude some linters from running on tests files.
|
222 | 261 |
- path: _test\.go|testing\.go
|
223 | 262 |
linters:
|
|
263 |
- bodyclose
|
|
264 |
- dupl
|
|
265 |
- errcheck
|
|
266 |
- funlen
|
|
267 |
- gochecknoglobals
|
|
268 |
- gochecknoinits
|
224 | 269 |
- gocyclo
|
225 | |
- bodyclose
|
226 | |
- errcheck
|
227 | |
- dupl
|
228 | 270 |
- gosec
|
229 | |
- gochecknoinits
|
230 | |
- gochecknoglobals
|
231 | 271 |
- maligned
|
232 | 272 |
- scopelint
|
233 | 273 |
|
234 | 274 |
# Ease some gocritic warnings on test files.
|
235 | 275 |
- path: _test\.go|testing\.go
|
236 | |
text: "(unnamedResult|exitAfterDefer|rangeValCopy)"
|
|
276 |
text: "(unnamedResult|exitAfterDefer|rangeValCopy|commentedOutCode)"
|
237 | 277 |
linters:
|
238 | 278 |
- gocritic
|
239 | 279 |
|
240 | 280 |
# Package def is designed to contain global constants.
|
241 | |
# - path: internal/def/
|
242 | |
# linters:
|
243 | |
# - gochecknoglobals
|
|
281 |
- path: internal/def/
|
|
282 |
linters:
|
|
283 |
- gochecknoglobals
|
|
284 |
|
|
285 |
# Commands are allowed to contain a lot of flags.
|
|
286 |
- path: main.go
|
|
287 |
text: Function '(init|main)'
|
|
288 |
linters:
|
|
289 |
- funlen
|
244 | 290 |
|
245 | 291 |
# Exclude known linters from partially hard-vendored code,
|
246 | 292 |
# which is impossible to exclude via "nolint" comments.
|