forked from DelineaXPM/dsv-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yaml
More file actions
223 lines (221 loc) · 5.62 KB
/
.golangci.yaml
File metadata and controls
223 lines (221 loc) · 5.62 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
---
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: camel # CUSTOMIZED: preexisting format, leave. 2022-10-27 - sheldon
yaml: camel # CUSTOMIZED: preexisting format, leave. 2022-10-27 - sheldon
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
# ireturn:
# allow:
# - github.com\/mitchellh\/cli # CUSTOMIZED: cli command is common interfacer in this project
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
- funlen # CUSTOMIZED: preexisting many larger functions, remove to avoid excessive noise, leave. 2022-10-27 - sheldon
- cyclop # CUSTOMIZED: preexisting many larger functions, remove to avoid excessive noise, leave. 2022-10-27 - sheldon
- gocognit # CUSTOMIZED: preexisting many larger functions, remove to avoid excessive noise, leave. 2022-10-27 - sheldon
- testpackage # CUSTOMIZED: existing tests don't use this approach, too many false positives, remove to avoid excessive noise, leave. 2022-10-27 - sheldon
- ireturn # CUSTOMIZED: used in this project with cli calls a lot, leave. 2022-10-27 - sheldon
run:
skip-dirs-use-default: true
skip-dirs:
- build
- artifacts
- _tools
- vendor
- vendor$
- tests/fake
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
- unused
- 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
- path: commands/ # CUSTOMIZED: current cli framework uses this return of functions so not checking those
text: current cli framework uses this return of functions so not checking those
linters:
- ireturn
whole-files: false