Skip to content
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 Request: newline before single-statement method body #3271

Closed
odelrio opened this issue Jul 12, 2022 · 1 comment · Fixed by #3284
Closed

Feature Request: newline before single-statement method body #3271

odelrio opened this issue Jul 12, 2022 · 1 comment · Fixed by #3284

Comments

@odelrio
Copy link

odelrio commented Jul 12, 2022

I would like my method signatures to break the line after = when the body is not a code block, even if it fits.

Examples:

// maxColumn = 80


def sum(a: Int, b: Int): Int =
  a + b
  
def greatest(a: Int, b: Int): Int =
  if (a > b) a
  else b
@tgodzik
Copy link
Contributor

tgodzik commented Jul 13, 2022

Thanks for reporting! Wouldn't unfold help out here?

https://scalameta.org/scalafmt/docs/configuration.html#newlines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants