Skip to content

Commit d1d8095

Browse files
authored
Use NewRunner hook (#239)
1 parent 87bb0a3 commit d1d8095

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

google/ruleset.go

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package google
22

33
import (
4-
"fmt"
5-
64
"github.com/terraform-linters/tflint-plugin-sdk/hclext"
75
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
86
)
@@ -43,17 +41,7 @@ func (r *RuleSet) ApplyConfig(body *hclext.BodyContent) error {
4341
return nil
4442
}
4543

46-
// Check runs inspections for each rule with the custom Google runner.
47-
func (r *RuleSet) Check(rr tflint.Runner) error {
48-
runner, err := NewRunner(rr, r.config)
49-
if err != nil {
50-
return err
51-
}
52-
53-
for _, rule := range r.EnabledRules {
54-
if err := rule.Check(runner); err != nil {
55-
return fmt.Errorf("Failed to check `%s` rule: %s", rule.Name(), err)
56-
}
57-
}
58-
return nil
44+
// NewRunner injects a custom Google runner
45+
func (r *RuleSet) NewRunner(runner tflint.Runner) (tflint.Runner, error) {
46+
return NewRunner(runner, r.config)
5947
}

0 commit comments

Comments
 (0)