diff --git a/.tools/validate.go b/.tools/validate.go index bf337dfff..e9c090e39 100644 --- a/.tools/validate.go +++ b/.tools/validate.go @@ -68,26 +68,30 @@ func main() { } results := ValidateResults{} - for _, commit := range c { - fmt.Printf(" * %s %s ... ", commit["abbreviated_commit"], commit["subject"]) + + if *flVerbose { + fmt.Println("TAP version 13") + fmt.Printf("1..%d\n", len(c)*len(DefaultRules)) + } + for i, commit := range c { + fmt.Printf("# %s %s ... ", commit["abbreviated_commit"], commit["subject"]) vr := ValidateCommit(commit, DefaultRules) results = append(results, vr...) if _, fail := vr.PassFail(); fail == 0 { fmt.Println("PASS") - if *flVerbose { - for _, r := range vr { - if r.Pass { - fmt.Printf(" - %s\n", r.Msg) - } - } - } } else { fmt.Println("FAIL") - // default, only print out failed validations - for _, r := range vr { - if !r.Pass { - fmt.Printf(" - %s\n", r.Msg) + } + for j, r := range vr { + if *flVerbose { + if r.Pass { + fmt.Printf("ok") + } else { + fmt.Printf("not ok") } + fmt.Printf(" %d - %s\n", i*len(DefaultRules)+j+1, r.Msg) + } else if !r.Pass { + fmt.Printf("not ok - %s\n", r.Msg) } } }