-
Notifications
You must be signed in to change notification settings - Fork 8
/
.golangci.yml
213 lines (209 loc) · 4.56 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
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
---
output:
formats:
- format: tab
linters-settings:
misspell:
locale: US
nolintlint:
allow-unused: false
allow-no-explanation: []
require-explanation: true
require-specific: true
gofumpt:
extra-rules: true
godox:
keywords:
- OPTIMIZE
- HACK
- TODO
- BUG
- FIXME
godot:
scope: all
exclude:
- //nolint
- (API)
- ^[ ]*@
capital: true
depguard:
rules:
main:
deny:
- pkg: 'github.com/sirupsen/logrus'
desc: use zerolog
- pkg: log
desc: use zerolog
- pkg: 'github.com/pkg/errors'
desc: Should be replaced by standard lib errors package
# gomodguard:
# blocked:
# modules:
# - github.com/sirupsen/logrus:
# recommendations:
# - internal/logging
# reason: logging is allowed only by zerolog. Please use zerolog
# local_replace_directives: false
tagliatelle:
case:
use-field-name: true
rules:
json: snake
yaml: kebab
xml: camel
bson: camel
avro: snake
mapstructure: kebab
errcheck:
check-type-assertions: true
check-blank: false
exclude-functions:
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
- io.Closer.Close
- io.Closer.Body.Close
govet:
enable-all: true
disable:
- fieldalignment
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
varnamelen:
max-distance: 15
min-name-length: 3
check-receiver: false
check-return: false
ignore-type-assert-ok: true
ignore-map-index-ok: true
ignore-chan-recv-ok: true
ignore-names:
- err
- tt
- i
- x
- id
- b
- ok
- zl
- fs
revive:
ignore-generated-header: true
enable-all-rules: true
rules:
- name: var-naming
severity: error
- name: line-length-limit
severity: warning
arguments:
- 400
- name: function-length
severity: warning
arguments: [20, 5000]
linters:
enable-all: true
disable:
- scopelint
- paralleltest
- noctx
- wsl
- lll
- interfacer
- golint
- maligned
- goimports
- gci
- gofmt
- nlreturn
- gofumpt
- exhaustivestruct
- exhaustruct
- wrapcheck
- godox
- execinquery
- nonamedreturns
- forbidigo
- structcheck
- varcheck
- deadcode
- ifshort
- godox
- godot
- nosnakecase
- rowserrcheck # disabled due to generics, can enable in future if needed
- sqlclosecheck # disabled due to generics, can enable in future if needed
- wastedassign # disabled due to generics, can enable in future if needed
- funlen #OVERRIDE: ok using for bot, lots of quick long commands i worked on
- cyclop #OVERRIDE: ok using for bot, lots of quick long commands i worked on
- gocognit #OVERRIDE: ok using for bot, lots of quick long commands i worked on
- perfsprint
run:
timeout: 5m
build-tags:
- mage
- tools
- integration
- codeanalysis
issues:
exclude-rules:
- path: _test\.go
linters:
- goerr113
- wrapcheck
- funlen
- cyclop
- gocognit
- unparam
- varnamelen
- revive
- linters:
- goerr113
text: do not define dynamic errors
- path: magefiles
linters:
- goerr113
- wrapcheck
- funlen
- gocyclo
- cyclop
- gocognit
- maintidx
- deadcode
- gochecknoglobals
- path: magefile.go
linters:
- goerr113
- wrapcheck
- funlen
- gocyclo
- cyclop
- gocognit
- maintidx
- deadcode
- gochecknoglobals
- linters:
- goerr113
text: magefiles don't need to worry about wrapping in the same way
- linters:
- govet
- revive
text: 'shadow: declaration of .err. shadows declaration'
- path: mocks
linters:
- godot
text: mocked files do not need to be checked
whole-files: false
exclude-dirs:
- build
- .artifacts
- .cache
- artifacts
- .trunk
- _tools
- vendor
- vendor$