How to format the sbt build files with scalariform automatically?
问题 I'd like to format my sbt build files with scalariform. Is it possible to run scalariform on the build definition itself when starting sbt? 回答1: Put this in project/scalariform.sbt : addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.0") And this in scalariform.sbt : import scalariform.formatter.preferences._ import ScalariformKeys._ lazy val BuildConfig = config("build") extend Compile lazy val BuildSbtConfig = config("buildsbt") extend Compile val foo: Int => Int = { case 1 => 1