forked from bchanot/claude
feat(a11y): standalone scanner on the shared engine (A11Y-CLEAR / A11Y-NO-NEW); guardrails drops the a11y domain
This commit is contained in:
1 parent
b4ef6ae359
commit
6e79d182e3
7 files changed
+213
-39
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Static accessibility scan: keyboard, visible focus, alt text, labels.
|
||||
|
||||
Runs the guardrails scan engine (skills/guardrails/scripts/scanner.py) on
|
||||
the a11y catalogue. Same options and exit codes; markers A11Y-CLEAR and
|
||||
A11Y-NO-NEW.
|
||||
"""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ENGINE = Path(__file__).resolve().parents[2] / "guardrails" / "scripts"
|
||||
if not ENGINE.is_dir():
|
||||
print(f"usage error: scan engine missing at {ENGINE} "
|
||||
"(the guardrails skill must be installed)", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
sys.path.insert(0, str(ENGINE))
|
||||
|
||||
import scanner # noqa: E402
|
||||
import a11y_checks # noqa: E402
|
||||
|
||||
CATALOGUE = scanner.Catalogue(
|
||||
name="a11y",
|
||||
domains={"a11y": a11y_checks},
|
||||
rule_domains={"A11Y": "a11y"},
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(scanner.main(sys.argv[1:], CATALOGUE))
|
||||
Reference in new issue
Block a user