forked from kubernetes-sigs/gateway-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci-kal.yml
More file actions
71 lines (71 loc) · 3.65 KB
/
.golangci-kal.yml
File metadata and controls
71 lines (71 loc) · 3.65 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
version: "2"
linters:
default: none
enable:
- kubeapilinter
settings:
custom:
kubeapilinter:
type: module
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
settings:
linters:
enable:
- "defaultorrequired" # defaultorrequired analyzer checks that fields marked as required do not have default values applied.
- "defaults" # defaults is a linter to check that fields with default markers are configured correctly.
- "duplicatemarkers" # Ensures there are no exact duplicate markers. for types and fields.
- "jsontags" # Ensures every field has a json tag.
- "nodurations" # Ensures that fields in the API types do not contain `Duration` type ether from the `time` package or the `k8s.io/apimachinery/pkg/apis/meta/v1` package
- "nofloats" # Ensures floats are not used.
- "nomaps" # Ensures maps are not used.
- "nonullable" # Ensures that types and fields do not have the `nullable` marker
- "nophase" # Phase fields are discouraged by the Kube API conventions, use conditions instead.
- "noreferences" # Ensures that field names use 'Ref'/'Refs' instead of 'Reference'/'References'.
- "notimestamp" # Ensures that structs do not contain a TimeStamp field.
- "optionalorrequired" # Every field should be marked as `+optional` or `+required`.
- "ssatags" # Ensure proper Server-Side Apply (SSA) tags on array fields.
- "statussubresource" # All root objects that have a `status` field should have a status subresource.
- "uniquemarkers" # Ensure that types and fields do not contain more than a single definition of a marker that should only be present once.
disable:
# Enforces that an array of struct has at least one required fields. Disabled because BackendRef and others are already using it
# - "arrayofstructs"
# Disabled because it is very verbose...
# - "commentstart"
# Disabled because it changes how conditions are merged and we may need to check impact on existing installations
# - "conditions"
# Enforces usage of int32 or int64. Disabled because GA APIs are already using it
# - "integers"
# Disabled because some GA fields do not have a maxlength and this may break
# - "maxlength"
# Disabled because some GA fields do not have a minlength and this may break.
# Must be revisited with VAP
# - "minlength"
# Ensure no booleans are used - controversial
# - "nobools"
# Ensure that non pointer structs with no required fields are marked as optional. Breaking change
# - "nonpointerstructs"
# Ensure that optional fields are pointers - controversial
# - "optionalfields"
# Ensures that required fields has omitempty tags
# - "requiredfields"
# Ensures that all first-level children fields within a status struct are marked as optional.
# Disabled, breaking change for RouteParentStatus
# - "statusoptional"
- "*"
lintersConfig:
defaults:
preferredDefaultMarker: "kubebuilder:default"
exclusions:
generated: strict
paths:
- conformance/
- wasm/
paths-except:
- apis/
- apisx/
issues:
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m
tests: false