kuma
/
.golangci.yml
143 строки · 5.0 Кб
1linters:
2enable:
3- bodyclose
4- contextcheck
5- errcheck
6- gci
7- ginkgolinter
8- gocritic
9- gofumpt
10- gomodguard
11- gosimple
12- govet
13- gosec
14- importas
15- ineffassign
16- misspell
17- nonamedreturns
18- staticcheck
19- typecheck
20- unconvert
21- unparam
22- unused
23- whitespace
24- nosprintfhostport
25- loggercheck
26
27run:
28skip-files:
29- app/kumactl/pkg/k8s/kubectl_proxy.go # excluded to keep as close to original file from K8S repository
30- pkg/xds/server/server.go # excluded to keep as close to original file from Envoy repository
31- pkg/xds/server/server_test.go # excluded to keep as close to original file from Envoy repository
32modules-download-mode: readonly
33skip-dirs-use-default: false # The default skip omits "builtin" directories, which we have.
34skip-dirs:
35- (^|/)vendored($|/)
36timeout: 30m
37
38linters-settings:
39gocritic:
40disabled-checks:
41- singleCaseSwitch
42gci:
43sections:
44- standard
45- default
46- prefix(github.com/kumahq/kuma)
47custom-order: true
48importas:
49alias:
50- pkg: github.com/kumahq/kuma/pkg/core/resources/apis/mesh
51alias: core_mesh
52- pkg: github.com/kumahq/kuma/api/mesh/v1alpha1
53alias: mesh_proto
54- pkg: github.com/kumahq/kuma/api/system/v1alpha1
55alias: system_proto
56- pkg: github.com/kumahq/kuma/pkg/util/proto
57alias: util_proto
58- pkg: github.com/kumahq/kuma/pkg/util/rsa
59alias: util_rsa
60- pkg: github.com/kumahq/kuma/pkg/cmd
61alias: kuma_cmd
62- pkg: github.com/kumahq/kuma/pkg/plugins/bootstrap/k8s
63alias: bootstrap_k8s
64- pkg: github.com/kumahq/kuma/pkg/config/core
65alias: config_core
66- pkg: github.com/kumahq/kuma/pkg/core/resources/model
67alias: core_model
68- pkg: github.com/kumahq/kuma/api/common/v1alpha1
69alias: common_api
70- pkg: github.com/kumahq/kuma/api/openapi/types
71alias: api_types
72gomodguard:
73blocked:
74modules:
75- github.com/go-errors/errors:
76recommendations:
77- github.com/pkg/errors
78- github.com/ghodss/yaml:
79recommendations:
80- sigs.k8s.io/yaml
81- gopkg.in/yaml.v2:
82recommendations:
83- sigs.k8s.io/yaml
84- gopkg.in/yaml.v3:
85recommendations:
86- sigs.k8s.io/yaml
87- io/ioutil:
88recommandations:
89- io
90- os
91
92misspell:
93locale: US
94ignore-words:
95- cancelled # US English should be "canceled", but this is in the Retry API, so we can't change it.
96nonamedreturns:
97report-error-in-defer: false
98
99issues:
100fix: true
101exclude-rules:
102- linters:
103- staticcheck
104text: '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
105- linters:
106- staticcheck
107text: "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
108- linters:
109- staticcheck
110text: "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
111- linters:
112- staticcheck
113text: "SA1019: l.UseOriginalDst is deprecated: Do not use." # TODO What is the up-to-date alternative ?
114- linters:
115- staticcheck
116text: "IsIngress is deprecated: use ZoneIngress" # It's deprecated but Kuma still needs to support it for backwards compatibility.
117- linters:
118- gocritic
119text: "appendAssign: append result not assigned to the same slice" # None of the instances of this in Kuma were bugs.
120- linters:
121- staticcheck
122text: "SA1019: package sigs.k8s.io/controller-runtime/pkg/client/fake is deprecated" # https://github.com/kumahq/kuma/issues/2460
123- linters:
124- staticcheck
125text: "SA1019: l.ReusePort is deprecated"
126- linters: # AdminPort is deprecated, but it's used to support backwards compatibility
127- staticcheck
128text: "SA1019: cfg.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
129- linters: # AdminPort is deprecated, but it's used to support backwards compatibility
130- staticcheck
131text: "SA1019: kumaCPConfig.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
132- linters: # AdminPort is deprecated, but it's used to support backwards compatibility
133- staticcheck
134text: "SA1019: c.Runtime.Kubernetes.Injector.SidecarContainer.AdminPort is deprecated: Use KUMA_BOOTSTRAP_SERVER_PARAMS_ADMIN_PORT instead."
135- linters:
136- staticcheck
137text: "SA1019: .* for new policies use pkg/plugins/policies/xds/cluster.go"
138- linters:
139- staticcheck
140text: "SA1019: .* is deprecated: use MinResyncInterval instead"
141- linters:
142- staticcheck
143text: "SA1019: .* is deprecated: use FullResyncInterval instead"
144