forked from Kong/kubernetes-ingress-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yaml
120 lines (119 loc) · 2.41 KB
/
.golangci.yaml
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
116
117
118
119
120
run:
timeout: 5m
skip-dirs:
- pkg/clientset
- pkg/apis
- config
build-tags:
- integration_tests
- e2e_tests
- conformance_tests
- istio_tests
- envtest
linters:
enable:
- asasalint
- asciicheck
- bodyclose
- contextcheck
- depguard
- dogsled
- durationcheck
- errcheck
- errorlint
- exhaustive
- exportloopref
- gci
- godot
- gofmt
- gofumpt
- goimports
- gomodguard
- gosec
- gosimple
- govet
- importas
- ineffassign
- loggercheck
- megacheck
- misspell
- nakedret
- nilerr
- nolintlint
- predeclared
- revive
- staticcheck
- tenv
- typecheck
- unconvert
- unparam
- unused
- wastedassign
linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/kong/kubernetes-ingress-controller/v2)
importas:
no-unaliased: true
alias:
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/api/apps/v1
alias: appsv1
- pkg: k8s.io/api/admission/v1
alias: admissionv1
- pkg: k8s.io/api/networking/v1
alias: netv1
- pkg: k8s.io/api/networking/v1beta1
alias: netv1beta1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: sigs.k8s.io/gateway-api/apis/(v[\w\d]+)
alias: gateway${1}
gomodguard:
blocked:
modules:
- github.com/ghodss/yaml:
recommendations:
- sigs.k8s.io/yaml
- gopkg.in/yaml.v2:
recommendations:
- sigs.k8s.io/yaml
- gopkg.in/yaml.v3:
recommendations:
- sigs.k8s.io/yaml
- github.com/pkg/errors:
recommendations:
- fmt
- errors
depguard:
list-type: denylist
include-go-root: false
packages-with-error-message:
- k8s.io/utils/pointer: "Use github.com/samber/lo ToPtr instead"
- golang.org/x/net/context: "use regular context instead"
tenv:
all: true
loggercheck:
kitlog: false
klog: true
logr: true
zap: false
issues:
fix: true
max-same-issues: 0
exclude-rules:
# Ignore insecure TLS in tests and hardcoded credentials
- path: _test\.go
linters:
- gosec
text: "TLS InsecureSkipVerify set true|Potential hardcoded credentials"
# It's fine to use variable urls in tests.
- linters:
- gosec
text: "Potential HTTP request made with variable url"
path: test\.go