From 3bad322461239ee93e1efa12db1f330506626777 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 3 May 2016 15:13:09 -0400 Subject: [PATCH] main: add a bit of output to -q ideally `-q` would be only return code of 0 or non-zero, but it already had some output. This adds only failed tests per commit. Signed-off-by: Vincent Batts --- main.go | 2 +- validate/runner.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7d90296..3de1fd9 100644 --- a/main.go +++ b/main.go @@ -66,7 +66,7 @@ func main() { } _, fail := runner.Results.PassFail() if fail > 0 { - fmt.Printf("%d issues to fix\n", fail) + fmt.Printf("%d commits to fix\n", fail) os.Exit(1) } diff --git a/validate/runner.go b/validate/runner.go index 2385f5e..eea61fb 100644 --- a/validate/runner.go +++ b/validate/runner.go @@ -77,6 +77,13 @@ func (r *Runner) Run() error { r.Results = append(r.Results, vr...) _, fail := vr.PassFail() if os.Getenv("QUIET") != "" { + if fail != 0 { + for _, res := range vr { + if !res.Pass { + fmt.Printf(" %s - FAIL - %s\n", commit["abbreviated_commit"], res.Msg) + } + } + } // everything else in the loop is printing output. // If we're quiet, then just continue continue