Skip to content

Mark end regions by blank gaps - #254

Merged
russwyte merged 1 commit into
mainfrom
fmt/end-markers-by-blank-gap
Oct 25, 2026
Merged

russwyte merged 1 commit into
mainfrom
fmt/end-markers-by-blank-gap

Conversation

@russwyte

Copy link
Copy Markdown
Contributor

The line-count rule was inserting end for on long comprehensions that contain no blank line. End markers now follow blank gaps: a region gets one when it contains a blank line, and loses one when it does not.

rewrite.scala3.endMarker.insert.blankGaps.min = 1 and rewrite.scala3.endMarker.remove.blankGaps.max = 0 are scalafmt's implementation of scalameta/scalafmt#5064. Scalafmt is 3.11.5.

No for was inlined. The named fors here are used more than once, or they name parsed data or a generator passed onward (crossNeeds, byTarget, readings, gen, parts, ids).

scalafmtCheckAll passed. compile and Test/compile passed on the aggregate (shell, workflow, core, syntax, cli, central, aws, agent, plugin, docs, docsJS).

Scalafmt is 3.11.5. A long for with no blank line no longer picks up an end marker. Fors named only to avoid that marker are expressions again.
@russwyte
russwyte merged commit a838453 into main Oct 25, 2026
13 checks passed
@russwyte
russwyte deleted the fmt/end-markers-by-blank-gap branch October 25, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant