-
Notifications
You must be signed in to change notification settings - Fork 41
/
.golangci.yml
161 lines (154 loc) · 3.64 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
run:
skip-files:
- ".*zz_generated.*\\.go"
- "contrib/.*"
timeout: 5m
issue:
max-same-issues: 0
max-per-linter: 0
issues:
exclude-rules:
- path: "test/e2e/*"
linters:
- gosec
text: "G106:"
- linters:
- revive
text: "dot-imports"
path: ".*test.*"
- linters:
- stylecheck
text: "ST1001"
path: ".*test.*"
linters:
fast: true
disable-all: true
enable:
- asciicheck
- bodyclose
- depguard
- dogsled
- errcheck
- exportloopref
- gci
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- importas
- ineffassign
- misspell
- nakedret
- nilerr
- noctx
- nolintlint
- prealloc
- predeclared
- revive
- rowserrcheck
- staticcheck
- stylecheck
- thelper
- typecheck
- unconvert
- unparam
- unused
- whitespace
linters-settings:
depguard:
rules:
main:
allow:
- $gostd
- github.com/go-logr/logr
- github.com/coredns/corefile-migration/migration
- github.com/pkg/errors
- github.com/davecgh/go-spew/spew
- k8s.io/api
- k8s.io/apimachinery/pkg
- k8s.io/apiserver
- k8s.io/client-go
- k8s.io/klog/v2
- k8s.io/utils/ptr
- github.com/onsi/ginkgo
- github.com/onsi/gomega
- sigs.k8s.io/yaml
- sigs.k8s.io/controller-runtime
- sigs.k8s.io/cluster-api
- github.com/k3s-io/cluster-api-k3s
- github.com/google/uuid
- github.com/pkg/errors
gci:
sections:
- standard
- default
- prefix(github.com/k3s-io/cluster-api-k3s)
gomoddirectives:
# List of allowed `replace` directives.
# Default: []
replace-allow-list:
- sigs.k8s.io/cluster-api
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/k3s-io/cluster-api-k3s
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
importas:
# Do not allow unaliased imports of aliased packages.
# Default: false
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
nolintlint:
# Enable to require nolint directives to mention the specific linter being suppressed.
# Default: false
require-specific: true
revive:
rules:
- name: exported
arguments:
- disableStutteringCheck
- name: unused-parameter
disabled: true
staticcheck:
go: "1.22"
stylecheck:
go: "1.22"
tagliatelle:
case:
rules:
# Any struct tag type can be used.
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
json: goCamel
unused:
go: "1.22"