-
Notifications
You must be signed in to change notification settings - Fork 318
Expand file tree
/
Copy path.golangci.yml
More file actions
256 lines (250 loc) · 6.6 KB
/
.golangci.yml
File metadata and controls
256 lines (250 loc) · 6.6 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
247
248
249
250
251
252
253
254
255
256
# This is the configuration for golangci-lint.
# See https://golangci-lint.run/usage/configuration/ for details.
version: "2"
linters:
default: none
enable:
- dupword
- embeddedstructfieldcheck
- gocritic
- godoclint
- godot
- gosec
- govet
- ineffassign
- misspell
- modernize
- musttag
- nolintlint
- reassign
- recvcheck
- revive
- sloglint
- staticcheck
- testpackage
- thelper
- thelper
- unconvert
- unparam
- unused
- wastedassign
exclusions:
warn-unused: true
rules:
- path: '(.+)_test\.go'
linters:
- godoclint
- godot
- linters:
- testpackage
text: 'package should be `rule_test` instead of `rule`'
- linters:
- testpackage
text: 'package should be `lint_test` instead of `lint`'
- linters:
- testpackage
text: 'package should be `cli_test` instead of `cli`'
- linters:
- gosec
path: rule/context_keys_type.go
- linters:
- gosec
path: rule/errorf.go
- linters:
- gosec
path: rule/modifies_value_receiver.go
- linters:
- gosec
path: rule/range_val_address.go
- linters:
- gosec
path: rule/string_of_int.go
- linters:
- gosec
path: rule/time_naming.go
- linters:
- gosec
path: rule/unexported_return.go
- linters:
- gosec
path: rule/unhandled_error.go
- linters:
- gosec
path: rule/var_declarations.go
settings:
gocritic:
enable-all: true
disabled-checks:
- hugeParam
- rangeValCopy
godoclint:
default: all
options:
max-len:
length: 120
require-doc:
ignore-exported: false
ignore-unexported: true
start-with-name:
include-unexported: true
godot:
scope: toplevel
govet:
enable-all: true
disable:
- fieldalignment
- shadow
misspell:
locale: US
nolintlint:
allow-unused: false
require-explanation: true
require-specific: true
reassign:
patterns:
- .*
# The following settings should match revive.toml
revive:
severity: warning
confidence: 0.8
rules:
- name: add-constant
disabled: true
- name: argument-limit
- name: atomic
- name: banned-characters
- name: bare-return
- name: blank-imports
- name: bool-literal-in-expr
- name: call-to-gc
- name: comment-spacings
- name: comments-density
- name: confusing-naming
disabled: true
- name: confusing-results
- name: constant-logical-expr
- name: context-as-argument
- name: context-keys-type
- name: cyclomatic
disabled: true
- name: datarace
- 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: ["literal"]
- name: enforce-repeated-arg-type-style
- name: enforce-slice-style
arguments: ["literal"]
- name: enforce-switch-style
arguments: ["allow-no-default"]
- name: epoch-naming
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
- name: file-header
disabled: true
- name: file-length-limit
disabled: true
- name: filename-format
# Override the default pattern to forbid .go files with uppercase letters and dashes.
arguments: ["^[_a-z][_a-z0-9]*\\.go$"]
- name: flag-parameter
disabled: true
- name: forbidden-call-in-wg-go
- name: function-length
disabled: true
- name: function-result-limit
- 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: imports-blocklist
arguments: ["sort"]
- name: increment-decrement
- name: indent-error-flow
- name: inefficient-map-lookup
- name: line-length-limit
arguments: [200]
- name: max-control-nesting
- name: max-public-structs
arguments: [10]
- name: modifies-parameter
- name: modifies-value-receiver
- name: nested-structs
- 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-format
- name: string-of-int
- name: struct-tag
arguments: ["json,inline"]
- name: superfluous-else
- name: time-date
- name: time-equal
- name: time-naming
- name: unchecked-type-assertion
disabled: true
- name: unconditional-recursion
- name: unexported-naming
- name: unexported-return
- name: unhandled-error
disabled: true
- name: unnecessary-format
- name: unnecessary-if
- name: unnecessary-stmt
- name: unreachable-code
- name: unsecure-url-scheme
- name: unused-parameter
- name: unused-receiver
- name: use-any
- name: use-errors-new
- name: use-fmt-print
- name: use-slices-sort
- name: use-waitgroup-go
- name: useless-break
- name: useless-fallthrough
- name: var-declaration
- name: var-naming
- name: waitgroup-by-value
unparam:
check-exported: true
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/mgechev/revive)
issues:
# Show all issues from a linter.
max-issues-per-linter: 0
# Show all issues with the same text.
max-same-issues: 0
# Show all issues for a line.
uniq-by-line: false