-
Notifications
You must be signed in to change notification settings - Fork 4
/
.golangci.yml
187 lines (177 loc) Β· 3.42 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
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
run:
timeout: 5m
tests: false
modules-download-mode: readonly
allow-parallel-runners: true
output:
show-stats: true
sort-results: true
sort-order:
- severity
- linter
- file
linters:
disable-all: true
enable:
- gci
- gofmt
- goimports
- gosec
- govet
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
# - unused
- goheader
- whitespace
# presets:
# - bugs
# - comment
# - import
issues:
exclude:
- G101 # gosec: Potential hardcoded credentials
- G115 # gosec: integer overflow conversion int
max-same-issues: 0
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# exclude ineffassing linter for generated files for conversion
- linters:
- dogsled
text: "declaration has 3 blank identifiers"
path: _test\.go
- linters:
- dupl
path: _test\.go
- linters:
- goheader
source: "^//go:build"
- linters:
- goheader
text: "Helm"
- linters:
- goheader
text: "Kubernetes"
- linters:
- goheader
text: "SPDX-License-Identifier"
- linters:
- goheader
text: "Authors"
- linters:
- goheader
text: "Copyright"
- linters:
- goheader
text: "rights reserved"
- linters:
- staticcheck
text: "SA1019: common.ZenTaoOldOSSType is deprecated"
exclude-dirs:
- hack/bin
- testdata$
- examples$
- vendor$
- third_party$
- internal/static
exclude-files:
- "zz_*"
- ".*test\\.go$"
linters-settings:
gci:
custom-order: true
sections:
- standard
- default
- prefix(github.com/easysoft/qcadmin)
- blank
- dot
- alias
govet:
enable-all: true
disable:
- fieldalignment
- shadow
stylecheck:
# https://staticcheck.io/docs/options#checks
checks:
[
"all",
"-S1*",
"-ST1000",
"-ST1003",
"-ST1016",
"-ST1020",
"-ST1021",
"-ST1022",
"-SA5011",
"-SA1019",
"-SA2002",
]
# https://staticcheck.io/docs/options#dot_import_whitelist
dot-import-whitelist:
- fmt
# https://staticcheck.io/docs/options#initialisms
initialisms:
[
"ACL",
"API",
"ASCII",
"CPU",
"CSS",
"DNS",
"EOF",
"GUID",
"HTML",
"HTTP",
"HTTPS",
"ID",
"IP",
"JSON",
"QPS",
"RAM",
"RPC",
"SLA",
"SMTP",
"SQL",
"SSH",
"TCP",
"TLS",
"TTL",
"UDP",
"UI",
"GID",
"UID",
"UUID",
"URI",
"URL",
"UTF8",
"VM",
"XML",
"XMPP",
"XSRF",
"XSS",
]
# https://staticcheck.io/docs/options#http_status_code_whitelist
http-status-code-whitelist: ["200", "400", "404", "500"]
nakedret:
# default 30
max-func-lines: 100
goheader:
template-path: .go-header.txt
revive:
ignore-generated-header: true
severity: warning
rules:
- name: unused-parameter
disabled: true
errcheck:
check-type-assertions: false
check-blank: true
exclude-functions:
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
gosmopolitan:
allow-time-local: true