-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.golangci.yml
More file actions
147 lines (147 loc) · 4.26 KB
/
.golangci.yml
File metadata and controls
147 lines (147 loc) · 4.26 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
version: "2"
linters:
enable:
- bodyclose
- forbidigo
- ginkgolinter
- gocritic
- goheader
- gosec
- importas
- misspell
- revive
- testifylint
- unconvert
- unparam
settings:
forbidigo:
forbid:
- pattern: http.DefaultTransport
ginkgolinter:
forbid-focus-container: true
goheader:
template-path: ./hack/license-template.txt
importas:
alias:
- pkg: github.com/projectcontour/contour/apis/projectcontour/(v\w+)
alias: contour_${1}
- pkg: sigs.k8s.io/gateway-api/apis/(v\w+)
alias: gatewayapi_${1}
- pkg: k8s.io.*/apis?/(\w+)/(v\w+)
alias: ${1}_${2}
- pkg: github.com/envoyproxy/go-control-plane/envoy/config/(\w+)/(v\w+)
alias: envoy_config_${1}_${2}
- pkg: github.com/envoyproxy/go-control-plane/envoy/service/(\w+)/(v\w+)
alias: envoy_service_${1}_${2}
- pkg: github.com/envoyproxy/go-control-plane/envoy/extensions/filters/(\w+)/(\w+)/(v\w+)
alias: envoy_filter_${1}_${2}_${3}
- pkg: github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/(\w+)/(v\w+)
alias: envoy_transport_socket_${1}_${2}
- pkg: github.com/envoyproxy/go-control-plane/envoy/extensions/compression/(\w+)/(\w+)/(v\w+)
alias: envoy_compression_${1}_${2}_${3}
- pkg: github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/(\w+)/(v\w+)
alias: envoy_access_logger_${1}_${2}
- pkg: github.com/envoyproxy/go-control-plane/envoy/extensions/formatter/(\w+)/(v\w+)
alias: envoy_formatter_${1}_${2}
- pkg: github.com/envoyproxy/go-control-plane/envoy/extensions/upstreams/(\w+)/(v\w+)
alias: envoy_upstream_${1}_${2}
- pkg: github.com/envoyproxy/go-control-plane/envoy/type/(v\w+)
alias: envoy_type_${1}
- pkg: github.com/envoyproxy/go-control-plane/envoy/type/matcher/(v\w+)
alias: envoy_matcher_${1}
no-unaliased: true
misspell:
locale: US
ignore-rules:
- clas
- cancelled
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: empty-block
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: superfluous-else
- name: time-naming
- name: unexported-return
- name: unreachable-code
- name: unused-parameter
- name: use-any
- name: var-declaration
- name: var-naming
testifylint:
enable-all: true
unparam:
check-exported: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- unparam
text: always receives
- linters:
- bodyclose
path: test/e2e
- linters:
- revive
path: test/e2e
text: should not use dot imports
- linters:
- testifylint
path: test/e2e
text: require must only be used in the goroutine running the test function
- linters:
- gosec
path: test/e2e
text: "G204:"
reason: "G204 subprocess false positive in e2e test code where helm commands are intentional"
- linters:
- gosec
path: test/e2e
text: "G704:"
reason: "G704 SSRF taint analysis false positive in e2e test code where HTTP requests are intentional"
paths:
- 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/projectcontour/contour)
custom-order: true
gofumpt:
extra-rules: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- zz_generated