fix(format): drop a temperature's space before its trailing zeros #168
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!168
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/format-temperature-zeros"
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?
Problem
The formatter removed trailing zeros (rule 4) before the space in front of
°(rule 5). Rule 4's patterns allow no space before the unit, so^{160.0 °C}only became^{160.0°C}, and a second run was needed to reach^{160°C}.Fix
dev/1.5small.packages/format/tests/formatter.test.ts:^{160.0 °C}is fixed in one run (one spacing fix, one zero removed, a second run changes nothing), and^{37.50 °C}keeps the zero that matters (^{37.5°C}).Checks
bun test: 2498 pass (afterbun run buildfrommain), including the LSP formatting-parity test.bun run lint, typecheck of@gram-lang/format,bun run conformance(107 cases).format-temperature-zeros.md(@gram-lang/format, patch).Once merged,
mainis merged intodev/1.5as usual. That merge conflicts inpackages/format/src/index.ts(dev/1.5rewrote rule 4 for the decimal comma and added rule 4b): keepdev/1.5's rules and move rule 5 above rule 4. The test file conflict is two blocks appended at the end: keep both.