Skip to content

Commit

Permalink
report error when no files or rules given
Browse files Browse the repository at this point in the history
  • Loading branch information
lhitchon committed Oct 6, 2018
1 parent caff054 commit 64244a9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,18 @@ func main() {
builtInRuleSet, err := loadBuiltInRuleSet("assets/terraform.yml")
if err != nil {
fmt.Printf("Failed to load built-in rules for Terraform: %v\n", err)
return
os.Exit(-1)
}
ruleSets = append(ruleSets, builtInRuleSet)
}
if len(ruleSets) == 0 {
fmt.Println("No rules")
os.Exit(-1)
}
if len(configFilenames) == 0 {
fmt.Println("No files to lint")
os.Exit(-1)
}
os.Exit(applyRules(ruleSets, configFilenames, linterOptions, DefaultReportWriter{Writer: os.Stdout}))
}

Expand Down

0 comments on commit 64244a9

Please sign in to comment.