Originally reported by @ches in scalameta/scalafmt#1208
- Version: 1.6.0-RC1
- Integration: sbt-scalafmt
Problem
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.
Originally reported by @ches in scalameta/scalafmt#1208
Problem
sbt-scalafmt can keep project source formatted with
scalafmtOnCompile, but needs a separate step ofscalafmtSbtto 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 := truewas 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 withscalafmtSbtCheckfailing CI.Workaround
I haven't played around with
onLoadto 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.