From 26a3a16d7c5d615337482df551ce74d0dfd78de6 Mon Sep 17 00:00:00 2001 From: Thomas Molines Date: Tue, 23 Jun 2020 16:48:16 +0200 Subject: [PATCH] Load terraform builtin rules before adding exceptions --- cli/app.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/app.go b/cli/app.go index 7d8eaf3..06d04d9 100644 --- a/cli/app.go +++ b/cli/app.go @@ -136,7 +136,6 @@ func main() { fmt.Printf("Failed to load rules: %v\n", err) os.Exit(-1) } - ruleSets = addExceptions(ruleSets, profileOptions.Exceptions) // Same rule set applies to both TerraformBuiltInRules and Terraform11BuiltInRules // loadBuiltInRuleSet can be called recursively against a directory, as done here, // or can be called against a single file, as done with lint-rule.yml @@ -152,6 +151,9 @@ func main() { fmt.Println("No rules") os.Exit(-1) } + + ruleSets = addExceptions(ruleSets, profileOptions.Exceptions) + os.Exit(applyRules(ruleSets, configFilenames, linterOptions, DefaultReportWriter{Writer: os.Stdout})) }