Skip to content

Commit c9ced79

Browse files
authored
Merge pull request #261 from skos-ninja/master
Fix line count for errors on tap output
2 parents 529b532 + ca095c2 commit c9ced79

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kubeval/output.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,13 @@ func (j *tapOutputManager) Flush() error {
225225
} else if r.Status == "skipped" {
226226
j.logger.Print("ok ", count, " - ", r.Filename, kindMarker, " # SKIP")
227227
} else if r.Status == "invalid" {
228-
for _, e := range r.Errors {
228+
for i, e := range r.Errors {
229229
j.logger.Print("not ok ", count, " - ", r.Filename, kindMarker, " - ", e)
230-
count = count + 1
230+
231+
// We have to skip adding 1 if it's the last error
232+
if len(r.Errors) != i+1 {
233+
count = count + 1
234+
}
231235
}
232236
}
233237
}

0 commit comments

Comments
 (0)