You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sbt-scalafmt can keep project source formatted with scalafmtOnCompile, but needs a separate step of scalafmtSbt to maintain formatting of the build too.
Through some tricks, neo-sbt-scalafmt made it possible to have automatic formatting of sbt build files when sbt (re)loaded, if scalafmtOnCompile := true was set in the root and the meta build e.g. project/build.sbt.
Expectation
A means of keeping build files in compliance with project standards without need to remember a separate scalafmtSbt, or frustrating contributors with scalafmtSbtCheck failing CI.
Workaround
I haven't played around with onLoad to try to get something working with the current plugin yet, I'll share if something pans out.
Notes
I can understand if sbt-scalafmt maintainers don't feel this is worthwhile and want to close it. It's a nice-to-have after getting used to it with the neo plugin.
The text was updated successfully, but these errors were encountered:
Thanks for reporting! I am not against having a similar option in the sbt-scalafmt plugin if someone wants to contribute the feature. One thing that needs to be taken care of is to only trigger formatting on reload and on first load. I had heard reports that the neo-scalafmt implementation triggered reformatting on ++SCALA_VERSION, which is slow since the neo scalafmt task depends on update.
Problem
sbt-scalafmt can keep project source formatted with
scalafmtOnCompile
, but needs a separate step ofscalafmtSbt
to maintain formatting of the build too.Through some tricks, neo-sbt-scalafmt made it possible to have automatic formatting of sbt build files when sbt (re)loaded, if
scalafmtOnCompile := true
was set in the root and the meta build e.g.project/build.sbt
.Expectation
A means of keeping build files in compliance with project standards without need to remember a separate
scalafmtSbt
, or frustrating contributors withscalafmtSbtCheck
failing CI.Workaround
I haven't played around with
onLoad
to try to get something working with the current plugin yet, I'll share if something pans out.Notes
I can understand if sbt-scalafmt maintainers don't feel this is worthwhile and want to close it. It's a nice-to-have after getting used to it with the neo plugin.
The text was updated successfully, but these errors were encountered: