1
0
Fork 0
mirror of https://github.com/vbatts/git-validation.git synced 2024-12-28 08:16:31 +00:00

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 <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-05-03 15:13:09 -04:00
parent 8f67e735ee
commit 3bad322461
2 changed files with 8 additions and 1 deletions

View file

@ -66,7 +66,7 @@ func main() {
} }
_, fail := runner.Results.PassFail() _, fail := runner.Results.PassFail()
if fail > 0 { if fail > 0 {
fmt.Printf("%d issues to fix\n", fail) fmt.Printf("%d commits to fix\n", fail)
os.Exit(1) os.Exit(1)
} }

View file

@ -77,6 +77,13 @@ func (r *Runner) Run() error {
r.Results = append(r.Results, vr...) r.Results = append(r.Results, vr...)
_, fail := vr.PassFail() _, fail := vr.PassFail()
if os.Getenv("QUIET") != "" { 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. // everything else in the loop is printing output.
// If we're quiet, then just continue // If we're quiet, then just continue
continue continue