Skip to content

New Linter: Generic conflictingmarkers #97

@yongruilin

Description

@yongruilin

Description

Create a new, configurable linter named conflictingmarkers to detect and report when mutually exclusive markers are used on the same field. This prevents common configuration errors and unexpected behavior.

Problem

There is currently no generalized way to prevent the use of conflicting markers. For example, a field cannot have both a default value and be required. This linter will provide a flexible solution to this and similar issues.

Requirements

  1. Generic Conflict Detection: The linter should identify fields that have markers from two conflicting sets.

  2. Built-in Rules: It must include checks for the following initial conflicts:

    • optional vs. required:
      • Set A: optional, +kubebuilder:validation:Optional
      • Set B: required, +kubebuilder:validation:Required
    • default vs. required:
      • Set A: default, +kubebuilder:default
      • Set B: required, +kubebuilder:validation:Required
  3. Configurability: Allow users to define their own custom sets of conflicting markers in the linter's configuration.

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions