Skip to content

Commit ea5519a

Browse files
committed
Remove redundant home page check
The extra flags are not needed, due to the script's 3-layer design: Layer 1: axe-core's incomplete category axe-core (the underlying engine) classifies every rule result into one of three buckets: - violations — axe is certain this is a failure - passes — axe is certain this passes - incomplete — axe cannot determine the outcome programmatically The canonical example is color contrast on a background image. WCAG requires a 4.5:1 contrast ratio, and axe can compute that ratio trivially when both colors are CSS values. But when the background is an <img> or a background-image, axe can't know the actual pixel colors under the text without rendering and sampling the image. So it marks the result as incomplete and sets a needsFurtherReview: true flag, meaning "a human should check this manually." Layer 2: pa11y surfaces incomplete as errors anyway pa11y's axe runner maps axe's incomplete results into the same JSON array as definitive violations, giving them type: "error". The only distinguishing field is runnerExtras.needsFurtherReview: true. pa11y also exits with code 2 (failure) when there are any such items, even if they're all needsFurtherReview. So pa11y, by itself, cannot cleanly distinguish "definitely broken" from "maybe broken, check manually." Layer 3: the Python filter The script works around this by ignoring pa11y's exit code entirely, capturing the JSON output with $(...) and counting errors itself: real = [i for i in data if i.get('type') == 'error' and not i.get('runnerExtras', {}).get('needsFurtherReview', False)] Only items that are both type == "error" AND needsFurtherReview == False count toward the failure total. The needsFurtherReview items appear in the JSON but are silently discarded.
1 parent fd262ea commit ea5519a

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

_bin/check-accessibility.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,6 @@ except Exception as e:
122122
fi
123123
}
124124

125-
check_home() {
126-
# Home page: ignore color-contrast and aria-required-children (all image-background
127-
# issues flagged needsFurtherReview=true by axe, but pa11y --runner axe still exits
128-
# non-zero for them). Also ignore link-in-text-block in the hero section.
129-
check_url "$BASE/index.html" \
130-
--ignore "color-contrast" \
131-
--ignore "aria-required-children" \
132-
--ignore "link-in-text-block" \
133-
--ignore "nested-interactive"
134-
}
135-
136125
if [ "$#" -eq 0 ]; then
137126
# Default: check every page in _site/.
138127
tmplist=$(mktemp)
@@ -145,7 +134,6 @@ if [ "$#" -eq 0 ]; then
145134
rm -f "$tmplist"
146135
else
147136
# Check the home page plus each explicitly requested path.
148-
check_home
149137
while [ "$#" -gt 0 ]; do
150138
check_url "$BASE/$1" \
151139
--ignore "nested-interactive"

0 commit comments

Comments
 (0)