Skip to content

Commit 06e86de

Browse files
committed
enable jsontags rule
Signed-off-by: sivchari <[email protected]>
1 parent 99b56d7 commit 06e86de

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.golangci-kal.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ linters-settings:
1818
enable:
1919
- "conditions" # Ensure conditions have the correct json tags and markers.
2020
- "integers" # Ensure only int32 and int64 are used for integers.
21+
- "jsontags" # Ensure every field has a json tag.
2122
- "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items.
2223
- "nobools" # Bools do not evolve over time, should use enums instead.
2324
- "nofloats" # Ensure floats are not used.
@@ -31,7 +32,6 @@ linters-settings:
3132

3233
# Linters below this line are disabled, pending conversation on how and when to enable them.
3334
# - "commentstart" # Ensure comments start with the serialized version of the field name.
34-
# - "jsontags" # Ensure every field has a json tag.
3535
# - "optionalorrequired" # Every field should be marked as `+optional` or `+required`.
3636
disable:
3737
- "*" # We will manually enable new linters after understanding the impact. Disable all by default.
@@ -82,3 +82,8 @@ issues:
8282
text: "nobools"
8383
linters:
8484
- kal
85+
# We follow the current CustomResourceDefinition field's json tag pattern.
86+
- path: "api/v1beta1/*"
87+
text: "field (XPreserveUnknownFields|XPreserveUnknownFields|XValidations|XMetadata|XIntOrString) json tag does not match pattern"
88+
linters:
89+
- kal

hack/tools/.custom-gcl.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: golangci-lint-kal-v1.63.4
33
destination: ./bin
44
plugins:
55
- module: 'github.com/JoelSpeed/kal'
6-
version: v0.0.0-20250208110507-b94e5ede1177
6+
version: v0.0.0-20250304142607-36e90ff72198

0 commit comments

Comments
 (0)