-
Notifications
You must be signed in to change notification settings - Fork 476
/
Copy path.golangci.yml
92 lines (92 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
91
92
version: "2"
output:
formats:
tab:
path: stdout
print-linter-name: true
colors: false
linters:
enable:
- bodyclose
- copyloopvar
- dogsled
- dupl
- durationcheck
- exhaustive
- gochecknoinits
- goconst
- gocritic
- gosec
- lll
- misspell
- mnd
- nakedret
- noctx
- nolintlint
- staticcheck
- unconvert
- unparam
settings:
goconst:
min-len: 20
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- mnd
# Excluding single digits from magic number detector because it produces too many obvious results (like klog)
text: 'Magic number: [0-9]{1},'
- linters:
- mnd
# Exclude file masks from magic number detector because these numbers are obvious
text: 'Magic number: 0[0-7]{3},'
- linters:
- mnd
path: pkg/controllers/proxy/network_services_controller.go
# Exclude IP masks netmasks as substituting them for constants only makes these less obvious
text: 'Magic number: 255,'
- linters:
- mnd
# Exclude IP netmasks from magic number detector because these numbers are obvious
text: 'Magic number: 32,'
- linters:
- mnd
# Exclude decimal bases from magic number detector because these numbers are obvious
text: 'Magic number: 10,'
- linters:
- gosec
# Exclude file mask security findings as we are always intentional about the file masks we use
text: 'G306:'
- linters:
- lll
# Exclude tests from long line linter
path: _test\.go
- linters:
- dupl
# Exclude tests from duplicate linter
path: _test\.go
- linters:
- goconst
path: (.+)_test\.go
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$