Skip to content

Commit

Permalink
rename assertion.SetVerbose to assertion.SetDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Hitchon committed Apr 19, 2018
1 parent 240efc3 commit b142f22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions assertion/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package assertion
import "fmt"

var (
isVerbose = false
isDebug = false
)

// SetVerbose turns verbose logging on or off
func SetVerbose(b bool) {
isVerbose = b
// SetDebug turns verbose logging on or off
func SetDebug(b bool) {
isDebug = b
}

// Debugf prints a formatted string when verbose logging is turned on
func Debugf(format string, args ...interface{}) {
if isVerbose == false {
if isDebug == false {
return
}
fmt.Printf(format, args...)
Expand Down
6 changes: 3 additions & 3 deletions cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type (
func main() {
var rulesFilenames arrayFlags
terraformBuiltInRules := flag.Bool("terraform", false, "Use built-in rules for Terraform")
verboseLogging := flag.Bool("verbose", false, "Verbose logging")
debug := flag.Bool("debug", false, "Debug logging")
flag.Var(&rulesFilenames, "rules", "Rules file, can be specified multiple times")
tags := flag.String("tags", "", "Run only tests with tags in this comma separated list")
ids := flag.String("ids", "", "Run only the rules in this comma separated list")
Expand All @@ -43,8 +43,8 @@ func main() {
return
}

if *verboseLogging == true {
assertion.SetVerbose(true)
if *debug == true {
assertion.SetDebug(true)
}

if *validate {
Expand Down
1 change: 0 additions & 1 deletion linter/terraform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func TestTerraformVariables(t *testing.T) {
t.Error("Expecting TestTerraformLinter.Load to not return an error")
}
resources, err := loader.ReplaceVariables(loaded.Resources, loaded.Variables)
assertion.SetVerbose(false)
if err != nil {
t.Error("Expecting TestTerraformLinter.ReplaceVariables to not return an error")
}
Expand Down

0 comments on commit b142f22

Please sign in to comment.