-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yml
197 lines (197 loc) · 4.34 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
---
output:
format: tab
linters-settings:
misspell:
locale: US
gomnd:
settings:
mnd:
checks: [argument, case, condition, return]
ignored-functions: strconv.ParseFloat,rsa.GenerateKey
nolintlint:
allow-unused: false
allow-leading-space: true
allow-no-explanation: []
require-explanation: true
require-specific: true
gofumpt:
lang-version: '1.18'
extra-rules: true
godox:
keywords:
- OPTIMIZE
- HACK
- TODO
- BUG
- FIXME
godot:
scope: all
exclude:
- //nolint
- (API)
- ^[ ]*@
capital: true
depguard:
list-type: blacklist
include-go-root: true
includeGoStdLib: true
packages:
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: logging is allowed only by zerolog. Please use zerolog
- io/ioutil: 'io/ioutil was deprecated in Go 1.16: https://tip.golang.org/doc/go1.16'
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: kebab
yaml: kebab
xml: camel
bson: camel
avro: snake
mapstructure: kebab
errcheck:
check-type-assertions: true
check-blank: false
ignore: fmt:.*,io/ioutil:^Read.*
exclude-functions:
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
- io.Closer.Close
- io.Closer.Body.Close
govet:
enable-all: true
check-shadowing: 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
disable:
- fieldalignment
revive:
ignore-generated-header: true
enableAllRules: true
exclude:
- .*_test.go
rules:
- name: var-naming
severity: error
linters:
exclude-use-default: false
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
- depguard # requires more config to be useful
run:
skip-dirs-use-default: true
skip-dirs:
- build
- artifacts
- _tools
- vendor
- vendor$
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
- 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