Skip to content

Commit

Permalink
Fix line count for errors on tap output
Browse files Browse the repository at this point in the history
  • Loading branch information
skos-ninja committed Nov 6, 2020
1 parent 38668c6 commit ca095c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kubeval/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,13 @@ func (j *tapOutputManager) Flush() error {
} else if r.Status == "skipped" {
j.logger.Print("ok ", count, " #skip - ", r.Filename, kindMarker)
} else if r.Status == "invalid" {
for _, e := range r.Errors {
for i, e := range r.Errors {
j.logger.Print("not ok ", count, " - ", r.Filename, kindMarker, " - ", e)
count = count + 1

// We have to skip adding 1 if it's the last error
if len(r.Errors) != i+1 {
count = count + 1
}
}
}
}
Expand Down

0 comments on commit ca095c2

Please sign in to comment.