Skip to content

Mark end regions by blank gaps - #51

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

Scalafmt is 3.11.5. End markers now follow blank gaps, which is scalafmt's implementation of scalameta/scalafmt#5064 (an end marker belongs on a region that contains a blank line, not on a region that is merely long).

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

The old line-count keys are not set.

Inlined two single-use effect fors in DocumentProcessorLive that were named only so a long for would not pick up end for:

  • processBlockChecked: val effect = for ... yield ... then effect.catchAll is now (for ... yield ...).catchAll
  • processSharedBlock: the same shape inside ZIO.foreach

sbt-scalafmt 2.6.2 already runs 3.11.5, so the plugin was not bumped.

Checked: sbt --server --batch 'scalafmtCheckAll; compile' passed. The control end markers that remain (end for on MarklitCli.runMarklit, end if on processBlockChecked and MarkdownRenderer.renderCodeBlockMerged, end match on ScopeManagerLive.resolveInternal) close regions that contain a blank line. Scalafmt dropped end afterBuild in BuildSite because that method body has no blank line.

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 other repos already set maxColumn = 120. Marklit was on the scalafmt default of 80.
@russwyte
russwyte merged commit d6f5ebf into main Oct 25, 2026
12 checks passed
@russwyte
russwyte deleted the fmt/end-markers-by-blank-gap branch October 25, 2026 22:08
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