Commit 66eb5de195
66eb5de195ceb258c138c561c704cf91e48f842c
parent: b2f98a74fd
Verified · cmc
cmc <hello@cleberg.net> · 2026-11-15 05:05 UTC
Make the accessibility audit optional at pre-push
The hook warns when a pushed tree has no recorded audit pass instead of refusing the push. The complexity ratchet still blocks.
Layout: unified · split
.githooks/pre-push
+6 −7
| @@ -1,7 +1,7 @@ |
| 1 | 1 | #!/usr/bin/env bash |
| 2 | 2 | # |
| 3 | | # Run the complexity ratchet, and refuse a push whose tree has no recorded |
| 4 | | # accessibility audit pass. |
| 3 | # Run the complexity ratchet, and warn when the pushed tree has no recorded |
| 4 | # accessibility audit pass. The audit is optional; the warning does not block. |
| 5 | 5 | # |
| 6 | 6 | # Enable once per clone: |
| 7 | 7 | # git config core.hooksPath .githooks |
| @@ -111,13 +111,12 @@ for sha in $needs_audit; do |
| 111 | 111 | done |
| 112 | 112 | |
| 113 | 113 | if [ -n "$missing" ]; then |
| 114 | | echo "pre-push: no recorded accessibility audit pass for:" >&2 |
| 114 | echo "pre-push: no recorded accessibility audit pass (optional) for:" |
| 115 | 115 | for sha in $missing; do |
| 116 | | echo " $(git log -1 --format='%h %s' "$sha")" >&2 |
| 116 | echo " $(git log -1 --format='%h %s' "$sha")" |
| 117 | 117 | done |
| 118 | | echo " Check it out with a clean tree, run './Scripts/audit-a11y.sh'," >&2 |
| 119 | | echo " then push again. Bypass with 'git push --no-verify'." >&2 |
| 120 | | exit 1 |
| 118 | echo " Run './Scripts/audit-a11y.sh' on a clean tree to check it." |
| 119 | exit 0 |
| 121 | 120 | fi |
| 122 | 121 | |
| 123 | 122 | echo "pre-push: accessibility audit passed on this tree" |
Docs/ACCESSIBILITY.txt
+7 −7
| @@ -131,7 +131,7 @@ With phases 1–5 landed, `AccessibilityAuditHarness.enforcedAuditTypes` enforce |
| 131 | 131 | **`.textClipped`, `.dynamicType`, `.hitRegion`, `.elementDetection`, |
| 132 | 132 | `.sufficientElementDescription`, `.trait`** on the empty-state test suite. A |
| 133 | 133 | named finding in any of these fails the test run — regressions in five phases of |
| 134 | | work are still gated locally and at the pre-push hook, not merely reported. |
| 134 | work fail the audit run, not merely reported. |
| 135 | 135 | |
| 136 | 136 | Three deliberate carve-outs, each with its evidence: |
| 137 | 137 | |
| @@ -583,8 +583,8 @@ no single number is correct on both. |
| 583 | 583 | |
| 584 | 584 | The audit therefore runs locally, across both ends, via |
| 585 | 585 | `Scripts/audit-a11y.sh` — on a machine that actually has an 18.x runtime |
| 586 | | installed. The pre-push hook in `.githooks/` refuses a push without a recorded |
| 587 | | pass of both. |
| 586 | installed. The audit is optional: the pre-push hook in `.githooks/` warns when |
| 587 | a push has no recorded pass of both, and does not block it. |
| 588 | 588 | |
| 589 | 589 | There is no CI job. The GitHub Actions workflow that used to run this suite on |
| 590 | 590 | the newest runtime has been removed, and with it the one check that no local run |
| @@ -619,11 +619,11 @@ so rather than implying floor coverage it does not have. |
| 619 | 619 | git config core.hooksPath .githooks |
| 620 | 620 | ``` |
| 621 | 621 | |
| 622 | | Runs the complexity ratchet, then refuses the push unless the tree being pushed |
| 623 | | has a recorded audit pass, when Swift, asset, or project files changed. Bypass |
| 624 | | with `git push --no-verify`. |
| 622 | Runs the complexity ratchet, then warns when Swift, asset, or project files |
| 623 | changed and the tree being pushed has no recorded audit pass. The warning does |
| 624 | not block the push. |
| 625 | 625 | |
| 626 | | Run the audit before pushing. `./Scripts/audit-a11y.sh` with no argument, on a |
| 626 | To check a tree, run the audit before pushing. `./Scripts/audit-a11y.sh` with no argument, on a |
| 627 | 627 | tree with no tracked changes and no untracked Swift, asset or project files, |
| 628 | 628 | appends `HEAD^{tree}` to `a11y-audit-passed` in the common git dir when both |
| 629 | 629 | tiers pass. A squash or rebase that keeps the tree keeps the pass. |
README.org
+3 −2
| @@ -71,8 +71,9 @@ accessibility audit. |
| 71 | 71 | #+end_src |
| 72 | 72 | |
| 73 | 73 | findings are reported, not enforced. a passing run of both tiers on a |
| 74 | | clean tree is recorded, and the optional pre-push hook refuses a push of |
| 75 | | Swift or project changes without one: |
| 74 | clean tree is recorded. the audit is optional: the pre-push hook warns |
| 75 | when a push of Swift or project changes has no recorded pass, and does |
| 76 | not block it: |
| 76 | 77 | |
| 77 | 78 | #+begin_src sh |
| 78 | 79 | git config core.hooksPath .githooks |