mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-02-03 20:40:26 -05:00
Merge pull request #134830 from MatteoFari/matteofari/enable-jsontags-linter
enabled jsontags for kal and added exceptions because of non modifiable :Port
This commit is contained in:
commit
f4938574d4
4 changed files with 15 additions and 3 deletions
|
|
@ -219,6 +219,10 @@ linters:
|
|||
# OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed.
|
||||
- text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required"
|
||||
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
|
||||
|
||||
# jsontags: 'Port' must be capitalized for backward compatibility
|
||||
- text: 'jsontags: field DaemonEndpoint.Port json tag does not match'
|
||||
path: "staging/src/k8s.io/api/core/v1/types.go"
|
||||
|
||||
- linters:
|
||||
- forbidigo
|
||||
|
|
@ -396,7 +400,7 @@ linters:
|
|||
- "conditions" # Ensure conditions have the correct json tags and markers.
|
||||
- "conflictingmarkers" # Detect mutually exclusive markers on the same field.
|
||||
- "integers" # Ensure only int32 and int64 are used for integers.
|
||||
# - "jsontags" # Ensure every field has a json tag.
|
||||
- "jsontags" # Ensure every field has a json tag.
|
||||
# - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. ONLY for CRDs until declarative markers exist in core types.
|
||||
# - "nobools" # Bools do not evolve over time, should use enums instead.
|
||||
# - "nofloats" # Ensure floats are not used.
|
||||
|
|
|
|||
|
|
@ -230,6 +230,10 @@ linters:
|
|||
# OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed.
|
||||
- text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required"
|
||||
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
|
||||
|
||||
# jsontags: 'Port' must be capitalized for backward compatibility
|
||||
- text: 'jsontags: field DaemonEndpoint.Port json tag does not match'
|
||||
path: "staging/src/k8s.io/api/core/v1/types.go"
|
||||
|
||||
- linters:
|
||||
- forbidigo
|
||||
|
|
@ -405,7 +409,7 @@ linters:
|
|||
- "conditions" # Ensure conditions have the correct json tags and markers.
|
||||
- "conflictingmarkers" # Detect mutually exclusive markers on the same field.
|
||||
- "integers" # Ensure only int32 and int64 are used for integers.
|
||||
# - "jsontags" # Ensure every field has a json tag.
|
||||
- "jsontags" # Ensure every field has a json tag.
|
||||
# - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. ONLY for CRDs until declarative markers exist in core types.
|
||||
# - "nobools" # Bools do not evolve over time, should use enums instead.
|
||||
# - "nofloats" # Ensure floats are not used.
|
||||
|
|
|
|||
|
|
@ -95,3 +95,7 @@
|
|||
# OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed.
|
||||
- text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required"
|
||||
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
|
||||
|
||||
# jsontags: 'Port' must be capitalized for backward compatibility
|
||||
- text: 'jsontags: field DaemonEndpoint.Port json tag does not match'
|
||||
path: "staging/src/k8s.io/api/core/v1/types.go"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ linters:
|
|||
- "conditions" # Ensure conditions have the correct json tags and markers.
|
||||
- "conflictingmarkers" # Detect mutually exclusive markers on the same field.
|
||||
- "integers" # Ensure only int32 and int64 are used for integers.
|
||||
# - "jsontags" # Ensure every field has a json tag.
|
||||
- "jsontags" # Ensure every field has a json tag.
|
||||
# - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. ONLY for CRDs until declarative markers exist in core types.
|
||||
# - "nobools" # Bools do not evolve over time, should use enums instead.
|
||||
# - "nofloats" # Ensure floats are not used.
|
||||
|
|
|
|||
Loading…
Reference in a new issue