-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
198 lines (188 loc) · 4.74 KB
/
.golangci.yml
File metadata and controls
198 lines (188 loc) · 4.74 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
version: "2"
linters:
default: standard
enable:
- errcheck
- govet
- staticcheck
- unused
- ineffassign
- revive
- gosec
- unconvert
- unparam
- misspell
- errname
- bodyclose
- noctx
- testifylint
- dupword
- durationcheck
- fatcontext
- intrange
- copyloopvar
- exptostd
- whitespace
- predeclared
- nilerr
- nosprintfhostport
- usestdlibvars
- usetesting
disable:
- errorlint
- gocritic
- perfsprint
- exhaustruct
- wsl
- nlreturn
- varnamelen
- ireturn
- mnd
- funlen
- cyclop
- gocognit
- gocyclo
- nestif
- godox
- lll
- wrapcheck
- err113
- nonamedreturns
- paralleltest
- tparallel
- testpackage
- depguard
- tagliatelle
- containedctx
- gochecknoglobals
- gochecknoinits
- exhaustive
- forbidigo
- forcetypeassert
- inamedparam
- interfacebloat
- godot
settings:
errcheck:
check-type-assertions: true
check-blank: false
govet:
enable-all: true
disable:
- fieldalignment
- shadow
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
disabled: false
- name: increment-decrement
- name: var-naming
disabled: true
- name: package-comments
disabled: true
- name: range
- name: receiver-naming
disabled: true
- name: time-naming
- name: unexported-return
- name: indent-error-flow
disabled: true
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unreachable-code
gosec:
excludes:
- G101 # hard-coded credentials (too many false positives)
- G104 # unhandled errors (too noisy for resp.Body.Close patterns)
- G115 # integer overflow from type conversion
- G117 # secret field patterns (false positives on auth structs)
- G204 # subprocess with variable arguments
- G704 # SSRF (false positives for HTTP clients)
- G705 # XSS (false positives for HTTP clients)
- G706 # log injection (false positives for server logging)
misspell:
locale: US
testifylint:
enable-all: true
exclusions:
generated: strict
presets:
- std-error-handling
- common-false-positives
rules:
- path: _test\.go
linters:
- gosec
- errcheck
- unparam
- bodyclose
- noctx
- usestdlibvars
- dupword
- path: internal/
linters:
- revive
- errcheck
# Inherited code: pre-existing misspellings in comments and upstream test data.
- linters:
- misspell
source: "cancelled|behaviour|amortise|cancelling|identifer|excercise|manfiest"
# Inherited code: pre-existing duplicate words from upstream.
- linters:
- dupword
path: (ociauth/auth\.go|ociref/reference\.go)
# Inherited code: resp.Body.Close and io.Copy in HTTP handlers.
- linters:
- errcheck
source: "(resp\\.Write|io\\.Copy|oci\\.WriteError)"
# Inherited code: string HTTP method constants.
- linters:
- usestdlibvars
path: (ociclient/|ociauth/)
# Inherited code: bodyclose false positives in forked client code.
- linters:
- bodyclose
path: (ociclient/|error\.go)
# Inherited code: noctx in authfile helper.
- linters:
- noctx
path: ociauth/authfile\.go
# Inherited code: errname on WireErrors type.
- linters:
- errname
path: error\.go
# Inherited code: unused field in client.
- linters:
- unused
path: ociclient/client\.go
text: "listPageSize"
# Inherited code: ineffectual assignment in lister.
- linters:
- ineffassign
path: ociserver/lister\.go
# Inherited code: staticcheck empty branch.
- linters:
- staticcheck
text: "SA9003"
# Inherited code: testifylint suggestions on existing tests.
- linters:
- testifylint
path: (error_test\.go|iter_test\.go|ociclient/error_test\.go|ocifilter/select_test\.go|ociauth/auth_test\.go)
# Inherited code: whitespace in existing tests.
- linters:
- whitespace
path: (ociclient/auth_test\.go|ociserver/registry_test\.go)
issues:
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m
tests: true