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
Hey there 👋
First of all, thanks for your work, scalafmt is great tool ❤️
scalafmt
I've just discovered a case where scalafmt is not idempotent:
version = 3.4.0 runner.dialect = scala213 preset = defaultWithAlign maxColumn = 100 importSelectors = singleLine assumeStandardLibraryStripMargin = true rewrite.rules = [RedundantBraces, RedundantParens] rewrite.redundantBraces.stringInterpolation = true project.git = true optIn.breaksInsideChains = true lineEndings = preserve trailingCommas = preserve newlines.implicitParamListModifierPrefer = before
Given code like this:
class Test { val test = foo.bar.baz .map(thisvariablenameisreallylong => fr"""UPDATE mytable |SET | column = $thisvariablenameisreallylong |WHERE column2 = ${foo.bar}""".stripMargin.update.run ).getOrElse { ().pure[ConnectionIO] } }
When I run scalafmt like this:
scalafmt --debug ./Test.scala
Scalafmt formats code like this:
class Test { val test = foo.bar.baz .map(thisvariablenameisreallylong => fr"""UPDATE mytable |SET | column = $thisvariablenameisreallylong |WHERE column2 = ${foo.bar}""".stripMargin.update.run).getOrElse { ().pure[ConnectionIO] } }
But when I run scalafmt once again:
Scalafmt should be idempotent. Meaning it could be applied multiple times without changing the result beyond the initial application.
I can deactivate the scalafmt using https://scalameta.org/scalafmt/docs/configuration.html#-format-off
I just noticed this issue #339. Maybe there's a fix for my particular case?
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Hey there 👋
First of all, thanks for your work,
scalafmt
is great tool ❤️I've just discovered a case where
scalafmt
is not idempotent:Steps
Given code like this:
When I run scalafmt like this:
Problem
Scalafmt formats code like this:
But when I run scalafmt once again:
Scalafmt formats code like this:
Expectation
Scalafmt should be idempotent. Meaning it could be applied multiple times without changing the result beyond the initial application.
Workaround
I can deactivate the scalafmt using https://scalameta.org/scalafmt/docs/configuration.html#-format-off
Note
I just noticed this issue #339. Maybe there's a fix for my particular case?
The text was updated successfully, but these errors were encountered: