forked from signalfx/signalfx-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
136 lines (126 loc) · 3.39 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
issues:
max-same-issues: 0
max-per-linter: 0
exclude-rules:
# We use certain values repeatedly in different test cases. Using consts would only
# reduce clarity. Code is also sometimes repeated and factoring it would also
# reduce clarity.
- linters:
- goconst
- dupl
path: _test\.go
# Test code can do weird things with context in BeforeEach
- text: cancel
path: _test\.go
linters:
- govet
# There are many places where we let users set TLS InsecureSkipVerify from
# config
- text: G402
linters:
- gosec
# command arguments aren't so bad
- text: G204
linters:
- gosec
# pprof endpoint is only exposed when profiling: true
- text: G108
linters:
- gosec
# There is duplication in structure here but it would be far more complex
# and unreadable to abstract it out.
- path: pkg/monitors/cgroups
linters:
- dupl
- path: pkg/monitors/kubernetes/cluster/metrics
linters:
- goconst
- dupl
linters:
enable-all: true
disable:
# Line length is only a problem if it impedes readability, which should be
# determined at code review time.
- lll
# We use init funcs pretty heavily to register montiors at startup
- gochecknoinits
# A lot of config structs have a certain order due to grouping of options
# and they are only allocated once so space optimization isn't important.
- maligned
# This flags things a lot when it is impossible to know how big the backing
# array should be.
- prealloc
# There are many legitimate uses of globals
- gochecknoglobals
- godox
# An analyzer to detect magic numbers.
- gomnd
# Checks whether Err of rows is checked successfully
# Re-enable when this false positive is fixed https://github.com/golangci/golangci-lint/issues/943
- rowserrcheck
# Too many of these errors to fix in a reasonable amount of time.
- wsl
# TODO: reenable this one after a fix up of the existing code base
- whitespace
# funlen and gocognit are useful in revealing bloated functions, but this
# should be determined at code review as there are many legitimate
# violations.
- funlen
- gocognit
# The following started erroring w/ 1.18 upgrade. Disabling
# for now and their value could be evaluated in the future.
- asasalint
- containedctx
- cyclop
- errchkjson
- errcheck
- errname
- errorlint
- exhaustive
- exhaustivestruct
- exhaustruct
- forbidigo
- forcetypeassert
- gci
- gocritic
- godot
- goerr113
- gofumpt
- gomoddirectives
- gosec
- gosimple
- ifshort
- ireturn
- maintidx
- nestif
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- nosnakecase
- paralleltest
- predeclared
- promlinter
- revive
- staticcheck
- stylecheck
- tagliatelle
- testpackage
- thelper
- tparallel
- usestdlibvars
- varnamelen
- wrapcheck
# We disable those new linters as we are looking to minimize code changes.
- interfacebloat
- contextcheck
linters-settings:
settings:
printf:
funcs:
- (github.com/signalfx/signalfx-agent/pkg/utils.ThrottledLogger).ThrottledWarning
run:
modules-download-mode: readonly
timeout: 5m