Skip to content

Commit 26d562e

Browse files
authored
🌱 enable maxlength linter (#11906)
* enable maxlength linter Signed-off-by: sivchari <[email protected]> * add exclude section for maxlength Signed-off-by: sivchari <[email protected]> --------- Signed-off-by: sivchari <[email protected]>
1 parent 3d41090 commit 26d562e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.golangci-kal.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ linters-settings:
2020
- "integers" # Ensure only int32 and int64 are used for integers.
2121
- "statussubresource" # All root objects that have a `status` field should have a status subresource.
2222
- "nofloats" # Ensure floats are not used.
23+
- "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items.
2324

2425
# Per discussion in July 2024, we are keeping phase fields for now.
2526
# See https://github.com/kubernetes-sigs/cluster-api/pull/10897#discussion_r1685929508
@@ -29,7 +30,6 @@ linters-settings:
2930
# Linters below this line are disabled, pending conversation on how and when to enable them.
3031
# - "commentstart" # Ensure comments start with the serialized version of the field name.
3132
# - "jsontags" # Ensure every field has a json tag.
32-
# - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items.
3333
# - "nobools" # Bools do not evolve over time, should use enums instead.
3434
# - "optionalorrequired" # Every field should be marked as `+optional` or `+required`.
3535
# - "requiredfields" # Required fields should not be pointers, and should not have `omitempty`.
@@ -59,7 +59,7 @@ issues:
5959
max-issues-per-linter: 0
6060
exclude-rules:
6161
# KAL should only run on API folders.
62-
- path-except: "api/*"
62+
- path-except: "api//*"
6363
linters:
6464
- kal
6565
- path: "api/v1beta1/*|api/v1alpha1/*"
@@ -74,3 +74,7 @@ issues:
7474
text: "field Prefix should not use an int, int8 or int16. Use int32 or int64 depending on bounding requirements"
7575
linters:
7676
- kal
77+
- path: "api/v1alpha1/*|api/v1alpha3/*|api/v1beta1/*"
78+
text: "maxlength"
79+
linters:
80+
- kal

0 commit comments

Comments
 (0)