Skip to content

Commit 7dcd23a

Browse files
committed
Enable ssatags KAL linter
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent e1b4e4f commit 7dcd23a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.golangci-kal.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ linters:
2727
# having the `omitempty` value in their `json` tag where appropriate.
2828
- "optionalorrequired" # Every field should be marked as `+optional` or `+required`.
2929
- "requiredfields" # Required fields should not be pointers, and should not have `omitempty`.
30+
- "ssatags" # Ensure array fields have the appropriate listType markers
3031
- "statusoptional" # Ensure all first children within status should be optional.
3132
- "statussubresource" # All root objects that have a `status` field should have a status subresource.
3233
- "uniquemarkers" # Ensure that types and fields do not contain more than a single definition of a marker that should only be present once.
@@ -44,19 +45,21 @@ linters:
4445
isFirstField: Warn # Require conditions to be the first field in the status struct.
4546
usePatchStrategy: Forbid # Require conditions to be the first field in the status struct.
4647
useProtobuf: Forbid # We don't use protobuf, so protobuf tags are not required.
47-
optionalFields:
48+
optionalfields:
4849
pointers:
4950
preference: WhenRequired # Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
5051
policy: SuggestFix # SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`.
5152
omitempty:
5253
policy: SuggestFix # SuggestFix | Warn | Ignore # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
53-
# jsonTags:
54+
# jsontags:
5455
# jsonTagRegex: "^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*$" # The default regex is appropriate for our use case.
55-
# optionalOrRequired:
56+
# optionalorrequired:
5657
# preferredOptionalMarker: optional | kubebuilder:validation:Optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`.
5758
# preferredRequiredMarker: required | kubebuilder:validation:Required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`.
58-
# requiredFields:
59+
# requiredfields:
5960
# pointerPolicy: Warn | SuggestFix # Defaults to `SuggestFix`. We want our required fields to not be pointers.
61+
# ssatags:
62+
# listTypeSetUsage: Warn | Ignore # The policy for listType=set usage on object arrays. Defaults to `Warn`.
6063

6164
exclusions:
6265
generated: strict

hack/tools/.custom-gcl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: golangci-lint-kube-api-linter
33
destination: ./bin
44
plugins:
55
- module: 'sigs.k8s.io/kube-api-linter'
6-
version: v0.0.0-20250626111229-e719da12d840
6+
version: v0.0.0-20250709144528-029010b5da35

0 commit comments

Comments
 (0)