MCPcopy Create free account
hub / github.com/idank/explainshell / _scan_audit_run

Function _scan_audit_run

tests/evals/render/render_eval.py:1303–1324  ·  view source on GitHub ↗
(
    run_dir: Path,
    summary: dict[str, Any],
    rules: list[tuple[str, AuditScanner, str]],
)

Source from the content-addressed store, hash-verified

1301
1302
1303def _scan_audit_run(
1304 run_dir: Path,
1305 summary: dict[str, Any],
1306 rules: list[tuple[str, AuditScanner, str]],
1307) -> dict[str, list[tuple[str, int, list[str]]]]:
1308 results: dict[str, list[tuple[str, int, list[str]]]] = {
1309 rule_id: [] for rule_id, _, _ in rules
1310 }
1311 for page in summary["pages"]:
1312 stem = page["stem"]
1313 md_path = run_dir / "markdown" / f"{stem}.md"
1314 html_path = run_dir / "html" / f"{stem}.html"
1315 if not md_path.is_file() or not html_path.is_file():
1316 continue
1317 markdown = md_path.read_text()
1318 html = html_path.read_text()
1319 for rule_id, scanner, _ in rules:
1320 hits = scanner(markdown, html)
1321 if hits:
1322 examples = [snippet for _, snippet in hits[:3]]
1323 results[rule_id].append((page["path"], len(hits), examples))
1324 return results
1325
1326
1327def _print_audit_report(

Callers 1

audit_runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected