You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 078a9d7
Browse filesBrowse the repository at this point in the historyBrowse files
Large-scale improvement, back to a new check rather than performance -
the last several rounds fixed history I/O; this one follows the same
design as check #9/#10 (design -> implement -> mutation-verify ->
fmt/clippy -> commit -> push -> confirm CI).
check_input_type_mismatch reuses check_autofill_hints' exact mechanism
(guess a field's semantic purpose from its label with a regex) but
checks the type attribute instead of autocomplete. A field labeled
like an email address or phone number left as type="text" (or
untyped, which is the same thing) gets no native format validation,
and - the real cost that makes this worth a mobile-usability-focused
tool - the wrong virtual keyboard on a phone: a full alphabetic layout
instead of an email-optimized or numeric-telephone one.
Deliberately scoped to only email and phone: both have a well-
supported dedicated input type AND an unambiguous label pattern.
Something like a ZIP code was deliberately left out - type="number"
would actively be the wrong fix there, since it strips a leading zero
and adds spinner arrows nobody wants on a ZIP field. A heuristic guess
from label wording, same as Autofill hints, so a mismatch is a Warn,
not a Fail.
New fixture (fixtures/input-type-mismatch-form.html) covers both true
positives (email + phone guessed, left as text) and the two negative
cases that matter: a field with the identical email-guess label
wording but correctly wired as type="email" (no false positive on a
form that got it right), and a field matching neither guess.
Verified with a mutation test: widened the check's own field selector
to also match already-correctly-typed type="email" fields, confirmed
the new integration test failed exactly as predicted (the correctly-
wired "Confirm email" field got flagged, breaking the false-positive
assertion), then restored the fix.
cargo fmt/clippy -D warnings clean, full suite green (159 tests).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments