forked from rilldata/rill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
216 lines (212 loc) · 5.18 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
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
# Options for analysis running.
run:
# The default concurrency value is the number of available CPU.
# concurrency: 4
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 10m
# 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:
- runtime/sql
- proto/gen
# 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$"
issues-exit-code: 1
# output configuration options
output:
# Sort results by: filepath, line and column.
sort-results: false
linters:
disable-all: true
enable:
- bodyclose
- bidichk
- depguard
- errchkjson
- errcheck
- errname
- errorlint
- gci
- gocritic
- gofmt
- gofumpt
- goheader
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- revive
- stylecheck
- staticcheck
- tparallel
- testpackage
- tenv
- typecheck
- unconvert
- usestdlibvars
- unused
- whitespace
- unparam
linters-settings:
depguard:
rules:
main:
files:
- "!proto/**/*.go"
deny:
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- unnamedResult
- dupImport
- sprintfQuotedString
- ifElseChain
- nestingReduce
- badRegexp
- filepathJoin
- hugeParam
- octalLiteral
gomnd:
settings:
mnd:
# don't include the "operation" and "assign" checks
checks: argument,case,condition,return
gci:
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
govet:
enable:
- asmdecl
- assign
- atomic
- atomicalign
- bools
- buildtag
- cgocall
- composites
- copylocks
- deepequalerrors
- errorsas
- findcall
- framepointer
- httpresponse
- ifaceassert
- loopclosure
- lostcancel
- nilfunc
- nilness
- nlreturn
- printf
- reflectvaluecompare
- shift
- sigchanyzer
- sortslice
- stdmethods
- stringintconv
- structtag
- testinggoroutine
- tests
- unmarshal
- unreachable
- unsafeptr
- unusedresult
- unusedwrite
disable-all: true
gosec:
excludes:
- G107
- G108
- G112
- G203
- G204
- G306
- G401
- G501
revive:
ignore-generated-header: false
severity: "warning"
confidence: 0.8
error-code: 2
warning-code: 1
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-naming
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unreachable-code
- name: redefines-builtin-id
stylecheck:
checks:
[
"all",
"-ST1000",
"-ST1003",
"-ST1005",
"-ST1016",
"-ST1020",
"-ST1021",
"-ST1022",
]
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
- path: _test\.go # disable some linters for test files
linters:
- gocyclo
- gosec
- dupl
- varnamelen