diff --git a/pkg/commands/run.go b/pkg/commands/run.go index 2569ce0b..0236b7e9 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -315,7 +315,11 @@ func (e *Executor) runAnalysis(ctx context.Context, args []string) ([]result.Iss return nil, err } - issues := runner.Run(ctx, enabledLinters, lintCtx) + issues, err := runner.Run(ctx, enabledLinters, lintCtx) + if err != nil { + return nil, err + } + fixer := processors.NewFixer(e.cfg, e.log, e.fileCache) return fixer.Process(issues), nil } diff --git a/pkg/lint/runner.go b/pkg/lint/runner.go index 62c97914..d42d1708 100644 --- a/pkg/lint/runner.go +++ b/pkg/lint/runner.go @@ -175,24 +175,26 @@ func (r Runner) printPerProcessorStat(stat map[string]processorStat) { } } -func (r Runner) Run(ctx context.Context, linters []*linter.Config, lintCtx *linter.Context) []result.Issue { +func (r Runner) Run(ctx context.Context, linters []*linter.Config, lintCtx *linter.Context) ([]result.Issue, error) { sw := timeutils.NewStopwatch("linters", r.Log) defer sw.Print() var issues []result.Issue + var runErr error for _, lc := range linters { lc := lc sw.TrackStage(lc.Name(), func() { linterIssues, err := r.runLinterSafe(ctx, lintCtx, lc) if err != nil { r.Log.Warnf("Can't run linter %s: %s", lc.Linter.Name(), err) + runErr = err return } issues = append(issues, linterIssues...) }) } - return r.processLintResults(issues) + return r.processLintResults(issues), runErr } func (r *Runner) processIssues(issues []result.Issue, sw *timeutils.Stopwatch, statPerProcessor map[string]processorStat) []result.Issue {