-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: a one-liner version of newlines.alwaysBeforeElseAfterCurlyIf=true #1043
Comments
Thanks for reporting! This is a duplicate of #271, I agree the formatted output is not good. Note that when given if ('0' <= ch && ch <= '9') {
ch - '0'
} else if ('A' <= ch && ch <= 'F') {
ch - 'A' + 10
} else if ('a' <= ch && ch <= 'f') {
ch - 'a' + 10
} else {
-1
} Scalafmt leaves the code unchanged. |
olafurpg
added a commit
to olafurpg/scalafmt
that referenced
this issue
May 13, 2018
FYI I opened #1180 forcing a line break for if/else bodies that are blocks so that the formatted output matches expected output in this ticket. No need to manually insert line breaks :) |
kitbellew
added a commit
to kitbellew/scalafmt
that referenced
this issue
Nov 26, 2019
kitbellew
added a commit
to kitbellew/scalafmt
that referenced
this issue
Nov 28, 2019
kitbellew
added a commit
to kitbellew/scalafmt
that referenced
this issue
Jan 8, 2020
kitbellew
added a commit
that referenced
this issue
Jan 8, 2020
kitbellew
added a commit
to kitbellew/scalafmt
that referenced
this issue
Mar 8, 2020
While previously we were trying to keep blocks without line breaks if that's how they were originally input, now we actively attempt to take a multi-line representation and fold it into a single line (fold), or take a single-line representation and unfold it into multiple lines (unfold). Fixes scalameta#271 scalameta#1002 scalameta#1043 Helps with scalameta#1627
kitbellew
added a commit
to kitbellew/scalafmt
that referenced
this issue
Mar 9, 2020
While previously we were trying to keep blocks without line breaks if that's how they were originally input, now we actively attempt to take a multi-line representation and fold it into a single line (fold), or take a single-line representation and unfold it into multiple lines (unfold). Fixes scalameta#271 scalameta#1002 scalameta#1043
kitbellew
added a commit
to kitbellew/scalafmt
that referenced
this issue
Mar 9, 2020
While previously we were trying to keep blocks without line breaks if that's how they were originally input, now we actively attempt to take a multi-line representation and fold it into a single line (fold), or take a single-line representation and unfold it into multiple lines (unfold). Fixes scalameta#271 scalameta#1002 scalameta#1043
kitbellew
added a commit
to kitbellew/scalafmt
that referenced
this issue
Mar 9, 2020
While previously we were trying to keep blocks without line breaks if that's how they were originally input, now we actively attempt to take a multi-line representation and fold it into a single line (fold), or take a single-line representation and unfold it into multiple lines (unfold). Fixes scalameta#271 scalameta#1002 scalameta#1043
kitbellew
added a commit
that referenced
this issue
Mar 9, 2020
While previously we were trying to keep blocks without line breaks if that's how they were originally input, now we actively attempt to take a multi-line representation and fold it into a single line (fold), or take a single-line representation and unfold it into multiple lines (unfold). Fixes #271 #1002 #1043
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This template is a guideline, not a strict requirement.
Steps
I ran scalafmt like this:
Problem
Input is
Scalafmt formats code like this:
Expectation
I would like the formatted output to look either exactly like the input, or like this:
but definitely not the way it was chosen.
The text was updated successfully, but these errors were encountered: