diff --git a/aws/ruleset.go b/aws/ruleset.go index 49589876..16d21af5 100644 --- a/aws/ruleset.go +++ b/aws/ruleset.go @@ -1,8 +1,6 @@ package aws import ( - "fmt" - "github.com/terraform-linters/tflint-plugin-sdk/hclext" "github.com/terraform-linters/tflint-plugin-sdk/tflint" ) @@ -43,17 +41,7 @@ func (r *RuleSet) ApplyConfig(body *hclext.BodyContent) error { return nil } -// Check runs inspections for each rule with the custom AWS runner. -func (r *RuleSet) Check(rr tflint.Runner) error { - runner, err := NewRunner(rr, r.config) - if err != nil { - return err - } - - for _, rule := range r.EnabledRules { - if err := rule.Check(runner); err != nil { - return fmt.Errorf("Failed to check `%s` rule: %s", rule.Name(), err) - } - } - return nil +// NewRunner injects a custom AWS runner +func (r *RuleSet) NewRunner(runner tflint.Runner) (tflint.Runner, error) { + return NewRunner(runner, r.config) }