better recon info in certain (nested) situations
All checks were successful
port-to-omp / port (push) Successful in 6s

This commit is contained in:
2026-08-12 21:59:49 -04:00
parent 3fd386a637
commit 63c2f73a5e
7 changed files with 84 additions and 41 deletions

View File

@@ -36,7 +36,6 @@
* @module pygienium/checks/todos
*/
import { readdirSync } from "node:fs";
import { readFile, readdir, stat } from "node:fs/promises";
import { join, relative } from "node:path";
import { loadRunState } from "../run-state.js";
@@ -46,6 +45,7 @@ import {
type CheckScope,
} from "./registry.js";
import {
hasScopeSources,
isScopeSource,
SCOPE_EXCLUDE_DIRS,
scopeRulesMarkdown,
@@ -405,23 +405,13 @@ function renderFindings(
* with zero source files gives the scanner nothing to analyse.
*/
function todosGate(cwd: string): string | undefined {
let found = false;
try {
const entries = readdirSync(cwd);
for (const entry of entries) {
if (isScopeSource(entry)) {
found = true;
break;
}
}
if (hasScopeSources(cwd)) return undefined;
} catch {
// unreadable cwd → let the agent decide; don't block.
return undefined;
}
if (!found) {
return "no source files found to inspect";
}
return undefined;
return "no source files found to inspect";
}
/**