Skip to content

Mark end regions by blank gaps - #37

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

russwyte merged 2 commits into
mainfrom
fmt/end-markers-by-blank-gap

Conversation

@russwyte

Copy link
Copy Markdown
Collaborator

The line-count rule (insertEndMarkerMinLines = 10, removeEndMarkerMaxLines = 5) was inserting end for on long comprehensions that contain no blank line. End markers now follow blank gaps, which is scalafmt's implementation of scalameta/scalafmt#5064:

  • rewrite.scala3.endMarker.insert.blankGaps.min = 1
  • rewrite.scala3.endMarker.remove.blankGaps.max = 0

Scalafmt moved from 3.7.15 to 3.11.5. That jump also realigned a few definitions and dropped end markers on regions with no blank line. Regions that do contain a blank line still close with end (end for on the optimization and listener specs, end extension on Iso, end ActionResult).

No for was bound to a val only to dodge end for, so none were inlined. The example val run programs stay named because they are the ZIO app entry, not a one-shot binding.

scalafmtCheckAll passed. compile passed for core, example, and docsJS (JVM, Scala.js, and Native where those projects exist). Test/compile also passed for the formatted specs: core on JVM, Scala.js, and Native, and docs on the JVM.

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.
The 0.0.8 line is undersized for the binary break since 0.0.7.
@russwyte
russwyte merged commit 0379886 into main Oct 25, 2026
12 checks passed
@russwyte
russwyte deleted the fmt/end-markers-by-blank-gap branch October 25, 2026 22:13
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