Skip to content

Commit ee601cf

Browse files
authored
Merge pull request #12569 from sbueringer/pr-add-conflict-linter
✨ Add conflicting markers linter
2 parents 5cfc702 + 3d53081 commit ee601cf

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.golangci-kal.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ linters:
1616
enable:
1717
- "commentstart" # Ensure comments start with the serialized version of the field name.
1818
- "conditions" # Ensure conditions have the correct json tags and markers.
19+
- "conflictingmarkers"
1920
- "duplicatemarkers" # Ensure there are no exact duplicate markers. for types and fields.
2021
- "integers" # Ensure only int32 and int64 are used for integers.
2122
- "jsontags" # Ensure every field has a json tag.
@@ -42,6 +43,13 @@ linters:
4243
disable:
4344
- "*" # We will manually enable new linters after understanding the impact. Disable all by default.
4445
lintersConfig:
46+
conflictingmarkers:
47+
conflicts:
48+
- name: "default_vs_required"
49+
sets:
50+
- ["default", "kubebuilder:default"]
51+
- ["required", "kubebuilder:validation:Required", "k8s:required"]
52+
description: "A field with a default value cannot be required"
4553
conditions:
4654
isFirstField: Warn # Require conditions to be the first field in the status struct.
4755
usePatchStrategy: Forbid # Forbid patchStrategy markers on the Conditions field.

hack/tools/.custom-gcl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: golangci-lint-kube-api-linter
33
destination: ./bin
44
plugins:
55
- module: 'sigs.k8s.io/kube-api-linter'
6-
version: v0.0.0-20250723124831-1b29e82a0f55
6+
version: v0.0.0-20250729132427-47bfeef6cd38

0 commit comments

Comments
 (0)