-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy path.golangci.yml
More file actions
246 lines (231 loc) · 6.11 KB
/
Copy path.golangci.yml
File metadata and controls
246 lines (231 loc) · 6.11 KB
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
version: '2'
formatters:
enable:
- gci
- gofumpt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
settings:
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- localmodule
custom-order: true
issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
default: none
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- decorder
- dogsled
- dupword
- durationcheck
- errcheck
- errchkjson
- forbidigo
- funcorder
- funlen
- gocheckcompilerdirectives
- gocognit
- gocritic
- gocyclo
- godox
- gosec
- govet
- ineffassign
- iotamixing
- misspell
- modernize
- nilerr
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- testifylint
- thelper
- tparallel
- unconvert
- unused
- usestdlibvars
- usetesting
- wastedassign
- wrapcheck
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
rules:
- path: (.+)_test\.go
linters:
- revive
text: "^(unused-parameter|add-constant):"
- linters:
- revive
text: "^add-constant: string literal"
settings:
decorder:
dec-order:
- const
- type
- var
- func
disable-dec-order-check: false
disable-type-dec-num-check: false
forbidigo:
forbid:
- pattern: "^(fmt\\.Print(|f|ln)|print|println)$"
- pattern: "^(errors\\.Wrapf?)$"
msg: errors.Wrap(f) is no longer needed, use fmt.Errorf
funcorder:
alphabetical: true
funlen:
lines: 100
statements: 60
gocyclo:
min-complexity: 15
gosec:
excludes:
# G7xx-group causes LOTS of false-positives and yes, user-facing
# applications tend to have user-input. This is the way!
- G701 # SQL injection via taint analysis
- G702 # Command injection via taint analysis
- G703 # Path traversal via taint analysis
- G704 # SSRF via taint analysis
- G705 # XSS via taint analysis
- G706 # Log injection via taint analysis
- G707 # SMTP command/header injection via taint analysis
- G708 # Server-side template injection via taint analysis
- G709 # Unsafe deserialization of untrusted data via taint analysis
- G710 # Open redirect via taint analysis
nolintlint:
require-explanation: true
require-specific: true
revive:
directives:
- name: specify-disable-reason
severity: error
rules:
- name: add-constant
arguments:
- max-lit-count: "3"
allow-strs: '""'
allow-ints: "0,1,2"
allow-floats: "0.0,0.,1.0,1.,2.0,2."
ignore-funcs: 'strconv\.(Format|Parse).*,make'
- name: atomic
- name: banned-characters
arguments:
- "\u037E" # Greek question mark (looks like ;)
- name: bare-return
- name: blank-imports
- name: bool-literal-in-expr
- name: call-to-gc
- name: comment-spacings
arguments:
- "#nosec:G"
- name: confusing-naming
- name: confusing-results
- name: constant-logical-expr
- name: context-as-argument
- name: context-keys-type
- name: deep-exit
- name: defer
- name: dot-imports
- name: duplicated-imports
- name: early-return
- name: empty-block
- name: empty-lines
- name: enforce-map-style
arguments:
- "make"
- name: enforce-slice-style
arguments:
- "nil"
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
arguments:
- "check-public-interface"
- "say-repetitive-instead-of-stutters"
- name: flag-parameter
- name: forbidden-call-in-wg-go
- name: get-return
- name: identical-branches
- name: identical-ifelseif-branches
- name: identical-ifelseif-conditions
- name: identical-switch-branches
- name: identical-switch-conditions
- name: if-return
- name: import-alias-naming
- name: import-shadowing
- name: increment-decrement
- name: indent-error-flow
- name: inefficient-map-lookup
- name: modifies-parameter
- name: modifies-value-receiver
- name: optimize-operands-order
- name: package-comments
- name: package-directory-mismatch
- name: package-naming
- name: range
- name: range-val-address
- name: range-val-in-closure
- name: receiver-naming
- name: redefines-builtin-id
- name: redundant-build-tag
- name: redundant-import-alias
- name: redundant-test-main-exit
- name: string-of-int
- name: struct-tag
- name: superfluous-else
- name: time-date
- name: time-equal
- name: time-naming
- name: unconditional-recursion
- name: unexported-naming
- name: unexported-return
- name: unhandled-error
arguments:
- fmt.(Fp|P)rint(f|ln|)
- name: unnecessary-if
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
- name: unused-receiver
- name: use-fmt-print
- name: useless-break
- name: useless-fallthrough
- name: var-declaration
- name: var-naming
- name: waitgroup-by-value
severity: error
output:
formats:
tab:
path: stdout
colors: false
run:
modules-download-mode: readonly
relative-path-mode: wd