Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

enable -Xfatal-warnings #38

Merged
merged 4 commits into from
Jul 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ scalaXmlVersion := "1.0.4"

scalaCheckVersion := "1.11.6"

// TODO: enable "-Xfatal-warnings" for nightlies,
// off by default because we don't want to break scala/scala pr validation due to deprecation
// don't use for doc scope, scaladoc warnings are not to be reckoned with
scalacOptions in (Compile, compile) ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")
// TODO: eliminate "-deprecation:false" for nightlies,
// included by default because we don't want to break scala/scala pr validation
scalacOptions ++=
Seq("-feature", "-deprecation:false", "-unchecked", "-Xlint", "-Xfatal-warnings") ++
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor < 12 =>
Seq("-optimize")
case _ =>
Seq() // maybe "-Yopt:l:classpath" eventually?
})

// dependencies
// versions involved in integration builds / that change frequently should be keys, set above!
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/scala/tools/partest/nest/Runner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
*
* File paths are detected using the absolute path of the test root.
* A string that looks like a file path is normalized by replacing
* the leading segments (the root) with "$ROOT" and by replacing
* the leading segments (the root) with "\$ROOT" and by replacing
* any Windows backslashes with the one true file separator char.
*/
def normalizeLog() {
Expand Down Expand Up @@ -765,7 +765,7 @@ class SuiteRunner(

def banner = {
val baseDir = fileManager.compilerUnderTest.parent.toString
def relativize(path: String) = path.replace(baseDir, "$baseDir").replace(PathSettings.srcDir.toString, "$sourceDir")
def relativize(path: String) = path.replace(baseDir, s"$$baseDir").replace(PathSettings.srcDir.toString, "$sourceDir")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even without the PR for the constant folding f-interpolator, f"$$x" is a constant string.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant: as a style matter, I prefer f"constant" because s"constant" involves a string context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I understood and thought about changing it, but decided I like it a little better this way, just because s is so much more familiar than f. (no strong feeling either way though)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's time to apply my f"the familiar interpolator" sticker to the lid of my lap top.

val vmBin = javaHome + fileSeparator + "bin"
val vmName = "%s (build %s, %s)".format(javaVmName, javaVmVersion, javaVmInfo)

Expand Down