-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.golangci.yaml
174 lines (174 loc) · 5.29 KB
/
.golangci.yaml
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
linters:
disable-all: true
# One can't use disable and disable-all. disable-all is preferred to avoid lint failing when golangci gets updated and linters are added.
# at the same time but it is nice to explicitly state which linters we do not want.
#disable:
#- containedctx # Context.Context within a struct (as opposed to a func parameter) is nasty for many reasons, but actually sometimes useful.
#- contextcheck # Not that useful/false positives.
#- cyclop # Cyclo complexity already calculated by other linters.
#- depguard # We do not restrict imports.
#- dogsled # Could be nice in the future.
#- dupl # Could be nice in the future.
#- err113 # Could be nice in the future.
#- exhaustive # Not that useful/false positives.
#- exhaustruct # Not that useful/false positives.
#- forcetypeassert # We want a panic in situations when a type is asserted.
#- funlen # We really like long functions.
#- gci # Conflicts with other linters.
#- gochecknoglobals # We need globals.
#- gochecknoinits # We have a lot of those.
#- gocognit # Not that useful/false positives.
#- godox # Not that useful/false positives.
#- gomoddirectives # Not that useful/false positives.
#- inamedparam # Not that useful.
#- interfacebloat # WE do bloaty interfaces.
#- ireturn # Not that useful/false positives.
#- mnd # The annoy is strong.
#- nakedret # Naked return good return.
#- nlreturn # Could be nice in the future.
#- nonamedreturns # Named return good return.
#- paralleltest # Could be nice in the future.
#- tagliatelle # Reports issues that are not right for us.
#- testpackage # Could be nice in the future.
#- tparallel # Could be nice in the future.
#- unparam # Not that useful/false positives.
#- varnamelen # Not that useful/false positives.
#- wrapcheck # Not that useful/false positives.
#- wsl # Not that useful/false positives.
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- copyloopvar
- decorder
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- fatcontext
- forbidigo
- ginkgolinter
- gocheckcompilerdirectives
- gochecksumtype
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- importas
- ineffassign
- intrange
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tenv
- testableexamples
- testifylint
- thelper
- typecheck
- unconvert
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
issues:
max-same-issues: 0
max-issues-per-linter: 0
exclude-rules:
# Integration tests MUST NOT run in parallel.
- path: 'integration\/.+\.go|run\/target_test.go'
linters:
- paralleltest
linters-settings:
goimports:
local-prefixes: package-operator.run
gosec:
excludes:
- G301 # Poor file permissions used when creating a directory.
- G302 # Poor file permissions used with chmod.
- G306 # Poor file permissions used when writing to a new file.
- G601 # Taking address of loop variable - not relevant anymore.
- G602 # Should reports out of bound access but is broken.
importas:
no-unaliased: false
no-extra-aliases: true
alias:
- pkg: k8s\.io\/api\/([^\/]+)\/([^\/]+)
alias: $1$2
- pkg: k8s\.io\/apimachinery\/pkg\/([^\/]+)
alias: $1
- pkg: k8s\.io\/apimachinery\/pkg\/apis\/([^\/]+)\/([^\/]+)
alias: $1$2
- pkg: package-operator\.run\/apis
alias: apis
- pkg: package-operator\.run\/apis\/([^\/]+)\/([^\/]+)
alias: $1$2
- pkg: k8s\.io\/apiextensions-apiserver\/pkg\/apis\/([^\/]+)\/([^\/]+)
alias: $1$2
- pkg: github\.com\/openshift\/api\/([^\/]+)\/([^\/]+)
alias: $1$2
- pkg: package-operator.run/internal/controllers/hostedclusters/([^\/]+)\/([^\/]+)
alias: $1$2
- pkg: k8s\.io\/apimachinery\/pkg\/api\/([^\/]+)
alias: apimachinery$1
- pkg: sigs\.k8s\.io\/controller-runtime
alias: ctrl
- pkg: package-operator\.run\/internal\/cmd
alias: internalcmd
- pkg: package-operator\.run\/internal\/probing
alias: internalprobing
- pkg: package-operator\.run\/internal\/controllers\/packages
alias: controllerspackages
- pkg: github\.com\/google\/go-containerregistry\/pkg\/v1
alias: containerregistrypkgv1
- pkg: k8s\.io\/utils\/clock\/testing
alias: clocktesting
- pkg: k8s\.io\/apiserver\/pkg\/cel
alias: apiservercel
- pkg: k8s\.io\/apiserver\/pkg\/apis\/cel
alias: apiserverapiscel
- pkg: sigs.k8s.io/kind/pkg/apis/config/v1alpha4
alias: kindv1alpha4
- pkg: k8s.io/client-go/kubernetes/scheme
alias: clientgoscheme
- pkg: sigs.k8s.io/kind/pkg/cmd
alias: kindcmd