forked from kubernetes-sigs/cluster-api-provider-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
153 lines (151 loc) · 3.92 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
run:
deadline: 10m
skip-files:
- 'zz_generated\.(\w*)\.go$'
build-tags:
- e2e
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bodyclose
- containedctx
- decorder
- depguard
- dogsled
- errcheck
- errchkjson
- errorlint
- execinquery
- exportloopref
- gci
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- importas
- ineffassign
- misspell
- nakedret
- nilerr
- noctx
- nolintlint
- nosprintfhostport
- prealloc
- predeclared
- reassign
- revive
- rowserrcheck
- staticcheck
- stylecheck
- thelper
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- whitespace
# Run with --fast=false for more extensive checks
fast: true
linters-settings:
importas:
no-unaliased: true
alias:
# Kubernetes
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
alias: apiextensionsv1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/apimachinery/pkg/util/errors
alias: kerrors
# Controller Runtime
- pkg: sigs.k8s.io/controller-runtime
alias: ctrl
# CAPI
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
alias: clusterv1
# CAPI exp
- pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1
alias: expv1
# CAPZ
- pkg: sigs.k8s.io/cluster-api-provider-azure/api/v1beta1
alias: infrav1
# CAPZ exp
- pkg: sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1
alias: infrav1exp
- pkg: sigs.k8s.io/cluster-api-provider-azure/util/webhook
alias: webhookutils
# Azure
- pkg: github.com/Azure/go-autorest/autorest/azure
alias: azureautorest
# ASO
- pkg: github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601
alias: asoresourcesv1
# Azureutil
- pkg: sigs.k8s.io/cluster-api-provider-azure/util/azure
alias: azureutil
# Deprecated
- pkg: github.com/Azure/go-autorest/autorest/to
alias: deprecated-use-k8s.io-utils-pointer
gocritic:
enabled-tags:
- "experimental"
godot:
# declarations - for top level declaration comments (default);
# toplevel - for top level comments;
# all - for all comments.
scope: toplevel
exclude:
- '^ \+.*'
- '^ ANCHOR.*'
gosec:
excludes:
- G307 # Deferring unsafe method "Close" on type "\*os.File"
- G108 # Profiling endpoint is automatically exposed on /debug/pprof
revive:
rules:
- name: exported
arguments:
- disableStutteringCheck
staticcheck:
go: "1.20"
stylecheck:
go: "1.20"
unused:
go: "1.20"
issues:
exclude-rules:
- path: '(\w*)conversion.go'
text: "use underscores in Go names|receiver name (.+) should be consistent|methods on the same type should have the same receiver name"
- path: 'mock(\w+)/doc.go$'
text: "use underscores in package names|don't use an underscore in package name"
- path: ^test/
linters:
- dogsled
- goconst
- godot
- prealloc
- path: ^test/
text: exported (.+) should have comment( \(or a comment on this block\))? or be unexported
# Need to use the deprecated module "github.com/Azure/azure-sdk-for-go/services" till issue #2670 is addressed.
- linters:
- staticcheck
text: "github.com/Azure/azure-sdk-for-go/services/.* is deprecated"
- source: \"github.com/onsi/(ginkgo/v2|gomega)\"
text: "should not use dot imports"
include:
- EXC0012 # revive: check for comments
- EXC0014 # revive: check for comments
max-issues-per-linter: 0
max-same-issues: 0