Commit ea5519a
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 125 | | |
137 | 126 | | |
138 | 127 | | |
| |||
145 | 134 | | |
146 | 135 | | |
147 | 136 | | |
148 | | - | |
149 | 137 | | |
150 | 138 | | |
151 | 139 | | |
| |||
0 commit comments