0018. Semicolon-free canonical formatting
- Status: Accepted; blanket newline suppression superseded by 0032
- Date: 2026-10-30
- Plan: M2.4
- Review: Authoring, tooling and context; The biggest risk: models have never seen Tenon
- Owner review: Maintainer decided 2026-10-30 that semicolons should be left out.
Context
T0
compiled and ran all 30 programs successfully, but 0/30 passed
fmt --check. Models generally wrote
newline-terminated statements without semicolons and short
if expressions on one line; the formatter added
semicolons and expanded those expressions.
Decision
Maintainer chooses semicolon-free canonical formatting: omit
statement semicolons except where needed to separate statements
inside parentheses, where newlines are ignored. Keep short
if/else expressions on one line when
they fit within 100 columns including indentation; otherwise
expand them. Eligible branches each contain one expression
statement without blocks, nested if or interpolation;
there must be a block else (not else if)
and no comment in the if's span. An else if chain is
never inlined, so a chain keeps one multi-line layout. Preserve
syntax and comment text/order.
This supersedes ADR-0015 for the semicolon and one-line-if rules only; the rest stands. This changes canonical formatting, not accepted syntax.
Alternatives considered
- Keep semicolons and expanded branches — retains the previous formatter style but differs from the style observed in T0.
- Preserve input layout or offer options — reduces rewrites but loses the predictable single canonical form required by M2.4.
Consequences
M2.4's formatter revision follows the observed style while retaining required separators inside parentheses, idempotence and the other ADR-0015 guarantees. Canonical examples and formatter checks must reflect the revised style; T0's historical results remain evidence, not a measurement of the revised formatter.