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
@@ -2,7 +2,7 @@
|
||||
import re
|
||||
from collections import namedtuple
|
||||
|
||||
from .common import Rule, blank_markup_comments
|
||||
from checks.common import Rule, blank_markup_comments
|
||||
|
||||
DOMAIN = "a11y"
|
||||
MARKUP_EXTS = (".html", ".htm", ".jsx", ".tsx", ".vue", ".svelte", ".astro")
|
||||
@@ -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))
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Static guardrails scan: the guardrails catalogue on the shared engine.
|
||||
"""Static guardrails scan: API, hosting, Supabase, messaging, functions,
|
||||
injection, exposure.
|
||||
|
||||
See scanner.py for the modes and exit codes.
|
||||
"""
|
||||
@@ -7,7 +8,7 @@ import sys
|
||||
|
||||
import scanner
|
||||
from checks import (
|
||||
a11y, apis, exposure, functions, hosting, injection, messaging, supabase,
|
||||
apis, exposure, functions, hosting, injection, messaging, supabase,
|
||||
)
|
||||
|
||||
CATALOGUE = scanner.Catalogue(
|
||||
@@ -15,7 +16,6 @@ CATALOGUE = scanner.Catalogue(
|
||||
domains={
|
||||
"api": apis,
|
||||
"hosting": hosting,
|
||||
"a11y": a11y,
|
||||
"supabase": supabase,
|
||||
"messaging": messaging,
|
||||
"functions": functions,
|
||||
@@ -23,7 +23,7 @@ CATALOGUE = scanner.Catalogue(
|
||||
"exposure": exposure,
|
||||
},
|
||||
rule_domains={
|
||||
"API": "api", "HOST": "hosting", "A11Y": "a11y", "SB": "supabase",
|
||||
"API": "api", "HOST": "hosting", "SB": "supabase",
|
||||
"MSG": "messaging", "FN": "functions",
|
||||
"INJ": "injection", "EXP": "exposure",
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user