runner: non-zero exit code when a linter produces a panic ()

This commit is contained in:
Ludovic Fernandez 2021-05-13 23:49:08 +02:00 committed by GitHub
parent 589c49efea
commit 625445b1f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -108,10 +108,10 @@ func (r *Runner) runLinterSafe(ctx context.Context, lintCtx *linter.Context,
err = fmt.Errorf("%s: %w", lc.Name(), pe)
// Don't print stacktrace from goroutines twice
lintCtx.Log.Warnf("Panic: %s: %s", pe, pe.Stack())
r.Log.Errorf("Panic: %s: %s", pe, pe.Stack())
} else {
err = fmt.Errorf("panic occurred: %s", panicData)
r.Log.Warnf("Panic stack trace: %s", debug.Stack())
r.Log.Errorf("Panic stack trace: %s", debug.Stack())
}
}
}()