@@ -115,17 +115,17 @@ func (r *Runner) Run(ctx context.Context, linters []*linter.Config) ([]result.Is
115
115
)
116
116
117
117
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 )
123
124
124
- return
125
- }
125
+ continue
126
+ }
126
127
127
- issues = append (issues , linterIssues ... )
128
- })
128
+ issues = append (issues , linterIssues ... )
129
129
}
130
130
131
131
return r .processLintResults (issues ), lintErrors
@@ -188,9 +188,7 @@ func (r *Runner) processLintResults(inIssues []result.Issue) []result.Issue {
188
188
// finalize processors: logging, clearing, no heavy work here
189
189
190
190
for _ , p := range r .Processors {
191
- sw .TrackStage (p .Name (), func () {
192
- p .Finish ()
193
- })
191
+ sw .TrackStage (p .Name (), p .Finish )
194
192
}
195
193
196
194
if issuesBefore != issuesAfter {
@@ -216,10 +214,8 @@ func (r *Runner) printPerProcessorStat(stat map[string]processorStat) {
216
214
217
215
func (r * Runner ) processIssues (issues []result.Issue , sw * timeutils.Stopwatch , statPerProcessor map [string ]processorStat ) []result.Issue {
218
216
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 )
223
219
})
224
220
225
221
if err != nil {
0 commit comments