forked from Azure/ARO-RP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
190 lines (184 loc) · 7.18 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
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
run:
timeout: 10m
skip-dirs:
- vendor/portal
- vendor
skip-dirs-use-default: true
modules-download-mode: vendor
build-tags:
- "aro"
- "containers_image_openpgp"
- "exclude_graphdriver_devicemapper"
- "exclude_graphdriver_btrfs"
go: "1.21"
output:
format: github-actions
issues:
max-same-issues: 0
exclude-rules:
- linters:
- staticcheck
text: "SA1019: codec.BasicHandle is deprecated"
# This is set to false to disregard the default EXC0011 exclusion
# which shadows all the ST* checks. Refer https://github.com/golangci/golangci-lint/issues/2281
- path: "pkg/client/(.+)\\.go"
linters:
- importas
- path: "(.+/)?zz_generated_(.+)\\.go"
linters:
- importas
- path: "pkg/operator/(clientset|mocks)/(.+)\\.go"
linters:
- importas
- path: "pkg/util/mocks/(.+)\\.go"
linters:
- importas
exclude-use-default: false
linters-settings:
stylecheck:
# added additional checks for comments in Go.
# Refer https://staticcheck.io/docs/options#checks for details
checks:
["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
dot-import-whitelist:
- github.com/onsi/ginkgo/v2
- github.com/onsi/gomega
importas:
alias:
- pkg: github.com/Azure/ARO-RP/pkg/frontend/middleware
alias: frontendmiddleware
- pkg: github.com/Azure/ARO-RP/pkg/metrics/statsd/cosmosdb
alias: dbmetrics
- pkg: github.com/Azure/ARO-RP/pkg/operator/apis/aro.openshift.io/v1alpha1
alias: arov1alpha1
- pkg: github.com/Azure/ARO-RP/pkg/operator/apis/preview.aro.openshift.io/v1alpha1
alias: aropreviewv1alpha1
- pkg: github.com/Azure/ARO-RP/pkg/operator/clientset/versioned
alias: aroclient
- pkg: github.com/Azure/ARO-RP/pkg/operator/clientset/versioned/fake
alias: arofake
- pkg: github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/keyvault
alias: keyvaultclient
- pkg: github.com/Azure/ARO-RP/pkg/util/dynamichelper/discovery
alias: utildiscovery
- pkg: github.com/Azure/ARO-RP/test/database
alias: testdatabase
- pkg: github.com/Azure/ARO-RP/test/util/dynamichelper
alias: testdynamichelper
- pkg: github.com/Azure/ARO-RP/test/util/log
alias: testlog
- pkg: github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault
alias: azkeyvault
- pkg: github.com/Azure/azure-sdk-for-go/storage
alias: azstorage
- pkg: github.com/coreos/stream-metadata-go/arch
alias: coreosarch
- pkg: github.com/googleapis/gnostic/openapiv2
alias: openapi_v2
- pkg: github.com/openshift/console-operator/pkg/api
alias: consoleapi
- pkg: github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1
alias: machinev1beta1
- pkg: github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned
alias: maoclient
- pkg: github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/fake
alias: maofake
- pkg: github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1
alias: mcv1
- pkg: github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned
alias: mcoclient
- pkg: github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake
alias: mcofake
- pkg: github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/typed/machineconfiguration.openshift.io/v1
alias: mcoclientv1
- pkg: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1
alias: monitoringv1
- pkg: golang.org/x/crypto/ssh
alias: cryptossh
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
alias: extensionsv1
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1
alias: extensionsv1beta1
- pkg: k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset
alias: extensionsclient
- pkg: k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake
alias: extensionsfake
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: kerrors
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apimachinery/pkg/runtime
alias: kruntime
- pkg: k8s.io/apimachinery/pkg/runtime/serializer/json
alias: kjson
- pkg: k8s.io/apimachinery/pkg/util/rand
alias: utilrand
- pkg: k8s.io/apimachinery/pkg/util/runtime
alias: utilruntime
- pkg: k8s.io/apimachinery/pkg/version
alias: kversion
- pkg: k8s.io/client-go/testing
alias: ktesting
- pkg: k8s.io/client-go/tools/clientcmd/api/v1
alias: clientcmdv1
- pkg: k8s.io/client-go/tools/metrics
alias: kmetrics
- pkg: sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1
alias: azureproviderv1beta1
- pkg: sigs.k8s.io/controller-runtime
alias: ctrl
- pkg: github.com/openshift/hive/pkg/client/clientset/versioned
alias: hiveclient
- pkg: github.com/openshift/hive/pkg/client/clientset/versioned/fake
alias: hivefake
- pkg: github.com/openshift/hive/apis/hive/v1
alias: hivev1
- pkg: github.com/openshift/hive/apis/hive/v1/azure
alias: hivev1azure
- pkg: github.com/gofrs/uuid
alias: gofrsuuid
- pkg: github.com/Azure/ARO-RP/pkg/operator/controllers/checkers/common
alias: checkercommon
- pkg: github.com/Azure/ARO-RP/pkg/api/util/subnet
alias: apisubnet
- pkg: "^github\\.com/Azure/ARO-RP/pkg/api/(v[^/]*[0-9])$"
alias: $1
- pkg: "^github\\.com/Azure/ARO-RP/pkg/client/services/redhatopenshift/mgmt/([0-9]+)-([0-9]+)-([0-9]+)-?(preview)?/redhatopenshift$"
alias: mgmtredhatopenshift$1$2$3$4
- pkg: "^github\\.com/Azure/ARO-RP/pkg/(deploy|gateway|mirror|monitor|operator|portal)$"
alias: pkg$1
- pkg: "^github\\.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/redhatopenshift/([0-9]+)-([0-9]+)-([0-9]+)-?(preview)?/redhatopenshift$"
alias: redhatopenshift$1$2$3$4
- pkg: "^github\\.com/Azure/ARO-RP/pkg/util/([^/]+)$"
alias: util$1
- pkg: "^github\\.com/Azure/ARO-RP/pkg/(util|operator)/mocks/(.+/)?([^/]+)$"
alias: mock_$3
- pkg: "^github\\.com/Azure/azure-sdk-for-go/services/(preview/)?([^/]+)/mgmt/([^/]+)/([^/]+)$"
alias: mgmt$4
- pkg: "^github\\.com/openshift/api/([^/]+)/(v[^/]+)$"
alias: $1$2
- pkg: "^github\\.com/openshift/client-go/([^/]+)/clientset/versioned$"
alias: ${1}client
- pkg: "^github\\.com/openshift/client-go/([^/]+)/clientset/versioned/fake$"
alias: ${1}fake
- pkg: "^k8s\\.io/api/([^/]+)/(v[^/]+)$"
alias: $1$2
- pkg: "^k8s\\.io/client-go/kubernetes/typed/([^/]+)/(v[^/]+)$"
alias: $1${2}client
linters:
disable-all: true
enable:
- gofmt
- unused
- gosimple
- govet
- staticcheck
- whitespace
- stylecheck
- unconvert
- importas
- tenv
- musttag
- ginkgolinter
- testifylint
- usestdlibvars