Open bjaglin opened 2 years ago
cc @olafurpg @mlachkar
Thank you @bjaglin for opening the issue. We have got an issue open for adding support for scalafix for quite a while (see #15) but yours has much better motivation so I am going to close the old one as a duplicate.
Hello, I'm interested in this question and have been working on an option for this improvement for some time. Now I can see some progress in my project and I plan to create a PR in the near future.
Sure! Do let us know if you need any help.
Hello, any idea if this will ever come?
Hello, any idea if this will ever come?
its in this PR https://github.com/VirtusLab/scala-cli/pull/2968
Is your feature request related to a problem? Please describe.
Scalafix provides a CLI which is rather easy to use to run syntactic rules (using on-demand scalameta parsers under the hood, like scalafmt) but is a hassle to setup to run semantic rules (requiring prior compilation output, namely class & semanticdb files). That's why we usually recommend using build tools plugins instead (either the official sbt plugin or the community-driven maven, gradle & mill plugins).
For projects managed by Scala CLI, using the Scalafix CLI is currently the only option. Providing a built-in integration with Scalafix inside Scala CLI would be useful to cover the typical Scalafix use cases on such projects:
Describe the solution you'd like
A
scalafix
command could take care ofscalafix-interfaces
)Additional context
If Scala CLI adoption picks up, I assume https://github.com/scala-steward-org/scala-steward will eventually support projects managed by Scala CLI and be able to update directives. A support for running Scalafix migrations just like in the other build tools would then be welcome, and could rely on that built-in
scalafix
command.Automating the bump of dependencies by updating directives might be implemented as part of Scala CLI itself in the future, but in any case integrating Scalafix (potentially without a user-facing command) will be useful to leverage existing migration rules.