From 625445b1f559dc0a09bc9345dc39d50b64ec18bc Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Thu, 13 May 2021 23:49:08 +0200 Subject: [PATCH] runner: non-zero exit code when a linter produces a panic (#1979) --- pkg/lint/runner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/lint/runner.go b/pkg/lint/runner.go index c492f558020f..8882b9300960 100644 --- a/pkg/lint/runner.go +++ b/pkg/lint/runner.go @@ -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()) } } }()