-
Notifications
You must be signed in to change notification settings - Fork 0
/
.revive.toml
135 lines (94 loc) · 4.59 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
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
ignoreGeneratedHeader = true
severity = "warning"
# confidence <= 0.2 generate a lot of errors from package-comments rule. It marks files that do not contain
# package-level comments as a warning irrespective of existing package-level coment in one file.
confidence = 0.25
errorCode = 1
warningCode = 1
# Rules block.
# ⚠ Make sure to sort rules alpabetically for readability! ⚠
# argument-limit rule is setting up a maximum number of parameters that can be passed to the functions/methods.
[rule.argument-limit]
arguments = [5]
# atomic rule checks for commonly mistaken usages of the sync/atomic package.
[rule.atomic]
# blank-imports rule disallows blank imports.
[rule.blank-imports]
# bool-literal-in-expr suggests removing boolean literals from logic expressions like `bar == true`, `arg == false`,
# `r != true`, `false && boolExpr` and `boolExpr || true`.
[rule.bool-literal-in-expr]
# constant-logical-expr rule warns on constant logical expressions, like `name == name`.
[rule.constant-logical-expr]
# context-as-argument rule makes sure that context.Context is the first argument of a function.
[rule.context-as-argument]
# context-keys-type rule disallows the usage of basic types in context.WithValue
[rule.context-keys-type]
# confusing-naming rule warns on methods with names that differ only by capitalization.
[rule.confusing-naming]
# confusing-results rule suggests to name potentially confusing function results.
[rule.confusing-results]
# cyclomatic rule sets restriction for maximum Cyclomatic complexity.
[rule.cyclomatic]
arguments = [15]
# deep-exit rule looks for program exits in funcs other than `main()` or `init()`.
[rule.deep-exit]
# dot-imports rule forbids `.` imports.
[rule.dot-imports]
# empty-block warns on empty code blocks.
[rule.empty-block]
# error-return rule ensure that the error return parameter is the last.
[rule.error-return]
# error-strings rule ensure conventions around error strings.
[rule.error-strings]
# error-naming rule ensure naming of error variables (has `Err` or `err` prefix).
[rule.error-naming]
# errorf rule warns on usage errors.New(fmt.Sprintf()) instead of fmt.Errorf()
[rule.errorf]
# exported rule ensure naming and commenting conventions on exported symbols.
[rule.exported]
# flag-parameter rule warns on boolean parameters that create a control coupling.
[rule.flag-parameter]
# get-return rule warns on getters that do not yield any result.
[rule.get-return]
# if-return rule warns redundant if when returning an error.
[rule.if-return]
# increment-decrement rule forces to use `i++` and `i--` instead of `i += 1` and `i -= 1`.
[rule.increment-decrement]
# indent-error-flow rule prevents redundant else statements.
[rule.indent-error-flow]
# modifies-value-receiver warns on assignments to value-passed method receivers.
[rule.modifies-value-receiver]
# package-comments rule ensures package commenting conventions.
[rule.package-comments]
# range rule prevents redundant variables when iterating over a collection.
[rule.range]
# range-val-in-closure warns if range value is used in a closure dispatched as goroutine.
[rule.range-val-in-closure]
# receiver-naming ensures conventions around the naming of receivers.
[rule.receiver-naming]
# redefines-builtin-id warns on redefinitions of built-in (constants, variables, function and types) identifiers,
# like `true := "false"` etc.
[rule.redefines-builtin-id]
# rule.superfluous-else prevents redundant else statements (extends indent-error-flow). Checks for `if-then-else`where
# the then block ends with branching statement like `continue`, `break`, or `goto`.
[rule.superfluous-else]
# rule.struct-tag checks common struct tags like `json`, `xml`, `yaml`.
[rule.struct-tag]
# time-naming rule conventions around the naming of time variables. Like not to use unit suffixes (sec, min etc.) in
# naming variables of type `time.Time` or `time.Duration`.
[rule.time-naming]
# unexported-return rule warns when a public return is from unexported type.
[rule.unexported-return]
# unnecessary-stmt suggests removing or simplifying unnecessary statements like breaks at the end of cases or return at
# the end of bodies of functions returning nothing.
[rule.unnecessary-stmt]
# unreachable-code rule warns on the unreachable code.
[rule.unreachable-code]
# unused-parameter rule suggests to rename or remove unused function parameters.
[rule.unused-parameter]
# var-declaration rule reduces redundancies around variable declaration.
[rule.var-declaration]
# var-naming checks naming rules.
[rule.var-naming]
# waitgroup-by-value rule warns on functions taking `sync.WaitGroup` as a by-value parameter.
[rule.waitgroup-by-value]