Repository navigation
yaml mode, the edge-growth character clause, and spec 1.3.0 - #8
Merged
Merged
Conversation
Three things, in descending order of how much they matter. The edge-growth rule of modes.md 3.4 tested `r > d`, which is not the rule its own normative sentence states and misses `r == d`. `dashes` P3 admits a run of three, so `---` -> U+0020 en-dash U+0020 is 3 -> 3 and lands U+0020 on both span extremities with the length test seeing nothing. In `html`, shipped at v1.0.0, that turned `a<em>---</em>b` into `a<em> – </em>b` — an element beginning and ending with a space it never held. `filter_boundary_edits` now tests the replacement's first and last code point as well as its length. `yaml` mode (modes.md 3.8): a specified left-to-right scan in `_modes/yaml.py`, no parser, plus a required `keys` option naming which mapping keys hold prose. YAML is a data format with islands of prose in it — the inverse of HTML and Markdown — and nothing in its syntax separates `description:` from `run:`. `polytypo.yaml` joins the per-mode entry points and is the lightest of the four, since it has no parser to import. The vendored spec moves to 1.3.0, complete: nineteen locales, `es` and `it` included. One canonical fixture had to be repaired first — `unknown-es` asserted that `es` throws POLYTYPO_UNKNOWN_LOCALE while the registry carried it, which contradicts locale-resolution.md 3.4 step 1 and would have failed every runtime on contact. Twelve resolution cases were added with it: the eight locales carried since 1.2.0 had no resolution coverage at all. 1545 tests, ruff and mypy clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ruff format checks Python code blocks in Markdown too, and CI runs it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three things, in descending order of how much they matter.
The
modes.md§3.4 repair — live in shippedhtmlThe edge-growth filter tested
r > d. That is not the rule its own normative sentence states, and it missesr = d:dashesP3 admits a run of three, so---→␣–␣is 3 → 3 and lands U+0020 on both extremities with the length test seeing nothing.filter_boundary_editsnow tests the replacement's first and last code point as well as its length.yamlmodeA specified left-to-right scan, no parser — two of the five ecosystems' YAML libraries cannot report the source offsets the round-trip guarantee needs, so the locator is written per runtime like a rule. It takes a required
keysoption naming which mapping keys hold prose, no default, exactly asmarkdownrequiresdialect.polytypo.yamljoins the per-mode entry points and is the lightest of the four: it has no parser to import.Spec 1.3.0, vendored complete
Nineteen locales,
esanditincluded. One canonical fixture had to be repaired first:unknown-esasserted thatesthrowsPOLYTYPO_UNKNOWN_LOCALEwhile the registry carried it — a direct contradiction oflocale-resolution.md§3.4 step 1 that would have failed every runtime the moment 1.3.0 was vendored. Twelve resolution cases were added with it; the eight locales carried since 1.2.0 had no resolution coverage at all.Verification
1545 tests, ruff and mypy clean, every canonical 1.3.0 fixture green including all 49 new
yamland edge-growth cases.🤖 Generated with Claude Code