forked from tinkerbell/cluster-api-provider-tinkerbell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
165 lines (161 loc) · 4.24 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
# List for enabled linters can be generated for updates using the following command.
# golangci-lint linters | grep -E '^\S+:' | cut -d: -f1 | sort | sed 's/^/ - /g' | grep -v -E "($(grep '^ disable:' -A 100 .golangci.yml | grep -E ' - \S+$' | awk '{print $2}' | tr \\n '|' | sed 's/|$//g'))"
linters:
enable:
- asciicheck
- bodyclose
- cyclop
- deadcode
- depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errorlint
- exhaustive
# - exhaustivestruct
- exportloopref
- forbidigo
- forcetypeassert
- funlen
# - gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
# - godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- gomodguard
- goprintffuncname
- gosec
- gosimple
- ifshort
- importas
- ineffassign
# - interfacer
- lll
- makezero
# - maligned
- misspell
- nakedret
- nestif
- nilerr
- nlreturn
- noctx
- nolintlint
- paralleltest
- prealloc
- predeclared
- revive
- rowserrcheck
# - scopelint
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
- whitespace
- wrapcheck
- wsl
output:
sort-results: true
issues:
exclude-use-default: false
max-same-issues: 0
max-issues-per-linter: 0
exclude-rules:
# Ignore long kubebuilder lines as there is no way to break them down.
- linters:
- lll
- wsl
source: "^// \\+kubebuilder:"
- linters:
- lll
path: "controllers/(.+)_test.go"
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
gosimple:
go: "1.19"
staticcheck:
go: "1.19"
stylecheck:
go: "1.19"
unused:
go: "1.19"
tagliatelle:
case:
# use-field-name: true
rules:
json: goCamel
gomoddirectives:
# Allow local `replace` directives. Default is false.
replace-local: false
# List of allowed `replace` directives. Default is empty.
replace-allow-list:
- sigs.k8s.io/cluster-api
# Allow to not explain why the version has been retracted in the `retract` directives. Default is false.
retract-allow-no-explanation: false
# Forbid the use of the `exclude` directives. Default is false.
exclude-forbidden: false
gci:
# put imports beginning with prefix after 3rd-party packages;
# only support one prefix
# if not set, use goimports.local-prefixes
local-prefixes: github.com/tinkerbell/cluster-api-provider-tinkerbell
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/tinkerbell/cluster-api-provider-tinkerbell
nolintlint:
# Enable to ensure that nolint directives are all used. Default is true.
allow-unused: false
# Disable to ensure that nolint directives don't have a leading space. Default is true.
allow-leading-space: true
# Exclude following linters from requiring an explanation. Default is [].
allow-no-explanation: []
# Enable to require an explanation of nonzero length after each nolint directive. Default is false.
require-explanation: false
# Enable to require nolint directives to mention the specific linter being suppressed. Default is false.
require-specific: true
exhaustive:
default-signifies-exhaustive: true
run:
timeout: 10m
skip-files:
- "zz_generated.*\\.go$"
- ".*conversion.*\\.go$"
allow-parallel-runners: true
skip-dirs:
- tink/ # TODO: remove this line after #160 is merged. The /tink dir is going away