-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrevive.toml
More file actions
100 lines (89 loc) · 2.58 KB
/
Copy pathrevive.toml
File metadata and controls
100 lines (89 loc) · 2.58 KB
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
# Revive configuration for SecureLog
# https://github.com/mgechev/revive
# When set to false, ignores files with "GENERATED" header, similar to golint
ignoreGeneratedHeader = true
# Sets the default severity to "warning"
severity = "warning"
# Sets the default failure confidence. This means that linting errors
# with less than 0.8 confidence will be ignored.
confidence = 0.8
# Sets the error code for failures with severity "error"
errorCode = 1
# Sets the error code for failures with severity "warning"
warningCode = 0
# Enable all rules by default, then disable specific ones
enableAllRules = false
# Configuration of available rules
[rule.blank-imports]
[rule.context-as-argument]
[rule.context-keys-type]
[rule.dot-imports]
[rule.error-return]
[rule.error-strings]
[rule.error-naming]
[rule.exported]
# Arguments for exported rule: [checkPrivateReceivers, sayRepetitiveInsteadOfStutters]
arguments = ["checkPrivateReceivers", "disableStutteringCheck"]
[rule.if-return]
[rule.increment-decrement]
[rule.var-naming]
[rule.var-declaration]
[rule.package-comments]
[rule.range]
[rule.receiver-naming]
[rule.time-naming]
[rule.unexported-return]
[rule.indent-error-flow]
[rule.errorf]
[rule.empty-block]
[rule.superfluous-else]
[rule.unused-parameter]
# Allow unused parameters in interface implementations
severity = "warning"
[rule.unreachable-code]
[rule.redefines-builtin-id]
# Additional useful rules
[rule.constant-logical-expr]
[rule.bool-literal-in-expr]
[rule.imports-blacklist]
[rule.range-val-in-closure]
[rule.range-val-address]
[rule.waitgroup-by-value]
[rule.atomic]
[rule.empty-lines]
[rule.call-to-gc]
[rule.duplicated-imports]
[rule.import-shadowing]
[rule.bare-return]
[rule.unused-receiver]
[rule.unhandled-error]
arguments = [
"fmt.Printf",
"fmt.Println",
"fmt.Print",
]
[rule.cognitive-complexity]
arguments = [25]
[rule.function-length]
arguments = [50, 75] # statements, lines
[rule.cyclomatic]
arguments = [15]
[rule.max-public-structs]
arguments = [10]
[rule.file-header]
# No required file header for this project
# Cryptography-specific rules
[rule.deep-exit]
# Warn on os.Exit in functions (important for crypto code cleanup)
[rule.defer]
arguments = [
["call-chain", "loop", "method-call", "recover", "return"],
]
# Formatting
[rule.line-length-limit]
arguments = [120]
# Disabled rules (too noisy or not relevant)
# [rule.add-constant] # Too aggressive for small projects
# [rule.flag-parameter] # Common in crypto APIs
# [rule.confusing-naming] # False positives
# [rule.function-result-limit] # Crypto functions often return multiple values