VirtusLab / scala-cli

Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!)
https://scala-cli.virtuslab.org
Apache License 2.0
529 stars 125 forks source link

scala-cli fmt not working with rewrite. #2684

Open He-Pin opened 5 months ago

He-Pin commented 5 months ago

Version(s) 1.1.1 Describe the bug

PS C:\Users\hepin\IdeaProjects\incubator-pekko> scala-cli fmt
scala.meta.Dialect.withAllowAsForImportRename(boolean)

Run scala-cli fmt on Windows ,only prints this line above, no formatting.

With:

rewrite.scala3.convertToNewSyntax = false
runner {
  dialectOverride {
    allowAsForImportRename = false
    allowStarWildcardImport = false
    allowPostfixStarVarargSplices = false
  }
}

It works when run in sbt shell.

To Reproduce Change the .sbtfmt.conf in pekko project. and run scala-cli fmt.

Expected behaviour Should be ok

Gedochao commented 5 months ago

Some notes after a quick spike

Potential further steps:

He-Pin commented 5 months ago

Thanks, and I's using Window 11, and thanks for this great tool.

Gedochao commented 2 months ago

Optimally, this should be fixed by bringing https://github.com/scalameta/scalafmt/pull/2846 to a closure.

tgodzik commented 2 weeks ago

Another report in https://users.scala-lang.org/t/scala-cli-fmt-runner-dialectoverride-problem/10063