Skip to content

Commit d0c2e17

Browse files
committed
chore: update linter
1 parent f14a903 commit d0c2e17

File tree

4 files changed

+216
-205
lines changed

4 files changed

+216
-205
lines changed

.golangci.yml

Lines changed: 67 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,82 @@
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gci
6+
- gofumpt
7+
settings:
8+
gofumpt:
9+
extra-rules: true
10+
111
linters:
2-
enable-all: true
12+
default: all
313
disable:
4-
- exportloopref # deprecated
5-
- sqlclosecheck # not relevant (SQL)
6-
- rowserrcheck # not relevant (SQL)
714
- cyclop # duplicate of gocyclo
8-
- lll
915
- dupl
10-
- wsl
11-
- nlreturn
12-
- mnd
1316
- err113
14-
- wrapcheck
17+
- errchkjson
1518
- exhaustive
1619
- exhaustruct
17-
- testpackage
18-
- tparallel
19-
- paralleltest
20-
- prealloc
2120
- forcetypeassert
22-
- varnamelen
21+
- lll
22+
- mnd
2323
- nilnil
24-
- errchkjson
24+
- nlreturn
2525
- nonamedreturns
26+
- paralleltest
27+
- prealloc
28+
- rowserrcheck # not relevant (SQL)
29+
- sqlclosecheck # not relevant (SQL)
30+
- testpackage
31+
- tparallel
32+
- varnamelen
33+
- wrapcheck
34+
35+
settings:
36+
depguard:
37+
rules:
38+
main:
39+
deny:
40+
- pkg: github.com/instana/testify
41+
desc: not allowed
42+
- pkg: github.com/pkg/errors
43+
desc: Should be replaced by standard lib errors package
44+
funlen:
45+
lines: -1
46+
statements: 40
47+
goconst:
48+
min-len: 5
49+
min-occurrences: 3
50+
gocritic:
51+
disabled-checks:
52+
- sloppyReassign
53+
- rangeValCopy
54+
- octalLiteral
55+
- paramTypeCombine # already handle by gofumpt.extra-rules
56+
enabled-tags:
57+
- diagnostic
58+
- style
59+
- performance
60+
settings:
61+
hugeParam:
62+
sizeThreshold: 100
63+
gocyclo:
64+
min-complexity: 20
65+
godox:
66+
keywords:
67+
- FIXME
68+
govet:
69+
disable:
70+
- fieldalignment
71+
enable-all: true
72+
misspell:
73+
locale: US
2674

27-
linters-settings:
28-
govet:
29-
enable-all: true
30-
disable:
31-
- fieldalignment
32-
gocyclo:
33-
min-complexity: 20
34-
goconst:
35-
min-len: 5
36-
min-occurrences: 3
37-
misspell:
38-
locale: US
39-
funlen:
40-
lines: -1
41-
statements: 40
42-
godox:
43-
keywords:
44-
- FIXME
45-
gofumpt:
46-
extra-rules: true
47-
depguard:
48-
rules:
49-
main:
50-
deny:
51-
- pkg: "github.com/instana/testify"
52-
desc: not allowed
53-
- pkg: "github.com/pkg/errors"
54-
desc: Should be replaced by standard lib errors package
55-
gocritic:
56-
enabled-tags:
57-
- diagnostic
58-
- style
59-
- performance
60-
disabled-checks:
61-
- sloppyReassign
62-
- rangeValCopy
63-
- octalLiteral
64-
- paramTypeCombine # already handle by gofumpt.extra-rules
65-
settings:
66-
hugeParam:
67-
sizeThreshold: 100
75+
exclusions:
76+
warn-unused: true
77+
presets:
78+
- comments
6879

6980
issues:
70-
exclude-use-default: false
7181
max-issues-per-linter: 0
7282
max-same-issues: 0
73-
exclude:
74-
- 'package-comments: should have a package comment'
75-
76-
run:
77-
timeout: 5m

0 commit comments

Comments
 (0)