-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
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
revamp the sbt plugin #1081
Comments
If you plan to base the source detection on
|
Yup, first choice... |
Very nice! I approve 👍 @leonardehrenfried may also be interested. Some practicalities, com.geirsson:sbt-scalafmt is currently released for sbt 1.0 without using any classloading/coursier hacks. The plugin does very little however, it only exposes a
The build runs scripted tests on sbt 1.0 and a pre-release of the plugin is released on every merge to bintray. All that is missing is a more idiomatic sbt user experience :) I personally don't use sbt-scalafmt so I will leave it to you to decide how to manage configurations/unmanagedSources/... |
btw, there may be some utilities in scalafmt-cli that are useful for the sbt plugin. We can move them to the core module or the sbt plugin can depend on the cli module, either way you prefer. |
I would be quite interested however currently I'm focusing my "speeding up sbt" open source work on trying to bring coursier into sbt itself: coursier/coursier#601 (comment) I would still be happy to become the plugin's maintainer but cannot actually develop this upgrade myself. |
The default
sbt-scalafmt
plugin is not fit for purpose: there is no configuration and it blindly formats everything (no concept of unmanaged sources, etc, etc, although this can all be worked around manually). These problems were addressed inneo-sbt-scalafmt
but it is really slow.Now that sbt 1.0 supports scala 2.12 there is no need for the classloader hacks in https://github.com/lucidsoftware/neo-sbt-scalafmt/blob/master/sbt-scalafmt/src/main/scala/com/lucidchart/sbt/scalafmt/ScalafmtCorePlugin.scala
The 1.0 plugin should depend on
scalafmt-core
directly, no coursier or CLI nonsense, and retain the followingSetting
s /Task
s (which are scoped per project / config) from the neo plugin:scalafmt
scalafmtOnCompile
scalafmtConfig
scalafmt:test
but renamed toscalafmtCheck
to avoid creating a configsbt:scalafmt
but renamed toscalafmtSbt
with a correspondingscalafmtSbtCheck
. This should format*.sbt
files (with the appropriate dialect) and theproject/*.scala
files.scalafmtOnly
a new task, which could be easily automated from emacs/vim/etc which takes a single file and formats it. This is ideal for "format on save" hooks.The first cut can skip all the caching and simply do a brute-force format.
The text was updated successfully, but these errors were encountered: