-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscalastyle-scheck.sbt
26 lines (19 loc) · 1.07 KB
/
scalastyle-scheck.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._
// copied from https://raw.githubusercontent.com/paypal/scala-style-guide/develop/scalastyle-config.xml
scalastyleConfig := file("scalastyle-config.xml")
scalastyleFailOnError := true
// Create a default Scala style task to run with tests
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value
(compileInputs in(Compile, compile)) <<= (compileInputs in(Compile, compile)) dependsOn compileScalastyle
scalariformSettings
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, false)
.setPreference(IndentLocalDefs, true)
.setPreference(IndentPackageBlocks, true)
.setPreference(IndentWithTabs, false)
.setPreference(IndentSpaces, 2)
.setPreference(MultilineScaladocCommentsStartOnFirstLine, false)
.setPreference(SpacesAroundMultiImports, false)