-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy path.golangci.yml
90 lines (87 loc) · 2.17 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
version: "2"
issues:
max-same-issues: 0
linters:
enable:
- copyloopvar
- depguard
- durationcheck
- errorlint
- misspell
- nolintlint
- perfsprint
- predeclared
- revive
- unconvert
- usestdlibvars
- wastedassign
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- errcheck
- govet
- structcheck
- nolintlint
path: _test.go
paths:
- ^.*\.(pb|y)\.go$
- third_party$
- builtin$
- examples$
settings:
depguard:
rules:
main:
deny:
- pkg: github.com/stretchr/testify/assert
desc: Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert
- pkg: github.com/go-kit/kit/log
desc: Use github.com/go-kit/log instead of github.com/go-kit/kit/log
- pkg: io/ioutil
desc: Use corresponding 'os' or 'io' functions instead.
errcheck:
exclude-functions:
# The following 2 methods always return nil as the error
- (*github.com/cespare/xxhash/v2.Digest).Write
- (*github.com/cespare/xxhash/v2.Digest).WriteString
- (*bufio.Writer).WriteRune
perfsprint:
# Optimizes even if it requires an int or uint type cast.
int-conversion: true
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
err-error: true
# Optimizes `fmt.Errorf`.
errorf: true
# Optimizes `fmt.Sprintf` with only one argument.
sprintf1: true
# Optimizes into strings concatenation.
strconcat: true
revive:
rules:
- name: unused-parameter
severity: warning
disabled: true
formatters:
enable:
- gofmt
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: true
goimports:
local-prefixes:
- github.com/prometheus/client_golang
exclusions:
generated: lax
paths:
- ^.*\.(pb|y)\.go$
- third_party$
- builtin$
- examples$