-
Notifications
You must be signed in to change notification settings - Fork 30
/
.golangci.yml
113 lines (111 loc) · 2.53 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# options for analysis running
run:
modules-download-mode: mod
linters-settings:
dogsled:
# Checks assignments with too many blank identifiers.
# Default: 2
max-blank-identifiers: 3
funlen:
lines: 300
statements: 300
gocyclo:
min-complexity: 50
dupl:
threshold: 150
depguard:
# Rules to apply.
# Default: Only allow $gostd in all files.
rules:
# Name of a rule.
main:
# List of file globs that will match this list of settings to compare against.
# Default: $all
files:
- "!**/*_a _file.go"
# List of allowed packages.
allow:
- $gostd
- github.com/mjtrangoni/flexlm_exporter
- github.com/prometheus/client_golang
- github.com/prometheus/common/promslog
- github.com/prometheus/common/version
- github.com/prometheus/exporter-toolkit/web
- github.com/alecthomas/kingpin/v2
# Packages that are not allowed where the value is a suggestion.
deny:
- pkg: "github.com/sirupsen/logrus"
desc: not allowed
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: github.com/golangci/golangci-lint
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- whyNoLint
- wrapperFunc
linters:
disable-all: true
enable:
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- funlen
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- mnd
- nakedret
- noctx
- nolintlint
- perfsprint
- revive
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- wsl
issues:
exclude-rules:
- text: "type `typedDesc` is unused"
linters:
- unused
- text: "rewrite if-else to switch statement"
linters:
- gocritic
- text: "consider giving a name to these results"
linters:
- gocritic
- text: "Subprocess launched with a potential tainted input or cmd arguments"
linters:
- gosec
- text: "if statements should only be cuddled with assignments"
linters:
- wsl
- text: "Error return value of"
linters:
- errcheck