-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy path.golangci.yaml
More file actions
154 lines (152 loc) · 4.91 KB
/
.golangci.yaml
File metadata and controls
154 lines (152 loc) · 4.91 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: "2"
run:
timeout: 5m
modules-download-mode: vendor
linters:
default: fast
disable:
# We do not prevent the use of any dependency at the moment.
- depguard
# Some long functions are acceptable in the codebase as they come from long ago.
# This will need addressing in the future, disabling for now.
- funlen
# Some packages require init functions as of today, so we disable this linter.
- gochecknoinits
# We do not enforce cognitive complexity in the codebase.
- gocognit
# Superseded by cyclop.
- gocyclo
# We do not enforce comments ending with a dot.
- godot
# There are many TODOs in the codebase that come from long ago. Disable until addressed.
- godox
# Gomod is heavily modified with custom directives, so we disable the linter.
- gomoddirectives
# Line length checks, no need to verify this one as we do not enforce it.
- lll
# Replaced by cyclop.
- maintidx
# Magic number, need to address this one with constants all across the codebase.
- mnd
# We do not enforce new line returns in our code style.
- nlreturn
# Replaced by whitespace.
- wsl
# We do not enforce godoc comments.
- godoclint
# https://golangci-lint.run/usage/linters/
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- errcheck
- exhaustive
- goconst
- gosec
- govet
- importas
- ireturn
- loggercheck
- nestif
- nilerr
- nilnil
- nosprintfhostport
- reassign
- unconvert
- unparam
- usestdlibvars
- wastedassign
- whitespace
exclusions:
presets:
- common-false-positives
rules:
- path: '_test\.go'
linters:
- bodyclose
- dupl
- errcheck
- goconst
- gosec
- path: 'pkg/cmd/init\.go'
text: 'calculated cyclomatic complexity for function initKubeconfigs is'
- path: 'pkg/config/config\.go'
text: 'calculated cyclomatic complexity for function incorporateUserSettings is'
- path: 'pkg/config/config\.go'
text: 'calculated cyclomatic complexity for function validate is'
- path: 'pkg/config/ingress\.go'
text: 'calculated cyclomatic complexity for function Validate is'
- path: 'pkg/admin/autorecovery/restore\.go'
text: 'calculated cyclomatic complexity for function PerformRestore is'
- path: 'pkg/components/controllers\.go'
text: 'calculated cyclomatic complexity for function generateIngressParams is'
- path: 'pkg/util/cryptomaterial/certchains/chainsbuilder\.go'
text: 'NewCertificateChains returns interface'
- path: 'pkg/util/cryptomaterial/certchains/chainsbuilder\.go'
text: 'WithSigners returns interface'
- path: 'pkg/util/cryptomaterial/certchains/chainsbuilder\.go'
text: 'WithCABundle returns interface'
- path: 'pkg/util/cryptomaterial/certchains/signerbuilder\.go'
text: 'NewCertificateSigner returns interface'
- path: 'pkg/util/cryptomaterial/certchains/signerbuilder\.go'
text: 'WithSignerConfig returns interface'
- path: 'pkg/util/cryptomaterial/certchains/signerbuilder\.go'
text: 'WithCABundlePaths returns interface'
- path: 'pkg/util/cryptomaterial/certchains/signerbuilder\.go'
text: 'WithClientCertificates returns interface'
- path: 'pkg/util/cryptomaterial/certchains/signerbuilder\.go'
text: 'WithServingCertificates returns interface'
- path: 'pkg/util/cryptomaterial/certchains/signerbuilder\.go'
text: 'WithPeerCertificiates returns interface'
- path: 'cmd/generate-config/opts\.go'
text: 'G302: Expect file permissions to be 0600 or less'
- path: 'pkg/components/storage\.go'
text: 'G301: Expect directory permissions to be 0750 or less'
- path: 'pkg/components/storage\.go'
text: 'G302: Expect file permissions to be 0600 or less'
- path: 'pkg/config/node\.go'
text: 'G703: Path traversal via taint analysis'
- path: 'pkg/controllers/kube-apiserver\.go'
text: 'G703: Path traversal via taint analysis'
- path: 'pkg/telemetry/telemetry\.go'
text: 'G704: SSRF via taint analysis'
- path: 'pkg/util/cryptomaterial/certchains/signers\.go'
text: 'toBuilder returns interface'
settings:
cyclop:
max-complexity: 20
funcorder:
struct-method: false
inamedparam:
skip-single-param: true
ireturn:
allow:
- anon
- error
- empty
- stdlib
- generic
testpackage:
allow-packages:
- autorecovery
- apiserver
- certchains
- cmd
- components
- config
- controllers
- data
- healthcheck
- lvmd
- mdns
- node
- ovn
- prerun
- server
- servicemanager
- sigchannel
- telemetry
- util