|
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + go: "1.24" |
| 4 | + allow-parallel-runners: true |
| 5 | +linters: |
| 6 | + default: none |
| 7 | + enable: |
| 8 | + - kubeapilinter # linter for Kube API conventions |
| 9 | + settings: |
| 10 | + custom: |
| 11 | + kubeapilinter: |
| 12 | + type: module |
| 13 | + description: KAL is the Kube-API-Linter and lints Kube like APIs based on API conventions and best practices. |
| 14 | + settings: |
| 15 | + linters: |
| 16 | + enable: |
| 17 | + #- "commentstart" # Ensure comments start with the serialized version of the field name. |
| 18 | + #- "conditions" # Ensure conditions have the correct json tags and markers. |
| 19 | + #- "conflictingmarkers" |
| 20 | + #- "duplicatemarkers" # Ensure there are no exact duplicate markers. for types and fields. |
| 21 | + #- "integers" # Ensure only int32 and int64 are used for integers. |
| 22 | + #- "jsontags" # Ensure every field has a json tag. |
| 23 | + #- "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. |
| 24 | + #- "nobools" # Bools do not evolve over time, should use enums instead. |
| 25 | + #- "nodurations" # Prevents usage of `Duration` types. |
| 26 | + #- "nofloats" # Ensure floats are not used. |
| 27 | + #- "nomaps" # Ensure maps are not used. |
| 28 | + #- "nonullable" # Ensure that types and fields do not have the nullable marker. |
| 29 | + #- "optionalorrequired" # Every field should be marked as `+optional` or `+required`. |
| 30 | + #- "requiredfields" # Required fields should not be pointers, and should not have `omitempty`. |
| 31 | + #- "ssatags" # Ensure array fields have the appropriate listType markers |
| 32 | + #- "statusoptional" # Ensure all first children within status should be optional. |
| 33 | + #- "statussubresource" # All root objects that have a `status` field should have a status subresource. |
| 34 | + #- "uniquemarkers" # Ensure that types and fields do not contain more than a single definition of a marker that should only be present once. |
| 35 | + disable: |
| 36 | + - "*" # Disable all by default. |
| 37 | + lintersConfig: |
| 38 | + |
| 39 | + |
| 40 | + exclusions: |
| 41 | + build-tags: |
| 42 | + - ignore_autogenerated |
| 43 | + paths: |
| 44 | + - ".*_test.go" # Exclude test files. |
| 45 | + rules: |
| 46 | + ## KAL should only run on APIS folders. |
| 47 | + - path-except: "apis//*" |
| 48 | + linters: |
| 49 | + - kubeapilinter |
| 50 | + |
| 51 | +issues: |
| 52 | + max-same-issues: 0 |
| 53 | + max-issues-per-linter: 0 |
0 commit comments