2019-11-18 08:49:18 +00:00
|
|
|
run:
|
2021-03-29 03:58:45 +00:00
|
|
|
deadline: 10m
|
2019-11-18 08:49:18 +00:00
|
|
|
|
2021-04-02 06:36:49 +00:00
|
|
|
linters:
|
2023-03-25 05:13:27 +00:00
|
|
|
presets:
|
|
|
|
- bugs
|
|
|
|
- error
|
|
|
|
- unused
|
|
|
|
- performance
|
|
|
|
disable:
|
|
|
|
- exhaustive
|
|
|
|
- musttag
|
|
|
|
- contextcheck
|
|
|
|
- wrapcheck
|
|
|
|
- goerr113
|
|
|
|
- unparam
|
|
|
|
- makezero #TODO: enable me
|
|
|
|
- noctx #TODO: enable me
|
|
|
|
- nilerr #TODO: enable me
|
|
|
|
- errorlint #TODO: enable me
|
|
|
|
- errchkjson #TODO: enable me
|
|
|
|
- unused #TODO: enable me
|
|
|
|
- gocheckcompilerdirectives
|
2021-04-02 06:36:49 +00:00
|
|
|
enable:
|
2023-03-25 05:13:27 +00:00
|
|
|
- unconvert
|
|
|
|
# - predeclared #TODO: enable me
|
|
|
|
# - thelper #TODO: enable me
|
|
|
|
# - wastedassign
|
2021-05-08 08:45:40 +00:00
|
|
|
- gofmt
|
2022-08-25 02:08:56 +00:00
|
|
|
- gocritic
|
2023-03-25 05:13:27 +00:00
|
|
|
# - revive
|
2021-07-21 11:13:26 +00:00
|
|
|
# - forcetypeassert
|
2023-03-25 05:13:27 +00:00
|
|
|
# - stylecheck
|
2021-04-02 06:36:49 +00:00
|
|
|
|
2019-11-18 08:49:18 +00:00
|
|
|
linters-settings:
|
2021-07-16 13:23:54 +00:00
|
|
|
gocritic:
|
2021-07-17 02:09:56 +00:00
|
|
|
# Which checks should be enabled; can't be combined with 'disabled-checks';
|
|
|
|
# See https://go-critic.github.io/overview#checks-overview
|
2021-12-26 03:54:26 +00:00
|
|
|
# To check which checks are enabled run `GL_DEBUG=gocritic ./build/bin/golangci-lint run`
|
2021-07-17 02:09:56 +00:00
|
|
|
# By default list of stable checks is used.
|
2021-07-16 13:23:54 +00:00
|
|
|
enabled-checks:
|
|
|
|
- ruleguard
|
2021-07-17 02:09:56 +00:00
|
|
|
- truncateCmp
|
2021-12-26 03:54:26 +00:00
|
|
|
# - defaultCaseOrder
|
2021-07-17 02:09:56 +00:00
|
|
|
|
|
|
|
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
|
|
|
|
disabled-checks:
|
|
|
|
- regexpMust
|
2021-12-26 03:54:26 +00:00
|
|
|
- appendAssign
|
2021-07-17 02:09:56 +00:00
|
|
|
# - hugeParam
|
|
|
|
- rangeValCopy
|
|
|
|
- exitAfterDefer
|
|
|
|
- elseif
|
|
|
|
- dupBranchBody
|
|
|
|
- assignOp
|
|
|
|
- singleCaseSwitch
|
|
|
|
- unlambda
|
|
|
|
- captLocal
|
|
|
|
- commentFormatting
|
|
|
|
- ifElseChain
|
2021-12-26 03:54:26 +00:00
|
|
|
- importShadow
|
|
|
|
- paramTypeCombine
|
|
|
|
- builtinShadow
|
|
|
|
- typeUnparen
|
2021-07-17 02:09:56 +00:00
|
|
|
|
|
|
|
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
|
|
|
|
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
|
|
|
|
enabled-tags:
|
|
|
|
- performance
|
2021-12-26 03:54:26 +00:00
|
|
|
- diagnostic
|
|
|
|
- opinionated
|
2021-07-17 02:09:56 +00:00
|
|
|
disabled-tags:
|
|
|
|
- experimental
|
2021-07-16 13:23:54 +00:00
|
|
|
settings:
|
2021-12-26 03:54:26 +00:00
|
|
|
ruleguard:
|
|
|
|
rules: "rules.go"
|
2021-07-17 02:09:56 +00:00
|
|
|
hugeParam:
|
|
|
|
# size in bytes that makes the warning trigger (default 80)
|
|
|
|
sizeThreshold: 1000
|
|
|
|
rangeExprCopy:
|
|
|
|
# size in bytes that makes the warning trigger (default 512)
|
|
|
|
sizeThreshold: 512
|
|
|
|
# whether to check test functions (default true)
|
|
|
|
skipTestFuncs: true
|
|
|
|
truncateCmp:
|
|
|
|
# whether to skip int/uint/uintptr types (default true)
|
|
|
|
skipArchDependent: true
|
|
|
|
underef:
|
|
|
|
# whether to skip (*x).method() calls where x is a pointer receiver (default true)
|
|
|
|
skipRecvDeref: true
|
|
|
|
|
2021-03-29 03:58:45 +00:00
|
|
|
govet:
|
|
|
|
disable:
|
|
|
|
- deepequalerrors
|
|
|
|
- fieldalignment
|
|
|
|
- shadow
|
|
|
|
- unsafeptr
|
2019-11-18 08:49:18 +00:00
|
|
|
goconst:
|
2021-03-29 03:58:45 +00:00
|
|
|
min-len: 2
|
|
|
|
min-occurrences: 2
|
|
|
|
gofmt:
|
|
|
|
auto-fix: false
|
2019-11-18 08:49:18 +00:00
|
|
|
|
|
|
|
issues:
|
|
|
|
exclude-rules:
|
2021-03-29 03:58:45 +00:00
|
|
|
- linters:
|
|
|
|
- golint
|
|
|
|
text: "should be"
|
|
|
|
- linters:
|
|
|
|
- errcheck
|
|
|
|
text: "not checked"
|
|
|
|
- linters:
|
|
|
|
- staticcheck
|
|
|
|
text: "SA(1019|1029|5011)"
|
|
|
|
# Exclude some linters from running on tests files.
|
2021-08-02 07:52:54 +00:00
|
|
|
- path: test\.go
|
|
|
|
linters:
|
|
|
|
- gosec
|
|
|
|
- unused
|
|
|
|
- deadcode
|
|
|
|
- gocritic
|
|
|
|
- path: hack\.go
|
|
|
|
linters:
|
|
|
|
- gosec
|
|
|
|
- unused
|
|
|
|
- deadcode
|
|
|
|
- gocritic
|
|
|
|
- path: cmd/devp2p
|
2020-01-16 12:09:38 +00:00
|
|
|
linters:
|
2021-03-29 03:58:45 +00:00
|
|
|
- gosec
|
|
|
|
- unused
|
2020-01-16 12:09:38 +00:00
|
|
|
- deadcode
|
2021-07-17 02:09:56 +00:00
|
|
|
- gocritic
|
2021-04-13 14:48:20 +00:00
|
|
|
- path: metrics/sample\.go
|
|
|
|
linters:
|
|
|
|
- gosec
|
2021-07-17 02:09:56 +00:00
|
|
|
- gocritic
|
2021-08-02 07:52:54 +00:00
|
|
|
- path: p2p/simulations
|
|
|
|
linters:
|
|
|
|
- gosec
|
|
|
|
- gocritic
|
2023-02-22 08:29:34 +00:00
|
|
|
- path: p2p/dnsdisc
|
|
|
|
linters:
|
|
|
|
- gosec
|
|
|
|
- gocritic
|