-
Notifications
You must be signed in to change notification settings - Fork 558
Expand file tree
/
Copy path.golangci.yml
More file actions
303 lines (303 loc) · 12.2 KB
/
Copy path.golangci.yml
File metadata and controls
303 lines (303 loc) · 12.2 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
version: "2"
run:
allow-parallel-runners: true
build-tags:
- integration
- e2e
- reqserving
- e2ev2
- backuprestore
- envtest
linters:
enable:
- dupword
- durationcheck
- errorlint
- fatcontext
- gocyclo
- misspell
- nilerr
- noctx
- unparam
- usestdlibvars
- hypershiftlinter
settings:
custom:
hypershiftlinter:
path: hack/tools/bin/hypershiftlinter.so
description: "Enforces HyperShift test conventions from TESTING.md and test/e2e/v2/AGENTS.md"
gocyclo:
min-complexity: 30
govet:
enable:
- nilness
misspell:
# The use of US spelling over other English spellings, like UK, is inline with the OpenShift conventions:
# https://github.com/openshift/enhancements/blob/master/CONVENTIONS.md#terminology-grammar-and-spelling
locale: US
# Typos to ignore.
# Should be in lower case.
ignore-rules:
- nto
exclusions:
warn-unused: true
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- unparam
path: '_test\.go$'
- linters:
- unparam
path: 'support/thirdparty/'
- linters:
- staticcheck
text: 'SA1019: hcp.Status.Version is deprecated: Use versionStatus.desired.version instead.'
- linters:
- staticcheck
text: 'SA1019: hcp.Status.ReleaseImage is deprecated: Use versionStatus.desired.image instead.'
- linters:
- staticcheck
text: 'SA1019: hcp.Status.LastReleaseImageTransitionTime is deprecated'
- linters:
- staticcheck
text: 'SA1019: infra.Status.Platform is deprecated: Use platformStatus.type instead'
- linters:
- unused
text: const tuningConfigKey is unused
- linters:
- staticcheck
text: 'ST1001: should not use dot imports'
source: 'github.com/onsi/gomega'
- linters:
- staticcheck
text: 'ST1001: should not use dot imports'
source: 'github.com/onsi/ginkgo'
- linters:
- staticcheck
text: 'ST1005: error strings should not be capitalized'
source: 'Konnectivity'
- linters:
- staticcheck
text: 'QF1008'
- linters:
- staticcheck
text: 'QF1007'
- linters:
- staticcheck
text: 'QF1001'
# aws-sdk-go v1 is deprecated but migration to v2 is a separate effort
- linters:
- staticcheck
text: 'SA1019: "github.com/aws/aws-sdk-go'
# GetEventRecorderFor is deprecated in controller-runtime v0.24 but migration to events.EventRecorder is a separate effort
- linters:
- staticcheck
text: 'SA1019: mgr.GetEventRecorderFor is deprecated'
# client.Apply is deprecated in controller-runtime v0.24 but migration to client.Client.Apply() is a separate effort
- linters:
- staticcheck
text: 'SA1019: (.*)\.Apply is deprecated'
# ibmCluster.Spec.ServiceInstanceID is deprecated but migration is a separate effort
- linters:
- staticcheck
text: 'SA1019: ibmCluster.Spec.ServiceInstanceID is deprecated'
# cluster-api v1beta1 is deprecated but migration to v1beta2 is a separate effort
- linters:
- staticcheck
text: 'SA1019: "sigs.k8s.io/cluster-api/(.*)" is deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped.'
# The rules below baseline findings in build-tagged main-module sources that were not
# previously linted. Keep them file-scoped and remove paths as the findings are fixed.
- linters:
- dupword
path: '^test/e2e/v2/backuprestore/etcd_snapshot_test\.go$'
- linters:
- errcheck
path: '^test/e2e/(e2e_test|karpenter_control_plane_upgrade_test)\.go$'
- linters:
- errorlint
path: '^test/e2e/v2/(backuprestore/velero|internal/workload_registry)\.go$'
- linters:
- fatcontext
path: '^test/(e2e/e2e_test|integration/integration_test|reqserving-e2e/reqserving_e2e_test)\.go$'
- linters:
- gocyclo
path: '^test/e2e/(karpenter_test|v2/tests/karpenter_test)\.go$'
- linters:
- hypershiftlinter
path: '^test/e2e/v2/tests/karpenter_test\.go$'
text: '^(contextbackground|e2eutilallowlist):'
- linters:
- ineffassign
path: '^test/e2e/(nodepool_osp_advanced_test|v2/tests/control_plane_tls_operator_test)\.go$'
- linters:
- misspell
path: '^test/(e2e/(e2e_test|nodepool_imagetype_test|v2/backuprestore/prober)|envtest/generator|integration/integration_test|reqserving-e2e/(cp_autoscaling_test|reqserving_e2e_test))\.go$'
- linters:
- nilerr
path: '^test/e2e/(karpenter_test|nodepool_kv_advanced_multinet_test|nodepool_test|v2/(backuprestore/velero|internal/workload_registry|tests/karpenter_test))\.go$'
- linters:
- noctx
path: '^test/e2e/(e2e_test|v2/(cmd/(destroy-guests|dump-guests|run-tests)/main|tests/(hosted_cluster_azure_test|hosted_cluster_external_oidc_test)))\.go$'
- linters:
- unparam
path: '^test/(e2e/v2/backuprestore/velero|integration/control_plane_pki_operator)\.go$'
- linters:
- unused
path: '^test/(e2e/(azure_scheduler_test|nodepool_nto_machineconfig_test|nodepool_test)|envtest/crd_filter)\.go$'
- linters:
- usestdlibvars
path: '^test/e2e/e2e_test\.go$'
- linters:
- staticcheck
path: '^test/e2e/(nodepool_arm64_create_test|v2/tests/nodepool_arm64_create_test)\.go$'
text: '^QF1003:'
- linters:
- staticcheck
path: '^test/e2e/nodepool_test\.go$'
text: '^S1005:'
- linters:
- staticcheck
path: '^test/e2e/(chaos_test|nodepool_kv_jsonpatch_test|nodepool_mirrorconfigs_test|nodepool_nto_performanceprofile_test)\.go$'
text: '^S1039:'
- linters:
- staticcheck
path: '^test/integration/oadp/cli/restore_cli_test\.go$'
text: '^SA1012:'
- linters:
- staticcheck
path: '^test/e2e/nodepool_osp_advanced_test\.go$'
text: '^SA4006:'
- linters:
- staticcheck
path: '^test/(e2e/(e2e_test|nodepool_test|podtimingcontroller/podtimingcontroller|v2/tests/hosted_cluster_security_test)|envtest/crd_filter|integration/integration_test)\.go$'
text: '^SA1019:'
- linters:
- staticcheck
path: '^test/(e2e/(e2e_test|nodepool_kv_advanced_multinet_test|nodepool_machineconfig_test|nodepool_nto_machineconfig_test)|integration/control_plane_pki_operator)\.go$'
text: '^ST1019'
paths:
- third_party$
- builtin$
- examples$
severity:
default: error
formatters:
enable:
- gci
settings:
gci:
sections:
- standard
- dot
- prefix(github.com/openshift/hypershift)
- prefix(github.com/openshift)
- prefix(github.com/aws)
- prefix(github.com/Azure)
- prefix(k8s.io)
- prefix(sigs.k8s.io)
- default
custom-order: true
exclusions:
warn-unused: true
generated: lax
paths:
- third_party$
- builtin$
- examples$
# Temporary GCI baseline for files first covered by the main-module build tags.
# Keep every expression file-scoped so new tagged files remain enforced.
- '^cmd/cluster/powervs/create\.go'
- '^support/capi-crdmigrator/crd_migrator_test\.go$'
- '^test/e2e/autoscaling_test\.go$'
- '^test/e2e/azure_oauth_lb_test\.go$'
- '^test/e2e/azure_private_link_test\.go$'
- '^test/e2e/azure_scheduler_test\.go$'
- '^test/e2e/capi_storage_migration_test\.go$'
- '^test/e2e/chaos_test\.go$'
- '^test/e2e/cilium_network_policy_test\.go$'
- '^test/e2e/control_plane_upgrade_test\.go$'
- '^test/e2e/create_cluster_test\.go$'
- '^test/e2e/e2e_test\.go$'
- '^test/e2e/external_oidc_test\.go$'
- '^test/e2e/karpenter_control_plane_upgrade_test\.go$'
- '^test/e2e/karpenter_test\.go$'
- '^test/e2e/nodepool_additionalTrustBundlePropagation_test\.go$'
- '^test/e2e/nodepool_arm64_create_test\.go$'
- '^test/e2e/nodepool_autorepair_test\.go$'
- '^test/e2e/nodepool_imagetype_test\.go$'
- '^test/e2e/nodepool_kms_root_volume_test\.go$'
- '^test/e2e/nodepool_kv_advanced_multinet_test\.go$'
- '^test/e2e/nodepool_kv_cache_image_test\.go$'
- '^test/e2e/nodepool_kv_evictionstrategy_test\.go$'
- '^test/e2e/nodepool_kv_jsonpatch_test\.go$'
- '^test/e2e/nodepool_kv_multinet_test\.go$'
- '^test/e2e/nodepool_kv_nodeselector_test\.go$'
- '^test/e2e/nodepool_kv_qos_guaranteed_test\.go$'
- '^test/e2e/nodepool_machineconfig_test\.go$'
- '^test/e2e/nodepool_major_version_upgrade_test\.go$'
- '^test/e2e/nodepool_mirrorconfigs_test\.go$'
- '^test/e2e/nodepool_nto_machineconfig_test\.go$'
- '^test/e2e/nodepool_nto_performanceprofile_test\.go$'
- '^test/e2e/nodepool_osp_advanced_test\.go$'
- '^test/e2e/nodepool_prev_release_test\.go$'
- '^test/e2e/nodepool_rolling_upgrade_test\.go$'
- '^test/e2e/nodepool_spot_termination_handler_test\.go$'
- '^test/e2e/nodepool_test\.go$'
- '^test/e2e/nodepool_upgrade_test\.go$'
- '^test/e2e/olm_test\.go$'
- '^test/e2e/podtimingcontroller/podtimingcontroller\.go$'
- '^test/e2e/upgrade_hypershift_operator_test\.go$'
- '^test/e2e/util/util_metrics_proxy\.go$'
- '^test/e2e/v2/backuprestore/cleanup\.go$'
- '^test/e2e/v2/backuprestore/cli\.go$'
- '^test/e2e/v2/backuprestore/etcd_snapshot\.go$'
- '^test/e2e/v2/backuprestore/prober\.go$'
- '^test/e2e/v2/backuprestore/velero\.go$'
- '^test/e2e/v2/cmd/create-guests/main\.go$'
- '^test/e2e/v2/internal/fail_handler\.go$'
- '^test/e2e/v2/internal/test_context\.go$'
- '^test/e2e/v2/internal/validation\.go$'
- '^test/e2e/v2/internal/workload_registry\.go$'
- '^test/e2e/v2/lifecycle/azure\.go$'
- '^test/e2e/v2/tests/backup_restore_test\.go$'
- '^test/e2e/v2/backuprestore/etcd_snapshot_test\.go'
- '^test/e2e/v2/tests/control_plane_infrastructure_test\.go$'
- '^test/e2e/v2/tests/control_plane_tls_operator_test\.go$'
- '^test/e2e/v2/tests/etcd_chaos_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_azure_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_ccm_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_compliance_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_cpo_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_external_oidc_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_image_registry_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_ingress_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_metrics_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_psc_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_pull_secret_test\.go$'
- '^test/e2e/v2/tests/hosted_cluster_security_test\.go$'
- '^test/e2e/v2/tests/karpenter_test\.go$'
- '^test/e2e/v2/tests/nodepool_autoscaling_test\.go$'
- '^test/e2e/v2/tests/nodepool_lifecycle_test\.go$'
- '^test/e2e/v2/tests/nodepool_osimagestream_test\.go$'
- '^test/e2e/v2/tests/suite_test\.go$'
- '^test/e2e/v2/util/keycloak\.go$'
- '^test/e2e/v2/util/pod_exec\.go$'
- '^test/envtest/generator\.go$'
- '^test/integration/control_plane_pki_operator\.go$'
- '^test/integration/hosted_cluster_sizing_test\.go$'
- '^test/integration/integration_test\.go$'
- '^test/integration/oadp/backup/etcd_backup_test\.go$'
- '^test/integration/oadp/cli/backup_cli_test\.go$'
- '^test/integration/oadp/cli/restore_cli_test\.go$'
- '^test/integration/oadp/cli/schedule_cli_test\.go$'
- '^test/integration/oadp/cli/utils\.go$'
- '^test/integration/oadp/upload/upload_test\.go$'
- '^test/integration/placeholder_test\.go$'
- '^test/reqserving-e2e/cp_autoscaling_test\.go$'
- '^test/reqserving-e2e/create_reqserving_cluster_test\.go$'
- '^test/reqserving-e2e/reqserving_e2e_test\.go$'