Skip to content

Commit e748448

Browse files
committed
chore: clean up and sort golangci-lint configuration
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 96a5ad6 commit e748448

File tree

1 file changed

+34
-26
lines changed

1 file changed

+34
-26
lines changed

.golangci.yml

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
version: "2"
1+
formatters:
2+
enable:
3+
- gofmt
4+
- gofumpt
5+
- goimports
6+
7+
exclusions:
8+
generated: strict
9+
10+
paths:
11+
- ^.*\.(pb|y)\.go$
12+
13+
settings:
14+
gofumpt:
15+
extra-rules: true
16+
17+
goimports:
18+
local-prefixes:
19+
- github.com/prometheus/client_golang
20+
221
issues:
322
max-same-issues: 0
423

@@ -16,25 +35,29 @@ linters:
1635
- unconvert
1736
- usestdlibvars
1837
- wastedassign
38+
1939
exclusions:
20-
generated: lax
40+
generated: strict
41+
42+
paths:
43+
- ^.*\.(pb|y)\.go$
44+
2145
presets:
2246
- comments
2347
- common-false-positives
2448
- legacy
2549
- std-error-handling
50+
2651
rules:
2752
- linters:
2853
- errcheck
2954
- govet
3055
- structcheck
3156
- nolintlint
3257
path: _test.go
33-
paths:
34-
- ^.*\.(pb|y)\.go$
35-
- third_party$
36-
- builtin$
37-
- examples$
58+
59+
warn-unused: true
60+
3861
settings:
3962
depguard:
4063
rules:
@@ -46,12 +69,14 @@ linters:
4669
desc: Use github.com/go-kit/log instead of github.com/go-kit/kit/log
4770
- pkg: io/ioutil
4871
desc: Use corresponding 'os' or 'io' functions instead.
72+
4973
errcheck:
5074
exclude-functions:
5175
# The following 2 methods always return nil as the error
5276
- (*github.com/cespare/xxhash/v2.Digest).Write
5377
- (*github.com/cespare/xxhash/v2.Digest).WriteString
5478
- (*bufio.Writer).WriteRune
79+
5580
perfsprint:
5681
# Optimizes even if it requires an int or uint type cast.
5782
int-conversion: true
@@ -63,28 +88,11 @@ linters:
6388
sprintf1: true
6489
# Optimizes into strings concatenation.
6590
strconcat: true
91+
6692
revive:
6793
rules:
68-
6994
- name: unused-parameter
7095
severity: warning
7196
disabled: true
7297

73-
formatters:
74-
enable:
75-
- gofmt
76-
- gofumpt
77-
- goimports
78-
settings:
79-
gofumpt:
80-
extra-rules: true
81-
goimports:
82-
local-prefixes:
83-
- github.com/prometheus/client_golang
84-
exclusions:
85-
generated: lax
86-
paths:
87-
- ^.*\.(pb|y)\.go$
88-
- third_party$
89-
- builtin$
90-
- examples$
98+
version: "2"

0 commit comments

Comments
 (0)