Skip to content

Instantly share code, notes, and snippets.

@pvlugter
Forked from rktoomey/SalatBuild.scala
Created December 18, 2011 21:19
Show Gist options
  • Save pvlugter/1494509 to your computer and use it in GitHub Desktop.
Save pvlugter/1494509 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 = scalariformSettings ++ Seq(
ScalariformKeys.preferences := formattingPreferences
)
lazy val formattingPreferences = {
import scalariform.formatter.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)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment