scalafmt
scalafmt copied to clipboard
Setting New line based on regex
version = 3.5.8
Is there a setting so it configure new line based on regex or yhis symbol (&&, ||)?
What I have
val t = a == b && c == d
What I want
val t =
a == b
&& c == d
Thanks for reporting! Wouldn't it make it very easy to break your code? I would opt to keep the options more limited. Maybe https://scalameta.org/scalafmt/docs/configuration.html#newlinesafterinfixkeep would be useful to you?
please reopen if the proposed parameter (keep
or other values) is substantially insufficient, and there's a safe, dialect-compatible suggestion.
meanwhile, there's a parameter to induce a newline after val t =
(forceAfterAssign or forceAfterMultilineAssign).