fix(format): decide on frontmatter after the repairs, so a second pass changes nothing #290
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!290
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/format-frontmatter-after-repairs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up of #285 (#284), unreleased: no new changeset, the pending
format-fenced-block-not-frontmatterone still describes the behavior.#285 decided whether the fenced block opening the file is frontmatter by parsing the raw source, before the repairs (rules 6-8). When only the repairs make the file readable (
^ < @eggs), the first pass kept the block as frontmatter, and the second pass, on repaired text, found spans inside it and formatted it as body:format-idempotentviolation (fuzz seed 1572729094, index 1472), e.g.au Jean@Example.comlowercased only at the second pass.repair(). The body of the textual split is repaired first, then the repaired text is parsed once: a span inside the fenced block makes it body, repaired in turn and parsed again. A real frontmatter now costs no extra parse (#285 parsed twice).packages/format/tests/formatter.test.tsandfuzz/regressions/284-fenced-block-repaired.gram(both fail on main).Checks: 3939 pass / 1 skip / 0 fail, conformance 142/142 and 24/24 with no golden change, typecheck, biome,
deprecations:check, fuzz 50k (seed 3061316216, 0 signature); the earlier fuzz inputs of #284 and #286 still pass. Audit 127 (126 on main): the new flag is the test's deliberate^ < @eggsparse failure, the input the repair exists for.