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