Skip to content

Instantly share code, notes, and snippets.

@rktoomey
Created December 18, 2011 19:17
Show Gist options
  • Save rktoomey/1494188 to your computer and use it in GitHub Desktop.
Save rktoomey/1494188 to your computer and use it in GitHub Desktop.
Salat build - attempting to configure sbtscalariform formatting preferences
object Format {
import com.typesafe.sbtscalariform.ScalariformPlugin
import ScalariformPlugin._
lazy val settings = seq(scalariformSettings: _*) ++ Seq(
preferences = formattingPreferences
)
lazy val formattingPreferences = {
import scalariform.formatter.preferences._
ScalariformKeys.preferences := FormattingPreferences().
setPreference(AlignParameters, true).
setPreference(AlignSingleLineCaseStatements, true).
setPreference(CompactControlReadability, true).
setPreference(CompactStringConcatenation, true).
setPreference(DoubleIndentClassDeclaration, true).
setPreference(FormatXml, true).
setPreference(IndentLocalDefs, true).
setPreference(IndentPackageBlocks, true).
setPreference(IndentSpaces, 2).
setPreference(MultilineScaladocCommentsStartOnFirstLine, true).
setPreference(PreserveSpaceBeforeArguments, false).
setPreference(PreserveDanglingCloseParenthesis, false).
setPreference(RewriteArrowSymbols, false).
setPreference(SpaceBeforeColon, false).
setPreference(SpaceInsideBrackets, false).
setPreference(SpacesWithinPatternBinders, true)
}
}
@rktoomey
Copy link
Author

And here is what I had in project/plugins/build.sbt which apparently needs to be migrated to project/plugins.sbt:

resolvers += Classpaths.typesafeResolver

addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.0")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment