We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
removeOptionalBraces
Please paste the contents of your .scalafmt.conf file here:
.scalafmt.conf
version = 3.7.3 runner.dialect = scala3 fileOverride { "glob:**/src/main/scala/**" { runner.dialect = scala3 } "glob:**/src/main/scala-2/**" { runner.dialect = scala213source3 } "glob:**/project/**.scala" { runner.dialect = scala213source3 } } preset = IntelliJ align.preset = more maxColumn = 120 docstrings.style = Asterisk docstrings.blankFirstLine = yes docstrings.wrap = no importSelectors = singleLine newlines.source = keep rewrite.scala3.convertToNewSyntax = yes rewrite.scala3.removeOptionalBraces = yes rewrite.scala3.insertEndMarkerMinLines = 42
When I run scalafmt via CLI like this: scalafmt .\ScalaFMTBraceErrorDemo.scala
scalafmt .\ScalaFMTBraceErrorDemo.scala
Given code like this:
class ScalaFMTBraceErrorDemo: class Foo(msg:String): def bar(): Unit = println(msg) new Foo("xyz") { print("msg") }.bar()
Scalafmt formats code like this:
class ScalaFMTBraceErrorDemo: class Foo(msg: String): def bar(): Unit = println(msg) new Foo("xyz"): print("msg") .bar()
This code does not compile anymore.
I would like the formatted output to look like this:
class ScalaFMTBraceErrorDemo: class Foo(msg: String): def bar(): Unit = println(msg) new Foo("xyz"){ print("msg") }.bar()
Not known
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Configuration (required)
Please paste the contents of your
.scalafmt.conf
file here:Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt .\ScalaFMTBraceErrorDemo.scala
Steps
Given code like this:
Problem
Scalafmt formats code like this:
This code does not compile anymore.
Expectation
I would like the formatted output to look like this:
Workaround
Not known
The text was updated successfully, but these errors were encountered: