File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ type BuiltinRuleSet struct {
11
11
Name string
12
12
Version string
13
13
Rules []Rule
14
+
15
+ EnabledRules []Rule
14
16
}
15
17
16
18
// RuleSetName is the name of the ruleset.
@@ -42,7 +44,7 @@ func (r *BuiltinRuleSet) ApplyConfig(config *Config) error {
42
44
43
45
// ApplyCommonConfig reflects common configurations regardless of plugins.
44
46
func (r * BuiltinRuleSet ) ApplyCommonConfig (config * Config ) {
45
- rules : = []Rule {}
47
+ r . EnabledRules = []Rule {}
46
48
47
49
if config .DisabledByDefault {
48
50
log .Printf ("[DEBUG] Only mode is enabled. Ignoring default plugin rules" )
@@ -57,15 +59,14 @@ func (r *BuiltinRuleSet) ApplyCommonConfig(config *Config) {
57
59
}
58
60
59
61
if enabled {
60
- rules = append (rules , rule )
62
+ r . EnabledRules = append (r . EnabledRules , rule )
61
63
}
62
64
}
63
- r .Rules = rules
64
65
}
65
66
66
67
// Check runs inspection for each rule by applying Runner.
67
68
func (r * BuiltinRuleSet ) Check (runner Runner ) error {
68
- for _ , rule := range r .Rules {
69
+ for _ , rule := range r .EnabledRules {
69
70
if err := rule .Check (runner ); err != nil {
70
71
return fmt .Errorf ("Failed to check `%s` rule: %s" , rule .Name (), err )
71
72
}
You can’t perform that action at this time.
0 commit comments