Repository navigation
Expand file tree
/
Copy path.golangci.yaml
More file actions
179 lines (179 loc) · 5.52 KB
/
Copy path.golangci.yaml
File metadata and controls
179 lines (179 loc) · 5.52 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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
version: "2"
linters:
default: none
enable:
- copyloopvar
- depguard
- errcheck
- gocritic
- govet
- ineffassign
- misspell
- staticcheck
- unconvert
- unparam
- unused
settings:
depguard:
rules:
AllGoFiles:
files:
- $all
deny:
- pkg: golang.org/x/net/http2/h2c
desc: h2c.NewHandler is unsafe; use wrapper istio.io/istio/pkg/h2c
- pkg: github.com/golang/protobuf/jsonpb
desc: don't use the jsonpb package directly; use util/protomarshal instead
- pkg: google.golang.org/protobuf/encoding/protojson
desc: don't use the protojson package directly; use util/protomarshal instead
- pkg: gomodules.xyz/jsonpatch/v3
desc: don't use v3; v2 is orders of magnitude higher performance
- pkg: k8s.io/apimachinery/pkg/util/sets
desc: use istio.io/istio/pkg/util/sets
- pkg: k8s.io/utils/set
desc: use istio.io/istio/pkg/util/sets
- pkg: k8s.io/utils/env
desc: use istio.io/istio/pkg/env
- pkg: k8s.io/utils/strings/slices
desc: use istio.io/istio/pkg/slices
- pkg: k8s.io/utils/pointer
desc: use istio.io/istio/pkg/ptr
- pkg: go.opencensus.io
desc: do not use OpenCensus; use OpenTelemetry instead
- pkg: golang.org/x/exp/maps
desc: do not use golang.org/x/exp/maps; use istio.io/istio/pkg/maps instead
- pkg: maps
desc: do not use maps; use istio.io/istio/pkg/maps instead
- pkg: golang.org/x/exp/slices
desc: do not use golang.org/x/exp/slices; use istio.io/istio/pkg/slices instead
- pkg: slices
desc: do not use slices; use istio.io/istio/pkg/slices instead
- pkg: gopkg.in/yaml.v2
desc: do not use gopkg.in/yaml.v2; use sigs.k8s.io/yaml instead
- pkg: gopkg.in/yaml.v3
desc: do not use gopkg.in/yaml.v3; use sigs.k8s.io/yaml instead
- pkg: github.com/ghodss/yaml
desc: do not use github.com/ghodss/yaml; use sigs.k8s.io/yaml instead
DenyGogoProtobuf:
files:
- $all
deny:
- pkg: github.com/gogo/protobuf
desc: gogo/protobuf is deprecated, use golang/protobuf
DenyOpenTelemetry:
files:
- $all
- '!**/pkg/monitoring/**'
- '!**/pkg/tracing/**'
deny:
- pkg: go.opentelemetry.io/otel
desc: do not use OpenTelemetry directly; use pkg/monitoring
- pkg: go.opentelemetry.io/otel/metric
desc: do not use OpenTelemetry directly; use pkg/monitoring
DenyOperatorAndIstioctl:
files:
- '!$test'
- '!**/operator/**'
- '!**/istioctl/**'
- '!**/tools/bug-report/**'
- '!**/pkg/kube/**'
- '!**/pkg/url/**'
- '!**/pkg/test/framework/**'
- '!**/tests/fuzz/**'
deny:
- pkg: istio.io/istio/operator
desc: operator should not be imported
- pkg: istio.io/istio/istioctl
desc: istioctl should not be imported
DenyProtobufV1:
files:
- $all
deny:
- pkg: github.com/golang/protobuf/ptypes
desc: do not use github.com/golang/protobuf/ptypes; use google.golang.org/protobuf/types/known instead
gosec:
includes:
- G401
- G402
- G404
govet:
disable:
- shadow
- copylocks
unparam:
check-exported: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- errcheck
- maligned
path: _test\.go$|^tests/|^samples/
- path: _test\.go$
text: 'dot-imports: should not use dot imports'
- linters:
- staticcheck
text: 'SA1019: package github.com/golang/protobuf/jsonpb'
- linters:
- staticcheck
text: 'SA1019: v1.Endpoints is deprecated'
- linters:
- staticcheck
text: 'SA1019: "github.com/golang/protobuf/jsonpb"'
- linters:
- staticcheck
text: 'SA1019: grpc.Dial is deprecated: use NewClient instead'
- linters:
- staticcheck
text: 'SA1019: grpc.DialContext is deprecated: use NewClient instead'
- linters:
- staticcheck
text: 'SA1019: grpc.WithBlock is deprecated'
- linters:
- staticcheck
text: 'SA1019: grpc.FailOnNonTempDialError'
- linters:
- staticcheck
text: 'SA1019: grpc.WithReturnConnectionError'
- path: (.+)\.go$
text: composite literal uses unkeyed fields
paths:
- .*\.pb\.go
- .*\.gen\.go
- genfiles$
- vendor$
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gci
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/howardjohn/pilot-load/)
goimports:
local-prefixes:
- github.com/howardjohn/pilot-load/
exclusions:
generated: lax
paths:
- .*\.pb\.go
- .*\.gen\.go
- genfiles$
- vendor$
- third_party$
- builtin$
- examples$