-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
scalac.sbt
46 lines (40 loc) · 923 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
43
44
45
46
import Scalac.Keys._
ThisBuild / scalacOptions ++= Seq(
"-Wunused:imports", // always on for OrganizeImports
// "-Yexplicit-nulls",
"-Ykind-projector",
"-Ysafe-init",
"-language:all",
) ++
Seq("-encoding", "UTF-8") ++
Seq("-rewrite", "-indent") ++
Seq("-source", "future-migration") ++
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)
Seq.empty
else
(ThisBuild / wartremoverWarnings).value
}