forked from zalando-stups/hutmann
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codestyle.sbt
61 lines (49 loc) · 2.22 KB
/
codestyle.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scalariform.formatter.preferences._
// we should consider using '-Xfatal-warnings' to be very strict
scalacOptions ++= Seq(
"-deprecation",
"-feature",
//"-unchecked",
//"-Xfatal-warnings",
"-Xcheckinit",
"-Xlint"
)
// this checks violations to the paypal style guide
scalastyleConfigUrl := Option(url("https://s3.eu-central-1.amazonaws.com/kohle-development/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
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
// configure scalariform to use preferred settings
scalariformSettings
//pls adjust your intellij settings accordingly
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(AlignParameters, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, true)
.setPreference(PreserveSpaceBeforeArguments, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(IndentLocalDefs, true)
.setPreference(IndentPackageBlocks, true)
.setPreference(IndentWithTabs, false)
.setPreference(IndentSpaces, 2)
.setPreference(MultilineScaladocCommentsStartOnFirstLine, false)
.setPreference(PreserveDanglingCloseParenthesis, true)
coverageEnabled in Test:= true
coverageExcludedPackages := "<empty>;router.Routes;router.RoutesPrefix;controllers.Reverse*;controllers.javascript.Reverse*"
coverageMinimum := 50
//publish <<= publish dependsOn coverage
//publishLocal <<= publishLocal dependsOn coverage
//do not warn in test cases when we use reflective calls - but do so in production!
scalacOptions in Test += "-language:reflectiveCalls"
scapegoatVersion := "1.2.0"
scapegoatDisabledInspections := Seq(
"ObjectNames",
"ClassNames"
)
scapegoatIgnoredFiles := Seq(".*/routes/main/.*")
publish <<= publish dependsOn scapegoat
publishLocal <<= publishLocal dependsOn scapegoat