GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — server/.golangci.yaml at master · gitLibs/server

Expand file tree

/

.golangci.yaml

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
325 lines (274 loc) · 9.53 KB
/

.golangci.yaml

Copy path

File metadata and controls

325 lines (274 loc) · 9.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# This file contains all available configuration options
# with their default values.
# options for analysis running
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
# exit code when at least one issue was found, default is 1
issues-exit-code: 1
# include test files or not, default is true
tests: true
modules-download-mode: readonly
# Allow multiple parallel golangci-lint instances running.
# If false (default) - golangci-lint acquires file lock on start.
allow-parallel-runners: true
skip-files: []
go: "1.18"
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
# default is "colored-line-number"
format: colored-line-number
# print lines of code with issue, default is true
print-issued-lines: true
# print linter name in the end of issue text, default is true
print-linter-name: true
# make issues output unique by line, default is true
uniq-by-line: true
# add a prefix to the output file references; default is no prefix
path-prefix: ""
# sorts results by: filepath, line and column
sort-results: true
# all available settings of specific linters
linters-settings:
goheader:
template: |-
SPDX-License-Identifier: AGPL-3.0-only
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false
exclude-functions:
- (*github.com/valyala/bytebufferpool.ByteBuffer).Write
- (*github.com/valyala/bytebufferpool.ByteBuffer).WriteByte
- (*github.com/valyala/bytebufferpool.ByteBuffer).WriteString
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors. See the readme for caveats
errorf: true
# Check for plain type assertions and type switches
asserts: true
# Check for plain error comparisons
comparison: true
forbidigo:
# Forbid the following identifiers (identifiers are written using regexp):
forbid:
- ^print.*$
- ^fmt\.Println$
- ^fmt\.Print$
gofmt:
simplify: true
rewrite-rules:
- pattern: "interface{}"
replacement: "any"
funlen:
lines: 60
statements: 40
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 15
godot:
# comments to be checked: `declarations`, `toplevel`, or `all`
scope: declarations
# list of regexps for excluding particular comment lines from check
exclude: []
# example: exclude comments which contain numbers
# - '[0-9]+'
# check that each sentence starts with a capital letter
capital: false
gci:
sections:
- standard # Captures all standard packages if they do not match another section.
- default # Contains all imports that could not be matched to another section type.
- prefix(github.com/bangumi/server) # Groups all imports with the specified Prefix.
sectionSeparators:
- newLine
depguard:
list-type: denylist
# Check the list against standard lib.
# Default: false
include-go-root: true
# A list of packages for the list type specified.
# Default: []
packages:
- "github.com/sirupsen/logrus"
- "github.com/golang/mock/gomock"
# A list of packages for the list type specified.
# Specify an error message to output when a denied package is used.
# Default: []
packages-with-error-message:
- "github.com/goccy/go-json": 'use "github.com/bytedance/sonic"'
- "github.com/sirupsen/logrus": 'use "app/pkg/logger"'
- "github.com/golang/mock": 'use "github.com/stretchr/testify/mock" and "github.com/vektra/mockery"'
# Create additional guards that follow the same configuration pattern.
# Results from all guards are aggregated together.
additional-guards:
- list-type: denylist
include-go-root: false
packages:
- github.com/stretchr/testify
# Specify rules by which the linter ignores certain files for consideration.
ignore-file-rules:
- "!**/*_test.go"
- "!/mocks/**/*.go"
gomnd:
settings:
mnd:
# the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
checks:
- argument
- case
- operation
- return
- assign
ignored-functions: strconv\..*,time\..*,make,math\..*,strings\..*
ignored-numbers: 1,2,3,10,100,1000,10000
gosimple:
# Select the Go version to target. The default is '1.13'.
go: "1.18"
# https://staticcheck.io/docs/options#checks
checks: ["all"]
importas:
no-unaliased: false
no-extra-aliases: false
alias:
- pkg: "log"
alias: stdLog
- pkg: "gorm.io/gorm/logger"
alias: gormLogger
- pkg: "github.com/go-playground/universal-translator"
alias: ut
- pkg: "github.com/go-playground/validator/v10/translations/zh"
alias: zhTranslations
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 120
# tab width in spaces. Default to 1.
tab-width: 2
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: US
staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.18"
# https://staticcheck.io/docs/options#checks
checks: ["all"]
stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.18"
testpackage:
# regexp pattern to skip files
skip-regexp: (export|internal)_test\.go
unused:
# Select the Go version to target. The default is '1.13'.
go: "1.18"
exhaustive:
# check switch statements in generated files also
check-generated: false
# indicates that switch statements are to be considered exhaustive if a
# 'default' case is present, even if all enum members aren't listed in the
# switch
default-signifies-exhaustive: true
govet:
enable-all: true
disable:
- fieldalignment
# - shadow
nlreturn:
block-size: 3
ifshort:
# Maximum length of vars declaration measured in number of lines, after which linter won't suggest using short syntax.
# Has higher priority than max-decl-chars.
max-decl-lines: 1
# Maximum length of vars declaration measured in number of characters, after which linter won't suggest using short syntax.
max-decl-chars: 30
tagliatelle:
# Check the struck tag name case.
case:
# Use the struct field name to check the name of the struct tag.
# Default: false
use-field-name: false
rules:
# Any struct tag type can be used.
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
json: snake
yaml: snake
linters:
enable-all: true
disable:
- nolintlint
- ireturn
- contextcheck
- bodyclose
- wsl # noisy
- varnamelen # noisy
- exhaustivestruct # too noisy, default zero value is a good thing.
- exhaustruct # too noisy
- gofumpt # break import grouping
- prealloc # perf
- maligned # replaced by go vert
- dupl
- cyclop # we have gocyclo
- goimports # we have gci already
- nlreturn
- godox
- execinquery
- nonamedreturns
# useless
- sqlclosecheck
- rowserrcheck
- nilerr
- dupword
- wrapcheck
# 1.18
- wastedassign
- nosnakecase # false positive for variable and const defined in other lib
- structcheck
# deprecated
- varcheck
- deadcode
- interfacer
- ifshort
- scopelint
- golint
fast: false
issues:
new: false
fix: false
exclude-use-default: true
exclude-rules:
- path: "cmd/.*"
linters: [gochecknoglobals, gochecknoinits, wrapcheck]
- path: '.*_test\.go'
linters: [gocritic, gochecknoglobals, godot, nosnakecase, funlen, musttag]
- source: "var .* = pool.New"
linters: [gochecknoglobals]
- source: 'var Module = fx\.Module\('
linters: [gochecknoglobals]
- source: 'var .* = reflect\.TypeOf'
linters: [gochecknoglobals]
- source: 'var .* sync\.Once'
linters: [gochecknoglobals]
- linters: [goerr113, errorlint]
source: "if err == redis.Nil {"
# https://github.com/kunwardeep/paralleltest/issues/8
- linters:
- paralleltest
text: "Range statement for test \\S+ does not use range value in test Run"
- linters:
- nilerr
source: "return false, nil"
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.