-
Notifications
You must be signed in to change notification settings - Fork 0
/
scalac.sbt
42 lines (36 loc) · 875 Bytes
/
scalac.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
import Scalac.Keys._
ThisBuild / scalacOptions ++= Seq(
"-language:_",
"-Ymacro-annotations",
"-Wunused:imports", // always on for OrganizeImports
) ++ Seq("-encoding", "UTF-8") ++ warnings.value ++ lint.value
ThisBuild / warnings := {
if (insideCI.value)
Seq(
"-Wconf:any:error", // for scalac warnings
"-Xfatal-warnings", // for wartremover warts
)
else if (lintOn.value)
Seq("-Wconf:any:warning")
else
Seq("-Wconf:any:silent")
}
ThisBuild / lintOn :=
!sys.env.contains("LINT_OFF")
ThisBuild / lint := {
if (shouldLint.value)
Scalac.Lint
else
Seq.empty
}
ThisBuild / shouldLint :=
insideCI.value || lintOn.value
ThisBuild / wartremoverWarnings := {
if (shouldLint.value)
Warts.allBut(
Wart.ImplicitConversion,
Wart.ImplicitParameter,
)
else
(ThisBuild / wartremoverWarnings).value
}