-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy path.golangci-kal.yml
More file actions
83 lines (83 loc) · 2.29 KB
/
.golangci-kal.yml
File metadata and controls
83 lines (83 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
version: "2"
run:
go: "1.25"
allow-parallel-runners: true
linters:
default: none
enable:
- kubeapilinter
settings:
custom:
kubeapilinter:
type: module
description: KAL is the Kube-API-Linter and lints Kube like APIs based on API conventions and best practices.
settings:
linters:
enable:
- "commentstart"
- "conditions"
- "conflictingmarkers"
- "duplicatemarkers"
- "integers"
- "jsontags"
- "nobools"
- "nodurations"
- "nofloats"
- "nomaps"
- "nonullable"
- "notimestamp"
- "optionalfields"
- "optionalorrequired"
- "requiredfields"
- "ssatags"
- "statusoptional"
- "statussubresource"
- "uniquemarkers"
disable:
- "*"
lintersConfig:
conflictingmarkers:
conflicts:
- name: "default_vs_required"
sets:
- ["default", "kubebuilder:default"]
- ["required", "kubebuilder:validation:Required", "k8s:required"]
description: "A field with a default value cannot be required"
forbiddenmarkers:
markers:
- identifier: "kubebuilder:default"
- identifier: "default"
conditions:
isFirstField: Warn
usePatchStrategy: Forbid
useProtobuf: Forbid
optionalfields:
pointers:
preference: WhenRequired
policy: SuggestFix
omitempty:
policy: SuggestFix
exclusions:
generated: strict
paths:
- zz_generated.*\.go$
- ".*_test.go"
rules:
- path-except: "^api//*"
linters:
- kubeapilinter
- path: "api/v1alpha1"
linters:
- kubeapilinter
- path: "api/v1alpha2"
text: "nobools"
linters:
- kubeapilinter
- path: "api/v1alpha2"
text: "does not need to be a pointer"
linters:
- kubeapilinter
issues:
max-same-issues: 0
max-issues-per-linter: 0