diff --git a/.golangci-kal.yml b/.golangci-kal.yml index b925f2a960e9..3aa0b412e2a9 100644 --- a/.golangci-kal.yml +++ b/.golangci-kal.yml @@ -18,6 +18,7 @@ linters-settings: enable: - "conditions" # Ensure conditions have the correct json tags and markers. - "integers" # Ensure only int32 and int64 are used for integers. + - "jsontags" # Ensure every field has a json tag. - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. - "nobools" # Bools do not evolve over time, should use enums instead. - "nofloats" # Ensure floats are not used. @@ -31,7 +32,6 @@ linters-settings: # Linters below this line are disabled, pending conversation on how and when to enable them. # - "commentstart" # Ensure comments start with the serialized version of the field name. - # - "jsontags" # Ensure every field has a json tag. # - "optionalorrequired" # Every field should be marked as `+optional` or `+required`. disable: - "*" # We will manually enable new linters after understanding the impact. Disable all by default. @@ -82,3 +82,8 @@ issues: text: "nobools" linters: - kal + # We follow the current CustomResourceDefinition field's json tag pattern. + - path: "api/v1beta1/*" + text: "field (XPreserveUnknownFields|XPreserveUnknownFields|XValidations|XMetadata|XIntOrString) json tag does not match pattern" + linters: + - kal diff --git a/hack/tools/.custom-gcl.yaml b/hack/tools/.custom-gcl.yaml index 74b654e21cca..a1ec6984487b 100644 --- a/hack/tools/.custom-gcl.yaml +++ b/hack/tools/.custom-gcl.yaml @@ -3,4 +3,4 @@ name: golangci-lint-kal-v1.63.4 destination: ./bin plugins: - module: 'github.com/JoelSpeed/kal' - version: v0.0.0-20250208110507-b94e5ede1177 + version: v0.0.0-20250304142607-36e90ff72198