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 @@
11#!/usr/bin/env bash
22#
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.
55#
66# Enable once per clone:
77# git config core.hooksPath .githooks
@@ -111,13 +111,12 @@ for sha in $needs_audit; do
111111done
112112
113113if [ -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:"
115115 for sha in $missing; do
116 echo " $(git log -1 --format='%h %s' "$sha")" >&2
116 echo " $(git log -1 --format='%h %s' "$sha")"
117117 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
121120fi
122121
123122echo "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
131131**`.textClipped`, `.dynamicType`, `.hitRegion`, `.elementDetection`,
132132`.sufficientElementDescription`, `.trait`** on the empty-state test suite. A
133133named 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.
135135
136136Three deliberate carve-outs, each with its evidence:
137137
@@ -583,8 +583,8 @@ no single number is correct on both.
583583
584584The audit therefore runs locally, across both ends, via
585585`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
587pass of both.
586installed. The audit is optional: the pre-push hook in `.githooks/` warns when
587a push has no recorded pass of both, and does not block it.
588588
589589There is no CI job. The GitHub Actions workflow that used to run this suite on
590590the 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.
619619git config core.hooksPath .githooks
620620```
621621
622Runs the complexity ratchet, then refuses the push unless the tree being pushed
623has a recorded audit pass, when Swift, asset, or project files changed. Bypass
624with `git push --no-verify`.
622Runs the complexity ratchet, then warns when Swift, asset, or project files
623changed and the tree being pushed has no recorded audit pass. The warning does
624not block the push.
625625
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
627627tree with no tracked changes and no untracked Swift, asset or project files,
628628appends `HEAD^{tree}` to `a11y-audit-passed` in the common git dir when both
629629tiers pass. A squash or rebase that keeps the tree keeps the pass.
README.org +3 −2
@@ -71,8 +71,9 @@ accessibility audit.
7171#+end_src
7272
7373findings 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
75Swift or project changes without one:
74clean tree is recorded. the audit is optional: the pre-push hook warns
75when a push of Swift or project changes has no recorded pass, and does
76not block it:
7677
7778#+begin_src sh
7879git config core.hooksPath .githooks