Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgraded to scala 2.12.2 and 2.11.11 and scalaJs #1632

Merged
merged 6 commits into from
May 10, 2017
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ git:

scala:
- 2.10.6
- 2.11.8
- 2.11.11

jdk:
- oraclejdk7

matrix:
include:
- scala: 2.12.1
- scala: 2.12.2
jdk: oraclejdk8

before_install:
Expand Down
15 changes: 12 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ lazy val kernelSettings = Seq(
Resolver.sonatypeRepo("snapshots")),
parallelExecution in Test := false,
scalacOptions in (Compile, doc) := (scalacOptions in (Compile, doc)).value.filter(_ != "-Xfatal-warnings")
) ++ warnUnusedImport ++ update2_12
) ++ warnUnusedImport ++ update2_12 ++ xlint

lazy val commonSettings = Seq(
incOptions := incOptions.value.withLogRecompileOnMacro(false),
Expand All @@ -48,7 +48,8 @@ lazy val commonSettings = Seq(
scalastyleSources in Compile ++= (unmanagedSourceDirectories in Compile).value,
ivyConfigurations += config("compile-time").hide,
unmanagedClasspath in Compile ++= update.value.select(configurationFilter("compile-time"))
) ++ warnUnusedImport ++ update2_12
) ++ warnUnusedImport ++ update2_12 ++ xlint


lazy val tagName = Def.setting{
s"v${if (releaseUseGlobalVersion.value) (version in ThisBuild).value else version.value}"
Expand Down Expand Up @@ -472,7 +473,6 @@ lazy val commonScalacOptions = Seq(
"-language:experimental.macros",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
Expand Down Expand Up @@ -573,3 +573,12 @@ lazy val update2_12 = Seq(
}
}
)

lazy val xlint = Seq(
scalacOptions += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => "-Xlint:-unused,_"
Copy link
Contributor

Choose a reason for hiding this comment

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

What’s the motivation for this?

I guess in 2.11, unused wasn’t part of lint, but is there a particular problem with it (asking because I’m in the process of enabling it on all my projects!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This now warns on unused parameters, vals and implicits according to scalac -xlint:help

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, but that sounds like a good thing to me. Where does that cause problems?

Copy link
Contributor Author

@kailuowang kailuowang Apr 25, 2017

Choose a reason for hiding this comment

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

I got quite a few seemingly related to simulacrum:

[error] /home/travis/build/typelevel/cats/core/src/main/scala/cats/Apply.scala:10: parameter value ev$macro$3 in method ap is never used
[error] @typeclass(excludeParents = List("ApplyArityFunctions"))

And implicit evidence that are not "in use" like

[error] /home/travis/build/typelevel/cats/core/src/main/scala/cats/data/Validated.scala:421: parameter value NT in method apply is never used
[error] def apply[A](f: => A)(implicit T: ClassTag[T], NT: NotNull[T]): Validated[T, A] =

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see. We have some evidence parameters that we don't directly use.

There's some related discussion here. It sounds like scala doesn't offer great options for selectively ignoring these. Unless someone sees a better option, I'm fine with this change coming in as-is.

Copy link
Member

Choose a reason for hiding this comment

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

@kailuowang @ceedubs perhaps we should keep an eye on this PR as it might help with Simulacrum-related warnings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's good to know. Thanks @DavidGregory084

case _ => "-Xlint"
}
}
)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.16")
addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % "0.8.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.16")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.4.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
addSbtPlugin("com.fortysevendeg" % "sbt-microsites" % "0.3.2")
Expand Down