-
Notifications
You must be signed in to change notification settings - Fork 815
/
Copy pathrevive.toml
57 lines (50 loc) · 1.87 KB
/
revive.toml
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
# config for https://github.com/mgechev/revive
ignoreGeneratedHeader = false
severity = "warning"
confidence = 0.8
errorCode = 0
warningCode = 0
#### roughly what golint does. probably only disable noisy ones.
[rule.blank-imports]
[rule.context-as-argument]
[rule.context-keys-type]
[rule.dot-imports]
[rule.error-naming]
[rule.error-return]
[rule.error-strings]
[rule.errorf]
# [rule.exported] # disabled due to lack of value / encouraging bad habits
[rule.if-return]
[rule.increment-decrement]
[rule.indent-error-flow]
[rule.package-comments]
[rule.range]
[rule.receiver-naming]
[rule.time-naming]
[rule.unexported-return]
[rule.var-declaration]
[rule.var-naming]
#### higher value stuff
# general defer gotchas.
#
# in particular: "recover" warns about unsafe use of recover().
# this has caught bugs that can allow crashes while seemingly safe, and are *extremely* hard to catch in review.
#
# the arguments are excluding only "call-chain", which would disallow `defer someFn(...)()` which is both useful and in use.
[rule.defer]
arguments=[["loop","method-call","recover","return"]]
# string(int) is almost always a bug.
# go vet considers this a fatal error, but only in 1.15 or newer, and go.mod currently targets 1.13
[rule.string-of-int]
#### added because we currently have zero violations, and they seem decent enough to retain
[rule.atomic] # correct use of sync code, important
[rule.call-to-gc] # beneficial
[rule.constant-logical-expr] # minor code simplifier
[rule.identical-branches] # code simplifier / failures are pretty dubious
[rule.modifies-parameter] # beneficial
[rule.modifies-value-receiver] # probably beneficial, prevents subtle bugs
[rule.range-val-address] # beneficial
[rule.range-val-in-closure] # beneficial
[rule.unconditional-recursion] # probably a good idea
[rule.unreachable-code] # code simplifier
[rule.waitgroup-by-value] # correct use of sync code, important