Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runner: non-zero exit code when a linter produces a panic #1979

Merged
merged 1 commit into from May 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/lint/runner.go
Expand Up @@ -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())
}
}
}()
Expand Down