forked from signalfx/signalfx-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
86 lines (77 loc) · 2.45 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
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
linters-settings:
settings:
printf:
funcs:
- (github.com/signalfx/signalfx-agent/pkg/utils.ThrottledLogger).ThrottledWarning
run:
modules-download-mode: readonly
timeout: 5m