Skip to content

Commit

Permalink
runner: non-zero exit code when a linter produces a panic (#1979)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed May 13, 2021
1 parent 589c49e commit 625445b
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 625445b

Please sign in to comment.