Skip to content

Mark end regions by blank gaps - #32

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
Collaborator

The line-count rule was inserting end for on long comprehensions. 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. sbt-scalafmt 2.6.2 accepted that release, so the plugin was left alone. The version jump also changed alignment and dropped end markers on regions with no blank line. A region that contains a blank line still closes with end (end margin, end KeyframeSelector, end Simple, end RenderArgComponent, end LazyInitComponent, and the existing end extension).

No for was bound to a val only to dodge end for, so none were inlined. todo.Main.run, PreactileSpec.checkAfter, and the parenthesized E2E comprehensions in TodoDemoSpec and EmbedHostSpec were already expressions.

scalafmtCheckAll passed after cleanFull. compile built core, preactileConduit, docsClient, example, and embed. Test / compile built the changed test sources in core, preactileConduit, and docs.

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 d784778 into main Oct 25, 2026
20 of 24 checks passed
@russwyte
russwyte deleted the fmt/end-markers-by-blank-gap branch October 25, 2026 22:49
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