215. cpl fmt line breaking, and what the formatter does not do (2026-11-22)
- Decision. One layout, no options. A line over 100 columns breaks
only inside brackets (outside them a newline ends the statement): the
widest bracket holding a list, or at least
MIN_BREAK_WIDTHcolumns, is opened one element per line with a trailing comma, and each element is laid out again by the same rule. A call's arguments, a closure argument included, are elements like any other:xs.filter(/ closure /).count(..), no hugging of a last closure and no breaks at.or at operators. A closure body written{ a; b }stays on its line: turning it into an indented=>block would change tokens, and fmt only changes whitespace and trailing commas.read (T, U)keeps the source's spacing (only the source tells a call from a type operand);read [n]T,by: .len,impl<T>,lends(a),without (u)follow the spec's spelling. - Not done (debt against spec/tools/fmt-lint.md). Sorting
uselines changed diagnostics:examples/local-lib/spec/worked.cpreports one E0206 for a missingstd.specimported first and four once it sorts after thelib.spec.*imports, so sorting waits for the checker to report a missing module once.withlines are not moved (that changes what they cover) and the line-1 stamp is not added (it shifts every golden line number). Test inputs (spec/conformance/, diagnostics fixtures, editor grammar tests) are not bulk-formatted: their layout is what they test (trailing-comma.cp,bracket-layout.cp,space-indent-block.cp).scripts/fmt_check.py(thefmt_corpusstage ofscripts/check.sh) checks instead that formatting every tracked.cpfile is idempotent and keepscpl checkcodes andcpl runoutput. - Reverse. Hug a last closure argument in
layout::seq; sortuseruns incpl_fmt::formatonce the E0206 cascade is fixed; drop thefmt_corpusstage fromSTAGESandcheck.sh.