-
Notifications
You must be signed in to change notification settings - Fork 52
/
.golangci.yaml
190 lines (177 loc) · 4.76 KB
/
.golangci.yaml
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
run:
# If set, we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
#
# Allowed values: readonly|vendor|mod
# Default: ""
modules-download-mode: readonly
# Include test files or not.
# Default: true
tests: false
# Which dirs to skip: issues from them won't be reported.
# Can use regexp here: `generated.*`, regexp is applied on full path.
# Default value is empty list,
# but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work on Windows.
# skip-dirs:
# - src/external_libs
# - autogenerated_by_my_lib
# Enables skipping of directories:
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
# Default: true
# skip-dirs-use-default: false
# Which files to skip: they will be analyzed, but issues from them won't be reported.
# Default value is empty list,
# but there is no need to include all autogenerated files,
# we confidently recognize autogenerated files.
# If it's not please let us know.
# "/" will be replaced by current OS file path separator to properly work on Windows.
# skip-files:
# - ".*\\.my\\.go$"
# - lib/bad.go
output:
# Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
#
# Multiple can be specified by separating them by comma, output can be provided
# for each of them by separating format name and path by colon symbol.
# Output path can be either `stdout`, `stderr` or path to the file to write to.
# Example: "checkstyle:report.json,colored-line-number"
#
# Default: colored-line-number
formats:
format: github-actions
linters-settings:
wrapcheck:
ignoreSigs:
# No point in wrapping these
- func encoding/json.Marshal(v any)
- func encoding/json.UnmarshalJSON(v any)
# Defaults
- .Errorf(
- errors.New(
- errors.Unwrap(
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
funlen:
# Increase the number of lines, considering funlen counts comments as well
# (https://github.com/ultraware/funlen/issues/12)
#
# default: 60
lines: 80
linters:
# TODO: incrementally enable all of them
enable-all: false
enable:
- asasalint
- asciicheck
- bidichk
# - bodyclose
# - containedctx
- contextcheck
# - cyclop
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- errname
- errorlint
- exhaustive
- exportloopref
- forbidigo
- forcetypeassert
# - funlen
- gci
- ginkgolinter
- gocheckcompilerdirectives
# - gochecknoglobals
# - gochecknoinits
# - gocognit
- goconst
- gocritic
# - gocyclo
- godot
- godox
# - goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- grouper
- importas
- interfacebloat
# - ireturn
- lll
- loggercheck
- maintidx
- makezero
- misspell
- musttag
- nakedret
# - nestif
- nilerr
- nilnil
- nlreturn
# - noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- sqlclosecheck
# - stylecheck
- tagliatelle
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
# - varnamelen
- wastedassign
- whitespace
# - wrapcheck
# - wsl
disable:
# # Disable deprecated linters
# - exhaustivestruct
# - golint
# - interfacer
# - maligned
# - scopelint
# - execinquery
# # Not useful
# - depguard
# # Not terribly useful and ends up in too much boilerplate
# - exhaustruct
# # False positives (https://github.com/daixiang0/gci/issues/54)
# - gci
# # https://github.com/italia/developers-italia-api/issues/190)
# # Don't feel about chasing this one down
# - musttag
# More false positive than actual issues
- gomnd
# Run only fast linters from enabled linters set (first run won't be fast)
# Default: false
# fast: true