Skip to content

Mark end regions by blank gaps - #100

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

insertEndMarkerMinLines was putting end for on any comprehension of 10 lines, including ones with no blank line. Scalafmt's blank-gap rule marks a region only when that region contains a blank line, which is the rule Odersky settled on (scalameta/scalafmt#5064).

The fors that were bound to a val only so the marker would not appear are expressions again: the two running-tool examples, the signed JWT example, ProviderApp.run, example.Main.runHttp, and the stdio legacy test. A for that is used more than once, or that names a value (parts, connected, cases), stays a val.

scalafmtCheckAll is clean. Compiled heddle (JVM, JS, Native), brotli, mcp tests, oauth, example, docs tests, and perfTests.

A long for with no blank line no longer picks up an end marker. The fors that were named only to avoid that marker are expressions again.
@russwyte
russwyte merged commit 4dcf7be into main Oct 25, 2026
15 checks passed
@russwyte
russwyte deleted the fmt/end-markers-by-blank-gap branch October 25, 2026 22:01
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