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
Copy file name to clipboardExpand all lines: .golangci-kal.yml
+31-4Lines changed: 31 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,8 @@ linters:
22
22
- "maxlength"# Ensure all strings and arrays have maximum lengths/maximum items.
23
23
- "nobools"# Bools do not evolve over time, should use enums instead.
24
24
- "nofloats"# Ensure floats are not used.
25
-
- "nomaps"# Ensure maps are not used.
26
-
# "nophase" # Ensure phases are not used, as they are not extensible.
25
+
#- "nomaps" # Ensure maps are not used.
26
+
#- "nophase" # Ensure phases are not used, as they are not extensible.
27
27
- "optionalfields"# Ensure that all fields marked as optional adhere to being pointers and
28
28
# having the `omitempty` value in their `json` tag where appropriate.
29
29
- "optionalorrequired"# Every field should be marked as `+optional` or `+required`.
@@ -40,8 +40,8 @@ linters:
40
40
optionalfields:
41
41
pointers:
42
42
preference: WhenRequired # Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
43
-
#jsontags:
44
-
#jsonTagRegex: "^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*$" # The default regex is appropriate for our use case.
43
+
jsontags:
44
+
jsonTagRegex: "^[a-z][a-z0-9-]*(?:[A-Z][a-z0-9]*)*$"# The default regex is appropriate for our use case.
45
45
optionalorrequired:
46
46
preferredOptionalMarker: kubebuilder:validation:Optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`.
47
47
preferredRequiredMarker: kubebuilder:validation:Required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`.
@@ -55,6 +55,33 @@ linters:
55
55
- external/
56
56
# Ignore test files.
57
57
- '.+_test\.go$'
58
+
# Ignore aggregate types.
59
+
- 'aggregate_types\.go$'
60
+
rules:
61
+
- path: ".*"
62
+
text: "optionalorrequired: embedded field must be marked as kubebuilder:validation:Optional or kubebuilder:validation:Required"
63
+
linters:
64
+
- kubeapilinter
65
+
66
+
# kube-api-linter does not handle formats correctly yet.
67
+
- path: '/addon_types\.go$'
68
+
text: "maxlength: field (Start|End) must have a maximum length, add kubebuilder:validation:MaxLength marker"
69
+
linters:
70
+
- kubeapilinter
71
+
- path: '/common_types\.go$'
72
+
text: "maxlength: field Address must have a maximum length, add kubebuilder:validation:MaxLength marker"
73
+
linters:
74
+
- kubeapilinter
75
+
76
+
# kube-api-linter does not handle patterns correctly yet.
77
+
- path: '/aws_(clusterconfig|node)_types\.go$'
78
+
text: "maxlength: field (ID|IAMInstanceProfile|InstanceType|Org) must have a maximum length, add kubebuilder:validation:MaxLength marker"
79
+
linters:
80
+
- kubeapilinter
81
+
- path: '/(nutanix_)?(clusterconfig)_types\.go$'
82
+
text: "maxlength: field (URL|Tag) must have a maximum length, add kubebuilder:validation:MaxLength marker"
AllowExpansionbool`json:"allowExpansion,omitempty"`//nolint:kubeapilinter,lll // Leave as bool for backward compatibility and this comment makes it a long line.
281
288
}
282
289
283
290
typeCSICredentialsstruct {
@@ -302,8 +309,9 @@ type CCM struct {
302
309
303
310
// Addon strategy used to deploy the CCM to the workload cluster.
0 commit comments