@@ -115,17 +115,17 @@ func (r *Runner) Run(ctx context.Context, linters []*linter.Config) ([]result.Is
115115 )
116116
117117 for _ , lc := range linters {
118- sw .TrackStage (lc .Name (), func () {
119- linterIssues , err := r .runLinterSafe (ctx , r .lintCtx , lc )
120- if err != nil {
121- lintErrors = errors .Join (lintErrors , fmt .Errorf ("can't run linter %s" , lc .Linter .Name ()), err )
122- r .Log .Warnf ("Can't run linter %s: %v" , lc .Linter .Name (), err )
118+ linterIssues , err := timeutils .TrackStage (sw , lc .Name (), func () ([]result.Issue , error ) {
119+ return r .runLinterSafe (ctx , r .lintCtx , lc )
120+ })
121+ if err != nil {
122+ lintErrors = errors .Join (lintErrors , fmt .Errorf ("can't run linter %s" , lc .Linter .Name ()), err )
123+ r .Log .Warnf ("Can't run linter %s: %v" , lc .Linter .Name (), err )
123124
124- return
125- }
125+ continue
126+ }
126127
127- issues = append (issues , linterIssues ... )
128- })
128+ issues = append (issues , linterIssues ... )
129129 }
130130
131131 return r .processLintResults (issues ), lintErrors
@@ -188,9 +188,7 @@ func (r *Runner) processLintResults(inIssues []result.Issue) []result.Issue {
188188 // finalize processors: logging, clearing, no heavy work here
189189
190190 for _ , p := range r .Processors {
191- sw .TrackStage (p .Name (), func () {
192- p .Finish ()
193- })
191+ sw .TrackStage (p .Name (), p .Finish )
194192 }
195193
196194 if issuesBefore != issuesAfter {
@@ -216,10 +214,8 @@ func (r *Runner) printPerProcessorStat(stat map[string]processorStat) {
216214
217215func (r * Runner ) processIssues (issues []result.Issue , sw * timeutils.Stopwatch , statPerProcessor map [string ]processorStat ) []result.Issue {
218216 for _ , p := range r .Processors {
219- var newIssues []result.Issue
220- var err error
221- sw .TrackStage (p .Name (), func () {
222- newIssues , err = p .Process (issues )
217+ newIssues , err := timeutils .TrackStage (sw , p .Name (), func () ([]result.Issue , error ) {
218+ return p .Process (issues )
223219 })
224220
225221 if err != nil {
0 commit comments