-
Notifications
You must be signed in to change notification settings - Fork 20
/
.golangci.yml
159 lines (150 loc) · 4.39 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
run:
build-tags:
- mage
output:
format: junit-xml:.junit/linters.xml,colored-line-number
linters:
enable-all: true
disable:
# Doesn't work
- promlinter
- revive # Revisit in future
# Not used
- paralleltest
- nlreturn
- wsl
- lll
- gofumpt
- gci
- exhaustruct # ultimately too noisy for most coding
- depguard
- dupword
# This one is just infuriating, produces a lot of warnings, and doesn't matter.
- godot
# These all stopped working suddenly due to a non-existent compilation error.
# Retry them regularly.
# - stylecheck
# - exhaustive
# - staticcheck
# - gosimple
# - govet
# - unused
- godox # noisy and counterproductive
# Deprecated
- nosnakecase # deprecated
- ifshort # deprecated
- deadcode # Considered abandoned by golangci-lint as of 1.53.x
- varcheck # Considered abandoned by golangci-lint as of 1.53.x
- structcheck # Considered abandoned by golangci-lint as of 1.53.x
- golint
- ireturn
- interfacer
- exhaustivestruct
- maligned
- scopelint
issues:
exclude-rules:
- path: _test\.go
linters:
- dupl
- funlen
- varnamelen
- path: magefile.go
linters:
- unparam
exclude:
- "ST1023: should omit type .*"
severity:
default-severity: error
rules:
- linters:
- godox
- funlen
- nolintlint
severity: info
linters-settings:
varnamelen:
# The longest distance, in source lines, that is being considered a "small scope." (defaults to 5)
# Variables used in at most this many lines will be ignored.
max-distance: 5
# The minimum length of a variable's name that is considered "long." (defaults to 3)
# Variable names that are at least this long will be ignored.
min-name-length: 3
# Check method receivers. (defaults to false)
check-receiver: false
# Check named return values. (defaults to false)
check-return: false
# Check type parameters. (defaults to false)
check-type-param: false
# Ignore "ok" variables that hold the bool return value of a type assertion. (defaults to false)
ignore-type-assert-ok: false
# Ignore "ok" variables that hold the bool return value of a map index. (defaults to false)
ignore-map-index-ok: false
# Ignore "ok" variables that hold the bool return value of a channel receive. (defaults to false)
ignore-chan-recv-ok: false
# Optional list of variable names that should be ignored completely. (defaults to empty list)
ignore-names:
- err
- ch # common channel var
- l # common log var
- k
- v
- c
- ip
- f # function
- fn
- st
- e
- in
- wr
- rd
- b
# Optional list of variable declarations that should be ignored completely. (defaults to empty list)
# Entries must be in one of the following forms (see below for examples):
# - for variables, parameters, named return values, method receivers, or type parameters:
# <name> <type> (<type> can also be a pointer/slice/map/chan/...)
# - for constants: const <name>
ignore-decls:
- s string
- w http.ResponseWriter
- r *http.Request
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: true
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
xml: snake
exhaustruct:
# List of regular expressions to match struct packages and names.
# If this list is empty, all structs are tested.
# Default: []
include: []
# List of regular expressions to exclude struct packages and names from check.
# Default: []
exclude:
- 'net\.IPAddr$'
- 'promhttp\.HandlerOpts$'
- 'x509\.VerifyOptions$'
- 'http\.Transport$'
- 'http\.Request$'
- 'http\.Client$'
- 'net\.Dialer$'
- 'http\.Server$'
- 'tls\.Config$'
gocritic:
disabled-checks:
- commentFormatting
wrapcheck:
ignoreSigRegexps:
- func \(github\.com/labstack/echo/v4\.Context\)
gomnd:
ignored-functions:
- 'math.*'
- 'http.StatusText'
- "strconv.Parse.*"