-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy path.golangci.yml
115 lines (115 loc) · 3.28 KB
/
.golangci.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: "2"
run:
build-tags:
- e2e
linters:
default: none
enable:
- asciicheck
- bidichk
- bodyclose
- depguard
- durationcheck
- errcheck
- errname
- errorlint
- goconst
- gocyclo
- godot
- govet
- importas
- ineffassign
- misspell
- nakedret
- noctx
- nolintlint
- nosprintfhostport
- predeclared
- promlinter
- staticcheck
- unconvert
- unused
- wastedassign
- whitespace
settings:
depguard:
rules:
main:
deny:
- pkg: io/ioutil
desc: https://go.dev/doc/go1.16#ioutil
- pkg: github.com/ghodss/yaml
desc: use sigs.k8s.io/yaml instead
govet:
enable:
- nilness # find tautologies / impossible conditions
importas:
alias:
# Machine Controller
- pkg: k8c.io/machine-controller/sdk/apis/(\w+)/(v[\w\d]+)
alias: $1$2
# Kubernetes
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
alias: apiextensionsv1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/apimachinery/pkg/util/errors
alias: kerrors
# Controller Runtime
- pkg: sigs.k8s.io/controller-runtime/pkg/client
alias: ctrlruntimeclient
# Other Kube APIs
- pkg: go.anx.io/go-anxcloud/pkg/apis/(\w+)/(v[\w\d]+)
alias: anx$1$2
- pkg: github.com/tinkerbell/tink/api/(v[\w\d]+)
alias: tink$1
- pkg: kubevirt.io/api/(\w+)/(v[\w\d]+)
alias: kubevirt$1$2
- pkg: kubevirt.io/containerized-data-importer-api/pkg/apis/(\w+)/(v[\w\d]+)
alias: cdi$1$2
no-unaliased: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- path: (.+)\.go$
text: func Convert_MachinesV1alpha1Machine_To_ClusterV1alpha1Machine should be ConvertMachinesV1alpha1MachineToClusterV1alpha1Machine
- path: (.+)\.go$
text: func Convert_MachineDeployment_ProviderConfig_To_ProviderSpec should be ConvertMachineDeploymentProviderConfigToProviderSpec
- path: (.+)\.go$
text: func Convert_MachineSet_ProviderConfig_To_ProviderSpec should be ConvertMachineSetProviderConfigToProviderSpec
- path: (.+)\.go$
text: func Convert_Machine_ProviderConfig_To_ProviderSpec should be ConvertMachineProviderConfigToProviderSpec
- path: (.+)\.go$
text: cyclomatic complexity [0-9]+ of func `\(\*provider\)\.Create` is high
- path: (.+)\.go$
text: cyclomatic complexity [0-9]+ of func `\(\*provider\)\.Validate` is high
- path: (.+)\.go$
text: cyclomatic complexity [0-9]+ of func `\(\*provider\)\.getConfig` is high
- path: (.+)\.go$
text: 'SA1019: s.server.IPv6 is deprecated'
paths:
- apis/machines
- third_party$
- builtin$
- examples$
issues:
max-same-issues: 0
formatters:
enable:
- gofmt
exclusions:
generated: lax
paths:
- apis/machines
- third_party$
- builtin$
- examples$