forked from kumahq/kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
143 lines (139 loc) · 5.05 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
linters:
enable:
- bodyclose
- contextcheck
- errcheck
- gci
- ginkgolinter
- gocritic
- gofumpt
- gomodguard
- gosimple
- govet
- gosec
- importas
- ineffassign
- misspell
- nonamedreturns
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- nosprintfhostport
- loggercheck
run:
skip-files:
- app/kumactl/pkg/k8s/kubectl_proxy.go # excluded to keep as close to original file from K8S repository
- pkg/xds/server/server.go # excluded to keep as close to original file from Envoy repository
- pkg/xds/server/server_test.go # excluded to keep as close to original file from Envoy repository
modules-download-mode: readonly
skip-dirs-use-default: false # The default skip omits "builtin" directories, which we have.
skip-dirs:
- (^|/)vendored($|/)
timeout: 30m
linters-settings:
gocritic:
disabled-checks:
- singleCaseSwitch
gci:
sections:
- standard
- default
- prefix(github.com/kumahq/kuma)
custom-order: true
importas:
alias:
- pkg: github.com/kumahq/kuma/pkg/core/resources/apis/mesh
alias: core_mesh
- pkg: github.com/kumahq/kuma/api/mesh/v1alpha1
alias: mesh_proto
- pkg: github.com/kumahq/kuma/api/system/v1alpha1
alias: system_proto
- pkg: github.com/kumahq/kuma/pkg/util/proto
alias: util_proto
- pkg: github.com/kumahq/kuma/pkg/util/rsa
alias: util_rsa
- pkg: github.com/kumahq/kuma/pkg/cmd
alias: kuma_cmd
- pkg: github.com/kumahq/kuma/pkg/plugins/bootstrap/k8s
alias: bootstrap_k8s
- pkg: github.com/kumahq/kuma/pkg/config/core
alias: config_core
- pkg: github.com/kumahq/kuma/pkg/core/resources/model
alias: core_model
- pkg: github.com/kumahq/kuma/api/common/v1alpha1
alias: common_api
- pkg: github.com/kumahq/kuma/api/openapi/types
alias: api_types
gomodguard:
blocked:
modules:
- github.com/go-errors/errors:
recommendations:
- github.com/pkg/errors
- 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
- io/ioutil:
recommandations:
- io
- os
misspell:
locale: US
ignore-words:
- cancelled # US English should be "canceled", but this is in the Retry API, so we can't change it.
nonamedreturns:
report-error-in-defer: false
issues:
fix: true
exclude-rules:
- linters:
- staticcheck
text: 'SA1019: "github.com/golang/protobuf' # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
- linters:
- staticcheck
text: "SA1019: proto.MessageName is deprecated" # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
- linters:
- staticcheck
text: "SA1019: proto.MessageType is deprecated" # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
- linters:
- staticcheck
text: "SA1019: l.UseOriginalDst is deprecated: Do not use." # TODO What is the up-to-date alternative ?
- linters:
- staticcheck
text: "IsIngress is deprecated: use ZoneIngress" # It's deprecated but Kuma still needs to support it for backwards compatibility.
- linters:
- gocritic
text: "appendAssign: append result not assigned to the same slice" # None of the instances of this in Kuma were bugs.
- linters:
- staticcheck
text: "SA1019: package sigs.k8s.io/controller-runtime/pkg/client/fake is deprecated" # https://github.com/kumahq/kuma/issues/2460
- linters:
- staticcheck
text: "SA1019: l.ReusePort is deprecated"
- linters: # AdminPort is deprecated, but it's used to support backwards compatibility
- staticcheck
text: "SA1019: cfg.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
- linters: # AdminPort is deprecated, but it's used to support backwards compatibility
- staticcheck
text: "SA1019: kumaCPConfig.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
- linters: # AdminPort is deprecated, but it's used to support backwards compatibility
- staticcheck
text: "SA1019: c.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
- linters:
- staticcheck
text: "SA1019: .* for new policies use pkg/plugins/policies/xds/cluster.go"
- linters:
- staticcheck
text: "SA1019: .* is deprecated: use MinResyncInterval instead"
- linters:
- staticcheck
text: "SA1019: .* is deprecated: use FullResyncInterval instead"