mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 08:55:55 -04:00
Forbid usage of omitzero for fields marked optional
This commit is contained in:
parent
f8b277b2b8
commit
47d830f3cd
3 changed files with 24 additions and 24 deletions
|
|
@ -424,14 +424,14 @@ linters:
|
|||
# jsonTagRegex: "^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*$" # The default regex is appropriate for our use case.
|
||||
# nomaps:
|
||||
# policy: AllowStringToStringMaps # Determines how the linter should handle maps of basic types. Maps of objects are always disallowed.
|
||||
# optionalFields:
|
||||
# pointers:
|
||||
# preference: Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
|
||||
# policy: SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`.
|
||||
# omitempty:
|
||||
# policy: SuggestFix | Warn | Ignore # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
|
||||
# omitzero:
|
||||
# policy: SuggestFix | Warn | Forbid # The policy for omitzero in optional fields. Defaults to `SuggestFix`.
|
||||
optionalFields:
|
||||
pointers:
|
||||
preference: Always # Whether to always require pointers, or only when required. Defaults to `Always`.
|
||||
policy: SuggestFix # The policy for pointers in optional fields. Defaults to `SuggestFix`.
|
||||
omitempty:
|
||||
policy: SuggestFix # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
|
||||
omitzero:
|
||||
policy: Forbid # The policy for omitzero in optional fields. Defaults to `SuggestFix`.
|
||||
# optionalOrRequired:
|
||||
# preferredOptionalMarker: optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`.
|
||||
# preferredRequiredMarker: required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`.
|
||||
|
|
|
|||
|
|
@ -437,14 +437,14 @@ linters:
|
|||
# jsonTagRegex: "^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*$" # The default regex is appropriate for our use case.
|
||||
# nomaps:
|
||||
# policy: AllowStringToStringMaps # Determines how the linter should handle maps of basic types. Maps of objects are always disallowed.
|
||||
# optionalFields:
|
||||
# pointers:
|
||||
# preference: Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
|
||||
# policy: SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`.
|
||||
# omitempty:
|
||||
# policy: SuggestFix | Warn | Ignore # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
|
||||
# omitzero:
|
||||
# policy: SuggestFix | Warn | Forbid # The policy for omitzero in optional fields. Defaults to `SuggestFix`.
|
||||
optionalFields:
|
||||
pointers:
|
||||
preference: Always # Whether to always require pointers, or only when required. Defaults to `Always`.
|
||||
policy: SuggestFix # The policy for pointers in optional fields. Defaults to `SuggestFix`.
|
||||
omitempty:
|
||||
policy: SuggestFix # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
|
||||
omitzero:
|
||||
policy: Forbid # The policy for omitzero in optional fields. Defaults to `SuggestFix`.
|
||||
# optionalOrRequired:
|
||||
# preferredOptionalMarker: optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`.
|
||||
# preferredRequiredMarker: required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`.
|
||||
|
|
|
|||
|
|
@ -51,14 +51,14 @@ lintersConfig:
|
|||
# jsonTagRegex: "^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*$" # The default regex is appropriate for our use case.
|
||||
# nomaps:
|
||||
# policy: AllowStringToStringMaps # Determines how the linter should handle maps of basic types. Maps of objects are always disallowed.
|
||||
# optionalFields:
|
||||
# pointers:
|
||||
# preference: Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
|
||||
# policy: SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`.
|
||||
# omitempty:
|
||||
# policy: SuggestFix | Warn | Ignore # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
|
||||
# omitzero:
|
||||
# policy: SuggestFix | Warn | Forbid # The policy for omitzero in optional fields. Defaults to `SuggestFix`.
|
||||
optionalFields:
|
||||
pointers:
|
||||
preference: Always # Whether to always require pointers, or only when required. Defaults to `Always`.
|
||||
policy: SuggestFix # The policy for pointers in optional fields. Defaults to `SuggestFix`.
|
||||
omitempty:
|
||||
policy: SuggestFix # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
|
||||
omitzero:
|
||||
policy: Forbid # The policy for omitzero in optional fields. Defaults to `SuggestFix`.
|
||||
# optionalOrRequired:
|
||||
# preferredOptionalMarker: optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`.
|
||||
# preferredRequiredMarker: required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue