File tree 5 files changed +14
-3
lines changed 5 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ List of all available rules. The rules ported from `golint` are left unchanged a
401
401
| [ ` error-strings ` ] ( ./RULES_DESCRIPTIONS.md#error-strings ) | n/a | Conventions around error strings. | yes | no |
402
402
| [ ` error-naming ` ] ( ./RULES_DESCRIPTIONS.md#error-naming ) | n/a | Naming of error variables. | yes | no |
403
403
| [ ` exported ` ] ( ./RULES_DESCRIPTIONS.md#exported ) | n/a | Naming and commenting conventions on exported symbols. | yes | no |
404
- | [ ` if-return ` ] ( ./RULES_DESCRIPTIONS.md#if-return ) | n/a | Redundant if when returning an error. | yes | no |
404
+ | [ ` if-return ` ] ( ./RULES_DESCRIPTIONS.md#if-return ) | n/a | Redundant if when returning an error. | no | no |
405
405
| [ ` increment-decrement ` ] ( ./RULES_DESCRIPTIONS.md#increment-decrement ) | n/a | Use ` i++ ` and ` i-- ` instead of ` i += 1 ` and ` i -= 1 ` . | yes | no |
406
406
| [ ` var-naming ` ] ( ./RULES_DESCRIPTIONS.md#var-naming ) | whitelist & blacklist of initialisms | Naming rules. | yes | no |
407
407
| [ ` package-comments ` ] ( ./RULES_DESCRIPTIONS.md#package-comments ) | n/a | Package commenting conventions. | yes | no |
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ var defaultRules = []lint.Rule{
20
20
& rule.ExportedRule {},
21
21
& rule.VarNamingRule {},
22
22
& rule.IndentErrorFlowRule {},
23
- & rule.IfReturnRule {},
24
23
& rule.RangeRule {},
25
24
& rule.ErrorfRule {},
26
25
& rule.ErrorNamingRule {},
@@ -80,6 +79,7 @@ var allRules = append([]lint.Rule{
80
79
& rule.UnexportedNamingRule {},
81
80
& rule.FunctionLength {},
82
81
& rule.NestedStructs {},
82
+ & rule.IfReturnRule {},
83
83
}, defaultRules ... )
84
84
85
85
var allFormatters = []lint.Formatter {
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ var rules = []lint.Rule{
21
21
& rule.ExportedRule {},
22
22
& rule.VarNamingRule {},
23
23
& rule.IndentErrorFlowRule {},
24
- & rule.IfReturnRule {},
25
24
& rule.RangeRule {},
26
25
& rule.ErrorfRule {},
27
26
& rule.ErrorNamingRule {},
Original file line number Diff line number Diff line change
1
+ package test
2
+
3
+ import (
4
+ "testing"
5
+
6
+ "github.com/mgechev/revive/rule"
7
+ )
8
+
9
+ // TestIfReturn rule.
10
+ func TestIfReturn (t * testing.T ) {
11
+ testRule (t , "if-return" , & rule.IfReturnRule {})
12
+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments