You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: kubeapilinter is the Kube-API-Linter and lints Kube like APIs based on API conventions and best practices.
11
+
settings:
12
+
linters:
13
+
enable:
14
+
- optionalfields
15
+
disable:
16
+
- "*"
17
+
lintersConfig:
18
+
optionalfields:
19
+
pointers:
20
+
preference: Always
21
+
policy: SuggestFix
22
+
omitEmpty:
23
+
# This will force omitempty on optional fields.
24
+
# This is in line with upstream guidance where optional fields should be omitted
25
+
# from the serialized output unless they are non-zero.
26
+
policy: SuggestFix
27
+
omitzero:
28
+
# This will force omitzero on optional struct fields.
29
+
# This means they can be omitted correctly and prevents the need for pointers to structs.
30
+
policy: SuggestFix
31
+
exclusions:
32
+
generated: lax
33
+
presets:
34
+
- comments
35
+
- common-false-positives
36
+
- legacy
37
+
- std-error-handling
38
+
paths:
39
+
- third_party$
40
+
- builtin$
41
+
- examples$
42
+
rules:
43
+
- linters:
44
+
- kubeapilinter
45
+
# This regex must always be updated in tandem with the regex in .golangci.yaml that prevents `optionalfields` from being applied to the files in the path-except.
Copy file name to clipboardExpand all lines: .golangci.yaml
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,12 @@ linters:
73
73
- third_party$
74
74
- builtin$
75
75
- examples$
76
+
rules:
77
+
- linters:
78
+
- kubeapilinter
79
+
# This regex must always be updated in tandem with the regex in .golangci.go-validated.yaml that prevents `optionalfields` from being applied to the files in the path.
0 commit comments