Closed mdedetrich closed 1 month ago
Configuration (required)
version = 3.8.2 runner.dialect = scala213
are you absolutely sure that you never build with any other versions of scala, such as those which require try {}
?
https://github.com/apache/pekko/blob/main/project/Dependencies.scala#L47
So to make it clear, the following command that fails to compile when the }{
is removed from try
sbt ";+TestJdk9 / compile ; +compile:doc"
Its +compile:doc
which is failing (since this source code is contained within docs) which iterates through crossScalaVersions
the point is, you're compiling this file for scala212, then why do you expect your dialect to be scala213?
i think we can once again qualify this as configuration error rather than a formatter bug.
the point is, you're compiling this file for scala212, then why do you expect your dialect to be scala213?
i think we can once again qualify this as configuration error rather than a formatter bug.
If I set runner.dialect = scala212
it also removes the {}
in the try block causing the code to fail to compile.
Configuration (required)
Command-line parameters (required)
When I run scalafmt via CLI like this: scalafmt
Steps
Given code like this:
Problem
Scalafmt formats code like this:
Expectation
I would like the formatted output to look like this:
This is because removing the
}{
in thetry
block causes a compile error, i.e.Workaround
None aside from making scalafmt not working on that part of the code
Notes
See PR at https://github.com/apache/pekko/pull/1408, failing code block is at https://github.com/mdedetrich/pekko/blob/5eb0aeea8a1043055d141bba3e287525e3ef5b47/remote/src/test/scala/org/apache/pekko/remote/classic/RemotingSpec.scala#L769-L792