-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy path.golangci.yml
More file actions
151 lines (151 loc) · 3.98 KB
/
.golangci.yml
File metadata and controls
151 lines (151 loc) · 3.98 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
version: "2"
run:
allow-parallel-runners: true
linters:
default: none
enable:
- asciicheck
- bidichk
- copyloopvar
- depguard
- dupl
- errcheck
- ginkgolinter
- goconst
- gocyclo
- govet
- importas
- ineffassign
- lll
- modernize
- misspell
- nakedret
- nolintlint
- prealloc
- revive
- staticcheck
- unconvert
- unparam
- unused
- wrapcheck
- whitespace
settings:
depguard:
rules:
forbid-pkg-errors:
deny:
- pkg: sort
desc: Should be replaced with slices package
ginkgolinter:
forbid-focus-container: true
forbid-spec-pollution: true
govet:
disable:
- fieldalignment
enable-all: true
importas:
no-unaliased: true
alias:
- pkg: sigs.k8s.io/kubebuilder/v4/pkg/plugins/optional/helm/v1alpha
alias: helmv1alpha
- pkg: sigs.k8s.io/kubebuilder/v4/pkg/plugins/optional/helm/v2alpha
alias: helmv2alpha
- pkg: sigs.k8s.io/kubebuilder/v4/pkg/plugins/optional/grafana/v1alpha
alias: grafanav1alpha
- pkg: "sigs.k8s.io/kubebuilder/v4/pkg/plugins/optional/autoupdate/v1alpha"
alias: autoupdatev1alpha
- pkg: sigs.k8s.io/kubebuilder/v4/pkg/plugins/golang/deploy-image/v1alpha1
alias: deployimagev1alpha1
- pkg: sigs.k8s.io/kubebuilder/v4/pkg/plugins/golang/v4
alias: golangv4
- pkg: sigs.k8s.io/kubebuilder/v4/pkg/plugins/common/kustomize/v2
alias: kustomizecommonv2
modernize:
disable:
# Suggest replacing omitempty with omitzero for struct fields.
# Disable this check for now since it introduces too many changes in our existing codebase.
# See https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize#hdr-Analyzer_omitzero for more details.
- omitzero
nolintlint:
allow-unused: false
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
arguments:
- allowedPackages:
- github.com/onsi/ginkgo/v2
- github.com/onsi/gomega
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
disabled: true
- name: if-return
- name: import-shadowing
- name: increment-decrement
- name: var-naming
severity: warning
arguments:
- ["ID"] # allowed initialisms
- ["VM"] # disallowed initialisms
- [
# <-- this is a list containing one map
{
skip-initialism-name-checks: true,
upper-case-const: true,
skip-package-name-checks: true,
extra-bad-package-names: ["helpers", "models"],
},
]
- name: var-declaration
- name: package-comments
disabled: true
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id
- name: bool-literal-in-expr
- name: constant-logical-expr
- name: comment-spacings
exclusions:
generated: lax
rules:
- linters:
- gosec
path: test/e2e/*
- linters:
- gosec
- lll
path: hack/docs/*
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(sigs.k8s.io/kubebuilder)
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$