MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / runCheckerCollect

Function runCheckerCollect

src/agent/verification.ts:200–218  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

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. */
200async 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.

Callers 1

verifyTouchedFilesFunction · 0.85

Calls 3

runCheckerFunction · 0.85
checkerTextFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected