-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
118 lines (112 loc) · 3.48 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
run:
build-tags:
- mage
linters:
enable-all: true
disable:
# Deprecated
- golint
- ireturn
- interfacer
- exhaustivestruct
- maligned
- scopelint
# Doesn't work
- promlinter
# Not used
- paralleltest
- nlreturn
- wsl
- lll
- gofumpt
- gci
- exhaustruct # ultimately too noisy for most coding
# 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
issues:
exclude-rules:
- path: _test\.go
linters:
- dupl
- funlen
- varnamelen
- path: magefile.go
linters:
- unparam
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
- v
- c
- ip
# 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