-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.golangci.yaml
209 lines (199 loc) · 5.12 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
service:
golangci-lint-version: 1.55.x # use the fixed version to not introduce new linters unexpectedly
run:
timeout: 5m
linters:
disable-all: true
enable:
# - asasalint
# - asciicheck
# - bidichk
# - bodyclose
# - containedctx
# - contextcheck
# - cyclop
# - decorder
# - dogsled
# - dupl
# - dupword
# - durationcheck
# - errcheck
# - errchkjson
# - errname
# - errorlint
# - execinquery
# - exhaustive
# - exportloopref
# - forbidigo
# - funlen
# - ginkgolinter
# - gocheckcompilerdirectives
# - gochecknoinits
# - gochecksumtype
# - gocognit
# - gocyclo
# - godot
# - godox
# - gofmt
# - gofumpt
# - goheader
# - goimports
# - gomoddirectives
# - gomodguard
# - goprintffuncname
# - gosec
# - gosimple
# - gosmopolitan
# - govet
# - grouper
# - importas
# - inamedparam
# - ineffassign
# - interfacebloat
# - loggercheck
# - maintidx
# - makezero
# - mirror
# - misspell
# - musttag
# - nakedret
# - nestif
# - nilerr
# - nilnil
# - noctx
# - nolintlint
# - nonamedreturns
# - nosprintfhostport
# - paralleltest
# - perfsprint
# - prealloc
# - predeclared
# - promlinter
# - protogetter
# - reassign
# - revive
# - rowserrcheck
# - sloglint
# - sqlclosecheck
# - staticcheck
# - stylecheck
# - tagalign
# - tagliatelle
# - tenv
# - testableexamples
# - testifylint
# - thelper
# - tparallel
# - typecheck
# - unconvert
# - unparam
# - unused
# - usestdlibvars
# - wastedassign
# - whitespace
# - zerologlint
#
- unused
- errcheck
- exportloopref
- gocritic
- gofumpt
- goimports
- revive
- gosimple
- govet
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- gosec
- asciicheck
- prealloc
- predeclared
fast: false
linters-settings:
errcheck:
# report about not checking of errors in type assetions: `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:
- (net/http.ResponseWriter).Write
gocritic:
disabled-checks:
- appendAssign
gofumpt:
# Module path which contains the source code being formatted.
module-path: github.com/verifa/horizon
# Choose whether to use the extra rules.
# Default: false
extra-rules: true
govet:
# report about shadowed variables
check-shadowing: false
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
nolintlint:
# Disable to ensure that all nolint directives actually have an effect.
# Default: false
allow-unused: false
# Exclude following linters from requiring an explanation.
# Default: []
allow-no-explanation: []
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: true
# Enable to require nolint directives to mention the specific linter being suppressed.
# Default: false
require-specific: true
revive:
rules:
- name: increment-decrement
severity: warning
disabled: true
unused:
exported-fields-are-used: true
exported-is-used: true
unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
gosec:
severity: "low"
confidence: "low"
excludes:
- G102
- G112
- G306
- G401
- G402
- G404
- G501
issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently of this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
# exclude:
# - composite literal uses unkeyed fields
exclude-rules:
# Exclude some linters from running on test files.
- path: _test\.go$|^tests/|^samples/
linters:
- errcheck
- maligned
# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: true
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0