Skip to content

Commit 620a733

Browse files
committed
golangci-lint migrate
1 parent 9276656 commit 620a733

File tree

1 file changed

+46
-19
lines changed

1 file changed

+46
-19
lines changed

.golangci.yml

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,58 @@
1-
issues:
2-
exclude-rules:
3-
- linters:
4-
- staticcheck
5-
text: 'SA1019: schema.SchemaValidateFunc is deprecated'
6-
max-issues-per-linter: 0
7-
max-same-issues: 0
8-
1+
version: "2"
92
linters:
10-
disable-all: true
3+
default: none
114
enable:
5+
- copyloopvar
126
- durationcheck
137
- errcheck
14-
- copyloopvar
15-
- gofmt
16-
- gosimple
8+
- govet
179
- ineffassign
1810
- makezero
1911
- nilerr
20-
# - paralleltest # Reference: https://github.com/kunwardeep/paralleltest/issues/14
2112
- predeclared
2213
- staticcheck
23-
- usetesting
2414
- unconvert
2515
- unparam
2616
- unused
27-
- govet
28-
29-
run:
30-
# Prevent false positive timeouts in CI
31-
timeout: 5m
17+
- usetesting
18+
exclusions:
19+
generated: lax
20+
presets:
21+
- comments
22+
- common-false-positives
23+
- legacy
24+
- std-error-handling
25+
rules:
26+
- linters:
27+
- staticcheck
28+
text: 'SA1019: schema.SchemaValidateFunc is deprecated'
29+
paths:
30+
- third_party$
31+
- builtin$
32+
- examples$
33+
settings:
34+
staticcheck:
35+
checks:
36+
- all
37+
- '-QF1001' # "could apply De Morgan's law" -- https://staticcheck.dev/docs/checks/#QF1001
38+
- '-QF1002' # "could use tagged switch" -- https://staticcheck.dev/docs/checks/#QF1002
39+
- '-QF1004' # "could use strings.ReplaceAll instead" -- https://staticcheck.dev/docs/checks/#QF1004
40+
- '-QF1007' # "could merge conditional assignment into variable declaration" -- https://staticcheck.dev/docs/checks/#QF1007
41+
- '-QF1008' # "could remove embedded field "Block" from selector" -- https://staticcheck.dev/docs/checks/#QF1008
42+
- '-QF1011' # "could omit type *terraform.InstanceState from declaration" -- https://staticcheck.dev/docs/checks/#QF1011
43+
- '-ST1003' # example: "const autoTFVarsJson should be autoTFVarsJSON" -- https://staticcheck.dev/docs/checks/#ST1003
44+
- '-ST1005' # "error strings should not end with punctuation or newlines" -- https://staticcheck.dev/docs/checks/#ST1005
45+
- '-ST1016' # example: "methods on the same type should have the same receiver name (seen 2x "r", 2x "s")" -- https://staticcheck.dev/docs/checks/#ST1016
46+
- '-ST1023' # example: "should omit type *terraform.InstanceState from declaration;" -- https://staticcheck.dev/docs/checks/#ST1023
47+
issues:
48+
max-issues-per-linter: 0
49+
max-same-issues: 0
50+
formatters:
51+
enable:
52+
- gofmt
53+
exclusions:
54+
generated: lax
55+
paths:
56+
- third_party$
57+
- builtin$
58+
- examples$

0 commit comments

Comments
 (0)