add a 1000 candidate file capping safeguard to discovery walk

This commit is contained in:
rarebuffalo
2026-06-15 01:02:00 +05:30
parent 584ba8b149
commit aeef04ee00

View File

@@ -150,6 +150,12 @@ def discover_files(root: Path, cfg: CLIConfig) -> list[Path]:
continue
candidates.append(p)
# Capping safeguard: limit to 1000 candidate files
if len(candidates) >= 1000:
break
if len(candidates) >= 1000:
break
return sorted(candidates)