Run ONE checker over its relevant touched files — whole-project, or once per file for * per-file linters (php -l). Returns raw diagnostics and whether the binary was missing.
( spec: CheckerSpec, cwd: string, relevant: string[], timeoutMs: number, signal?: AbortSignal, )
| 198 | /** Run ONE checker over its relevant touched files — whole-project, or once per file for |
| 199 | * per-file linters (php -l). Returns raw diagnostics and whether the binary was missing. */ |
| 200 | async function runCheckerCollect( |
| 201 | spec: CheckerSpec, cwd: string, relevant: string[], timeoutMs: number, signal?: AbortSignal, |
| 202 | ): Promise<{ diags: Diagnostic[]; unavailable: boolean }> { |
| 203 | if (spec.perFile) { |
| 204 | const diags: Diagnostic[] = []; |
| 205 | let anyRan = false; |
| 206 | for (const file of relevant) { |
| 207 | const r = await runChecker([...spec.argv, file], cwd, timeoutMs, signal); |
| 208 | if (r.spawnError || r.code === 127) { if (!anyRan) return { diags: [], unavailable: true }; continue; } |
| 209 | anyRan = true; |
| 210 | try { diags.push(...spec.parse(checkerText(spec, r))); } catch { /* skip this file */ } |
| 211 | } |
| 212 | return { diags, unavailable: !anyRan }; |
| 213 | } |
| 214 | const run = await runChecker(spec.argv, cwd, timeoutMs, signal); |
| 215 | if (run.spawnError || run.code === 127) return { diags: [], unavailable: true }; |
| 216 | try { return { diags: spec.parse(checkerText(spec, run)), unavailable: false }; } |
| 217 | catch { return { diags: [], unavailable: false }; } // parse failure → no diags, but the tool DID run |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * Capture a whole-project diagnostic baseline BEFORE the agent edits anything. |
no test coverage detected