-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy path.golangci.yaml
214 lines (211 loc) · 4.65 KB
/
.golangci.yaml
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
run:
timeout: 5m
issues:
max-same-issues: 0 # don't hide issues in CI runs because they are the same type
exclude-dirs:
- internal/gojsonschema
- internal/gqlparser
- internal/jwx
exclude-rules:
- path: ast/
linters:
- staticcheck
text: "SA1019"
- path: bundle/
linters:
- staticcheck
text: "SA1019"
- path: capabilities/
linters:
- staticcheck
text: "SA1019"
- path: compile/
linters:
- staticcheck
text: "SA1019"
- path: config/
linters:
- staticcheck
text: "SA1019"
- path: cover/
linters:
- staticcheck
text: "SA1019"
- path: debug/
linters:
- staticcheck
text: "SA1019"
- path: dependencies/
linters:
- staticcheck
text: "SA1019"
- path: download/
linters:
- staticcheck
text: "SA1019"
- path: format/
linters:
- staticcheck
text: "SA1019"
- path: hooks/
linters:
- staticcheck
text: "SA1019"
- path: ir/
linters:
- staticcheck
text: "SA1019"
- path: keys/
linters:
- staticcheck
text: "SA1019"
- path: loader/
linters:
- staticcheck
text: "SA1019"
- path: logging/
linters:
- staticcheck
text: "SA1019"
- path: metrics/
linters:
- staticcheck
text: "SA1019"
- path: plugins/
linters:
- staticcheck
text: "SA1019"
- path: profiler/
linters:
- staticcheck
text: "SA1019"
- path: refactor/
linters:
- staticcheck
text: "SA1019"
- path: repl/
linters:
- staticcheck
text: "SA1019"
- path: rego/
linters:
- staticcheck
text: "SA1019"
- path: resolver/
linters:
- staticcheck
text: "SA1019"
- path: runtime/
linters:
- staticcheck
text: "SA1019"
- path: schemas/
linters:
- staticcheck
text: "SA1019"
- path: sdk/
linters:
- staticcheck
text: "SA1019"
- path: server/
linters:
- staticcheck
text: "SA1019"
- path: storage/
linters:
- staticcheck
text: "SA1019"
- path: tester/
linters:
- staticcheck
text: "SA1019"
- path: topdown/
linters:
- staticcheck
text: "SA1019"
- path: tracing/
linters:
- staticcheck
text: "SA1019"
- path: types/
linters:
- staticcheck
text: "SA1019"
- path: util/
linters:
- staticcheck
text: "SA1019"
- path: version/
linters:
- staticcheck
text: "SA1019"
linters-settings:
lll:
line-length: 200
gocritic:
disabled-checks:
- appendAssign
# NOTE(ae): this one should be enabled, but there were too
# many violations to fix in one go... revisit later
- singleCaseSwitch
# Reasonable rule, but not sure what to replace with in
# many locations, so disabling for now
- exitAfterDefer
# The following 3 rules are disabled from the perfomance tag
# enabled further down. The first two are reasonable, but not
# super important. appendCombine is really nice though! And
# should be enabled. Just many places to fix..
- hugeParam
- preferFprint
- appendCombine
enabled-checks:
# NOTE that these are rules enabled in addition to the default set
- filepathJoin
- dupImport
- redundantSprint
- stringConcatSimplify
enabled-tags:
- performance
settings:
ifElseChain:
# ridiculous value set for now, but this should be
# lowered to something more reasonable, as the rule
# is reasonable (replace long if-else chains with
# switch)... just too many violations right now
minThreshold: 10
govet:
enable:
- deepequalerrors
- nilness
perfsprint:
# only rule disabled by default, but it's a good one
err-error: true
revive:
rules:
# this mainly complains about us using min/max for variable names,
# which seems like an unlikely source of actual issues
- name: redefines-builtin-id
disabled: true
linters:
disable-all: true
enable:
- mirror
- errcheck
- govet
- ineffassign
- intrange
- revive # replacement for golint
- gofmt
- goimports
- unused
- misspell
- usetesting
- typecheck
- staticcheck
- gosimple
- prealloc
- unconvert
- copyloopvar
- perfsprint
- gocritic
# - gosec # too many false positives