Skip to content

Commit 3e1dac5

Browse files
committed
-Xfatal-warnings in most subprojects
1 parent 10d471a commit 3e1dac5

File tree

7 files changed

+16
-10
lines changed

7 files changed

+16
-10
lines changed

build.sbt

+6-2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ val completeProj = (project in file("internal") / "util-complete")
193193
testedBaseSettings,
194194
name := "Completion",
195195
libraryDependencies += jline,
196+
Compile / scalacOptions += "-Ywarn-unused:-explicits",
196197
mimaSettings,
197198
// Parser is used publicly, so we can't break bincompat.
198199
mimaBinaryIssueFilters := Seq(
@@ -221,6 +222,7 @@ lazy val testingProj = (project in file("testing"))
221222
baseSettings,
222223
name := "Testing",
223224
libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson.value),
225+
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
224226
managedSourceDirectories in Compile +=
225227
baseDirectory.value / "src" / "main" / "contraband-scala",
226228
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@@ -294,6 +296,7 @@ lazy val runProj = (project in file("run"))
294296
.settings(
295297
testedBaseSettings,
296298
name := "Run",
299+
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
297300
managedSourceDirectories in Compile +=
298301
baseDirectory.value / "src" / "main" / "contraband-scala",
299302
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@@ -398,10 +401,9 @@ lazy val protocolProj = (project in file("protocol"))
398401
.dependsOn(collectionProj)
399402
.settings(
400403
testedBaseSettings,
401-
scalacOptions -= "-Ywarn-unused",
402-
scalacOptions += "-Xlint:-unused",
403404
name := "Protocol",
404405
libraryDependencies ++= Seq(sjsonNewScalaJson.value, ipcSocket),
406+
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
405407
managedSourceDirectories in Compile +=
406408
baseDirectory.value / "src" / "main" / "contraband-scala",
407409
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@@ -443,6 +445,7 @@ lazy val commandProj = (project in file("main-command"))
443445
testedBaseSettings,
444446
name := "Command",
445447
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi),
448+
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
446449
managedSourceDirectories in Compile +=
447450
baseDirectory.value / "src" / "main" / "contraband-scala",
448451
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
@@ -546,6 +549,7 @@ lazy val mainProj = (project in file("main"))
546549
testedBaseSettings,
547550
name := "Main",
548551
libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface) ++ log4jDependencies ++ Seq(scalaCacheCaffeine),
552+
Compile / scalacOptions -= "-Xfatal-warnings",
549553
managedSourceDirectories in Compile +=
550554
baseDirectory.value / "src" / "main" / "contraband-scala",
551555
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",

main-actions/src/main/scala/sbt/Package.scala

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ object Package {
106106
val inputFiles = conf.sources.map(_._1).toSet
107107
val inputs = conf.sources :+: lastModified(inputFiles) :+: manifest :+: HNil
108108
cachedMakeJar(inputs)(() => exists(conf.jar))
109+
()
109110
}
110111

111112
/**

main/src/main/scala/sbt/internal/LibraryManagement.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private[sbt] object LibraryManagement {
5353
val finalReport = transform(report)
5454

5555
// Warn of any eviction and compatibility warnings
56-
val ew = EvictionWarning(module, ewo, finalReport, log)
56+
val ew = EvictionWarning(module, ewo, finalReport)
5757
ew.lines.foreach(log.warn(_))
5858
ew.infoAllTheThings.foreach(log.info(_))
5959
CompatibilityWarning.run(compatWarning, module, mavenStyle, log)

main/src/test/scala/sbt/internal/TestBuild.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class TestBuild {
4343
implicit val tGen = Arbitrary { genTasks(lowerIDGen, MaxDepsGen, MaxTasksGen) }
4444
val seed = rng.Seed.random
4545

46-
final class Keys(val env: Env, val scopes: Seq[Scope]) {
46+
class Keys(val env: Env, val scopes: Seq[Scope]) {
4747
override def toString = env + "\n" + scopes.mkString("Scopes:\n\t", "\n\t", "")
4848
lazy val delegated = scopes map env.delegates
4949
}
@@ -119,7 +119,7 @@ abstract class TestBuild {
119119
(taskAxes, zero.toSet, single.toSet, multi.toSet)
120120
}
121121
}
122-
final case class Env(builds: Vector[Build], tasks: Vector[Taskk]) {
122+
case class Env(builds: Vector[Build], tasks: Vector[Taskk]) {
123123
override def toString =
124124
"Env:\n " + " Tasks:\n " + tasks.mkString("\n ") + "\n" + builds.mkString("\n ")
125125
val root = builds.head
@@ -159,15 +159,15 @@ abstract class TestBuild {
159159
}
160160
def getKey: Taskk => AttributeKey[_] = _.key
161161
def toConfigKey: Configuration => ConfigKey = c => ConfigKey(c.name)
162-
final case class Build(uri: URI, projects: Seq[Proj]) {
162+
case class Build(uri: URI, projects: Seq[Proj]) {
163163
override def toString = "Build " + uri.toString + " :\n " + projects.mkString("\n ")
164164
val allProjects = projects map { p =>
165165
(ProjectRef(uri, p.id), p)
166166
}
167167
val root = projects.head
168168
val projectMap = mapBy(projects)(_.id)
169169
}
170-
final case class Proj(
170+
case class Proj(
171171
id: String,
172172
delegates: Seq[ProjectRef],
173173
configurations: Seq[Configuration]
@@ -178,7 +178,7 @@ abstract class TestBuild {
178178
val confMap = mapBy(configurations)(_.name)
179179
}
180180

181-
final case class Taskk(key: AttributeKey[String], delegates: Seq[Taskk]) {
181+
case class Taskk(key: AttributeKey[String], delegates: Seq[Taskk]) {
182182
override def toString =
183183
key.label + " (delegates: " + delegates.map(_.key.label).mkString(", ") + ")"
184184
}

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
scalaVersion := "2.12.6"
22
scalacOptions ++= Seq("-feature", "-language:postfixOps")
33

4-
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.7")
4+
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.8")
55
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.0")
66
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")
77
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.8.0")

sbt/src/test/scala/sbt/RunFromSourceMain.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ object RunFromSourceMain {
118118
def globalLock = noGlobalLock
119119
def bootDirectory = RunFromSourceMain.bootDirectory
120120
def ivyHome = file(sys.props("user.home")) / ".ivy2"
121-
final case class PredefRepo(id: Predefined) extends PredefinedRepository
121+
case class PredefRepo(id: Predefined) extends PredefinedRepository
122122
import Predefined._
123123
def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))
124124
def appRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral))

scripted-plugin/src/main/scala/sbt/ScriptedPlugin.scala

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
package sbt
99

1010
// ScriptedPlugin has moved to main.
11+
private[sbt] object ScriptedPluginNote

0 commit comments

Comments
 (0)