forked from cffls/erigon
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.golangci.yml
154 lines (148 loc) · 3.7 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
run:
deadline: 10m
build-tags:
- nosqlite
- noboltdb
- integration
linters:
presets:
- bugs
- error
- unused
- performance
disable:
- gosec # enable it after 1-2 weeks. it failing CI withoutt enough info to fix: https://github.com/ledgerwatch/erigon/actions/runs/5928644129/job/16074701625
- 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
- testifylint #TODO: enable me
- perfsprint #TODO: enable me
- gocheckcompilerdirectives
- protogetter
enable:
- unconvert
# - predeclared #TODO: enable me
# - thelper #TODO: enable me
# - wastedassign
- gofmt
- gocritic
# - revive
# - forcetypeassert
# - stylecheck
linters-settings:
gocritic:
# Which checks should be enabled; can't be combined with 'disabled-checks';
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic ./build/bin/golangci-lint run`
# By default list of stable checks is used.
enabled-checks:
- ruleguard
- truncateCmp
# - defaultCaseOrder
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
disabled-checks:
- regexpMust
- appendAssign
# - hugeParam
- rangeValCopy
- exitAfterDefer
- elseif
- dupBranchBody
- assignOp
- singleCaseSwitch
- unlambda
- captLocal
- commentFormatting
- ifElseChain
- importShadow
- paramTypeCombine
- builtinShadow
- typeUnparen
# 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
- diagnostic
- opinionated
disabled-tags:
- experimental
settings:
ruleguard:
rules: "rules.go"
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
govet:
disable:
- deepequalerrors
- fieldalignment
- shadow
- unsafeptr
goconst:
min-len: 2
min-occurrences: 2
gofmt:
auto-fix: false
issues:
exclude-rules:
- 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.
- path: test\.go
linters:
- gosec
- unused
- deadcode
- gocritic
- perfsprint
- path: hack\.go
linters:
- gosec
- unused
- deadcode
- gocritic
- path: cmd/devp2p
linters:
- gosec
- unused
- deadcode
- gocritic
- path: metrics/sample\.go
linters:
- gosec
- gocritic
- path: p2p/simulations
linters:
- gosec
- gocritic
- path: p2p/dnsdisc
linters:
- gosec
- gocritic