From d20f50ac01e9f10a3b73fac2001d4082919f049a Mon Sep 17 00:00:00 2001 From: Alistair Johnson Date: Tue, 20 Sep 2016 01:02:34 +0200 Subject: [PATCH 01/20] Add scala 2.12.0-RC1 --- .travis.yml | 6 ++ build.sbt | 118 +++++++++++++++++++--------- core/src/main/scala/cats/Eval.scala | 4 +- project/plugins.sbt | 6 +- scripts/publishLocalSbtScoverage.sh | 9 +++ scripts/publishLocalScoverage.sh | 10 +++ 6 files changed, 112 insertions(+), 41 deletions(-) create mode 100755 scripts/publishLocalSbtScoverage.sh create mode 100755 scripts/publishLocalScoverage.sh diff --git a/.travis.yml b/.travis.yml index b879341e82..2f919d682f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,17 @@ git: scala: - 2.10.6 - 2.11.8 +- 2.12.0-RC1 + +jdk: + - oraclejdk8 before_install: - export PATH=${PATH}:./vendor/bundle script: + - scripts/publishLocalScoverage.sh + - scripts/publishLocalSbtScoverage.sh - scripts/travis-publish.sh # http://austinpray.com/ops/2015/09/20/change-travis-node-version.html diff --git a/build.sbt b/build.sbt index 7d125cacf1..8a0ad5f1d9 100644 --- a/build.sbt +++ b/build.sbt @@ -1,37 +1,20 @@ import com.typesafe.sbt.SbtGhPages.GhPagesKeys._ import sbtunidoc.Plugin.UnidocKeys._ import ReleaseTransformations._ -import ScoverageSbtPlugin._ import scala.xml.transform.{RewriteRule, RuleTransformer} +import org.scalajs.sbtplugin.cross.CrossProject lazy val botBuild = settingKey[Boolean]("Build by TravisCI instead of local dev environment") lazy val scoverageSettings = Seq( - ScoverageKeys.coverageMinimum := 60, - ScoverageKeys.coverageFailOnMinimum := false, - ScoverageKeys.coverageHighlighting := scalaBinaryVersion.value != "2.10", - ScoverageKeys.coverageExcludedPackages := "cats\\.bench\\..*", - // don't include scoverage as a dependency in the pom - // see issue #980 - // this code was copied from https://github.com/mongodb/mongo-spark - pomPostProcess := { (node: xml.Node) => - new RuleTransformer( - new RewriteRule { - override def transform(node: xml.Node): Seq[xml.Node] = node match { - case e: xml.Elem - if e.label == "dependency" && e.child.exists(child => child.label == "groupId" && child.text == "org.scoverage") => Nil - case _ => Seq(node) - - } - - }).transform(node).head - } + coverageMinimum := 60, + coverageFailOnMinimum := false ) lazy val buildSettings = Seq( organization := "org.typelevel", scalaVersion := "2.11.8", - crossScalaVersions := Seq("2.10.6", "2.11.8") + crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0-RC1") ) lazy val catsDoctestSettings = Seq( @@ -46,7 +29,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 +) ++ warnUnusedImport ++ update2_12 lazy val commonSettings = Seq( incOptions := incOptions.value.withLogRecompileOnMacro(false), @@ -57,17 +40,17 @@ lazy val commonSettings = Seq( Resolver.sonatypeRepo("snapshots") ), libraryDependencies ++= Seq( - "com.github.mpilquist" %%% "simulacrum" % "0.8.0", - "org.typelevel" %%% "machinist" % "0.4.1", + "com.github.mpilquist" %%% "simulacrum" % "0.9.0", + "org.typelevel" %%% "machinist" % "0.5.0", compilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full), compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.0") ), - fork in test := true, + fork in test := false, //true, parallelExecution in Test := false, scalacOptions in (Compile, doc) := (scalacOptions in (Compile, doc)).value.filter(_ != "-Xfatal-warnings"), // workaround for https://github.com/scalastyle/scalastyle-sbt-plugin/issues/47 (scalastyleSources in Compile) <++= unmanagedSourceDirectories in Compile -) ++ warnUnusedImport +) ++ warnUnusedImport ++ update2_12 lazy val tagName = Def.setting{ s"v${if (releaseUseGlobalVersion.value) (version in ThisBuild).value else version.value}" @@ -115,15 +98,15 @@ lazy val catsSettings = buildSettings ++ commonSettings ++ publishSettings ++ sc lazy val scalaCheckVersion = "1.13.2" lazy val scalaTestVersion = "3.0.0" -lazy val disciplineVersion = "0.6" +lazy val disciplineVersion = "0.7" lazy val disciplineDependencies = Seq( libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion, libraryDependencies += "org.typelevel" %%% "discipline" % disciplineVersion) lazy val testingDependencies = Seq( - libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.2", - libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.2" % "test", + libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.3-SNAPSHOT", + libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.3-SNAPSHOT" % "test", libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion % "test") @@ -200,14 +183,14 @@ lazy val cats = project.in(file(".")) .settings(catsSettings) .settings(noPublishSettings) .aggregate(catsJVM, catsJS) - .dependsOn(catsJVM, catsJS, testsJVM % "test-internal -> test", bench % "compile-internal;test-internal -> test") + .dependsOn(catsJVM, catsJS, testsJVM % "test-internal -> test")//, bench % "compile-internal;test-internal -> test") lazy val catsJVM = project.in(file(".catsJVM")) .settings(moduleName := "cats") .settings(catsSettings) .settings(commonJvmSettings) - .aggregate(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM, jvm, docs, bench) - .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm, bench % "compile-internal;test-internal -> test") + .aggregate(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM, jvm, docs) //, bench) + .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm) //, bench % "compile-internal;test-internal -> test") lazy val catsJS = project.in(file(".catsJS")) .settings(moduleName := "cats") @@ -224,6 +207,7 @@ lazy val macros = crossProject.crossType(CrossType.Pure) .settings(catsSettings:_*) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) + .jsSettings(coverageEnabled := false) .settings(scalacOptions := scalacOptions.value.filter(_ != "-Xfatal-warnings")) lazy val macrosJVM = macros.jvm @@ -253,8 +237,10 @@ lazy val kernelLaws = crossProject.crossType(CrossType.Pure) .settings(scoverageSettings: _*) .settings(disciplineDependencies: _*) .settings(testingDependencies: _*) + .settings(fix2_12:_*) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) + .jsSettings(coverageEnabled := false) .dependsOn(kernel) lazy val kernelLawsJVM = kernelLaws.jvm @@ -266,6 +252,9 @@ lazy val core = crossProject.crossType(CrossType.Pure) .settings(catsSettings:_*) .settings(sourceGenerators in Compile <+= (sourceManaged in Compile).map(Boilerplate.gen)) .settings(includeGeneratedSrc) + .settings(fix2_12:_*) + .configure(disableScoverage210Jvm) + .configure(disableScoverage210Js) .settings(libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % "test") .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) @@ -278,9 +267,11 @@ lazy val laws = crossProject.crossType(CrossType.Pure) .settings(moduleName := "cats-laws") .settings(catsSettings:_*) .settings(disciplineDependencies:_*) - .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.2")) + .configure(disableScoverage210Jvm) + .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.3-SNAPSHOT")) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) + .jsSettings(coverageEnabled := false) lazy val lawsJVM = laws.jvm lazy val lawsJS = laws.js @@ -291,6 +282,7 @@ lazy val free = crossProject.crossType(CrossType.Pure) .settings(catsSettings:_*) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) + .settings(fix2_12:_*) lazy val freeJVM = free.jvm lazy val freeJS = free.js @@ -304,19 +296,23 @@ lazy val tests = crossProject.crossType(CrossType.Pure) .settings(testingDependencies: _*) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) + .settings(fix2_12:_*) lazy val testsJVM = tests.jvm lazy val testsJS = tests.js // bench is currently JVM-only +/* lazy val bench = project.dependsOn(macrosJVM, coreJVM, freeJVM, lawsJVM) .settings(moduleName := "cats-bench") .settings(catsSettings) .settings(noPublishSettings) .settings(commonJvmSettings) + .settings(coverageEnabled := false) .settings(libraryDependencies ++= Seq( "org.scalaz" %% "scalaz-core" % "7.2.5")) .enablePlugins(JmhPlugin) + */ // cats-js is JS-only lazy val js = project @@ -324,6 +320,7 @@ lazy val js = project .settings(moduleName := "cats-js") .settings(catsSettings:_*) .settings(commonJsSettings:_*) + .configure(disableScoverage210Js) .enablePlugins(ScalaJSPlugin) @@ -461,8 +458,8 @@ lazy val scalaMacroDependencies: Seq[Setting[_]] = Seq( // in Scala 2.10, quasiquotes are provided by macro paradise case Some((2, 10)) => Seq( - compilerPlugin("org.scalamacros" %% "paradise" % "2.0.1" cross CrossVersion.full), - "org.scalamacros" %% "quasiquotes" % "2.0.1" cross CrossVersion.binary + compilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full), + "org.scalamacros" %% "quasiquotes" % "2.1.0" cross CrossVersion.binary ) } } @@ -479,7 +476,6 @@ lazy val commonScalacOptions = Seq( "-unchecked", "-Xfatal-warnings", "-Xlint", - "-Yinline-warnings", "-Yno-adapted-args", "-Ywarn-dead-code", "-Ywarn-numeric-widen", @@ -539,3 +535,53 @@ lazy val credentialSettings = Seq( password <- Option(System.getenv().get("SONATYPE_PASSWORD")) } yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq ) + +def disableScoverage210Js(crossProject: CrossProject) = + crossProject + .jsSettings( + coverageEnabled := { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 10)) => false + case _ => coverageEnabled.value + } + } + ) + +def disableScoverage210Js: Project ⇒ Project = p => + p.settings( + coverageEnabled := { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 10)) => false + case _ => coverageEnabled.value + } + } + ) + +def disableScoverage210Jvm(crossProject: CrossProject) = + crossProject + .jvmSettings( + coverageEnabled := { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 10)) => false + case _ => coverageEnabled.value + } + } + ) + +lazy val update2_12 = Seq( + scalacOptions -= { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 12)) => "-Yinline-warnings" + case _ => "" + } + } +) + +lazy val fix2_12 = Seq( + scalacOptions -= { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 12)) => "-Xfatal-warnings" + case _ => "" + } + } +) diff --git a/core/src/main/scala/cats/Eval.scala b/core/src/main/scala/cats/Eval.scala index 4779eb2023..b7d13b3f7e 100644 --- a/core/src/main/scala/cats/Eval.scala +++ b/core/src/main/scala/cats/Eval.scala @@ -74,8 +74,8 @@ sealed abstract class Eval[+A] extends Serializable { self => case c: Eval.Compute[A] => new Eval.Compute[B] { type Start = c.Start - val start = c.start - val run = (s: c.Start) => + val start: () => Eval[Start] = c.start + val run: Start => Eval[B] = (s: c.Start) => new Eval.Compute[B] { type Start = A val start = () => c.run(s) diff --git a/project/plugins.sbt b/project/plugins.sbt index aeb8b9e881..5ac24a911b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,11 +3,11 @@ addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.9") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.11") +//addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.12") addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.2.0") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.6-SNAPSHOT") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.11") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.12") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.4.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") addSbtPlugin("com.fortysevendeg" % "sbt-microsites" % "0.2.6") diff --git a/scripts/publishLocalSbtScoverage.sh b/scripts/publishLocalSbtScoverage.sh new file mode 100755 index 0000000000..5e2056ec71 --- /dev/null +++ b/scripts/publishLocalSbtScoverage.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# + +set -euo pipefail + +cd "${TMPDIR:-/tmp}" +git clone -b topic/2-12 "https://github.com/BennyHill/sbt-scoverage.git" +( cd sbt-scoverage && sbt -sbt-version 0.13.13-M1 publishLocal) +rm -rf sbt-scoverage diff --git a/scripts/publishLocalScoverage.sh b/scripts/publishLocalScoverage.sh new file mode 100755 index 0000000000..be509c825b --- /dev/null +++ b/scripts/publishLocalScoverage.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# + +set -euo pipefail + +cd "${TMPDIR:-/tmp}" +git clone -b tl-2-12 "https://github.com/BennyHill/scalac-scoverage-plugin.git" +( cd scalac-scoverage-plugin && sbt -sbt-version 0.13.13-M1 ++2.10.6 publishLocal ++2.11.8 publishLocal ++2.12.0-RC1 publishLocal ) +rm -rf scalac-scoverage-plugin + From b82418d58e00708a981291ac2357207d68a94fe7 Mon Sep 17 00:00:00 2001 From: Alistair Johnson Date: Tue, 20 Sep 2016 02:17:02 +0200 Subject: [PATCH 02/20] Fix tut on 2.12.0-RC1 --- build.sbt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.sbt b/build.sbt index 8a0ad5f1d9..1e4685e66e 100644 --- a/build.sbt +++ b/build.sbt @@ -176,6 +176,7 @@ lazy val docs = project .settings(docSettings) .settings(tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code")))) .settings(commonJvmSettings) + .settings(fix2_12:_*) .dependsOn(coreJVM, freeJVM) lazy val cats = project.in(file(".")) @@ -583,5 +584,11 @@ lazy val fix2_12 = Seq( case Some((2, 12)) => "-Xfatal-warnings" case _ => "" } + }, + scalacOptions in (ScalaUnidoc, unidoc) -= { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 12)) => "-Xfatal-warnings" + case _ => "" + } } ) From 8a4f4bd2dbdc1489d620626f6fef01890895e940 Mon Sep 17 00:00:00 2001 From: Alistair Johnson Date: Thu, 29 Sep 2016 00:21:39 +0200 Subject: [PATCH 03/20] Updated new 2.12 deps --- .travis.yml | 14 ++++++++------ build.sbt | 15 +++++++-------- project/plugins.sbt | 4 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2f919d682f..50cc38c68e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,19 +8,21 @@ git: depth: 9999 scala: -- 2.10.6 -- 2.11.8 -- 2.12.0-RC1 + - 2.10.6 + - 2.11.8 jdk: - - oraclejdk8 + - oraclejdk7 + +matrix: + include: + - scala: 2.12.0-RC1 + jdk: oraclejdk8 before_install: - export PATH=${PATH}:./vendor/bundle script: - - scripts/publishLocalScoverage.sh - - scripts/publishLocalSbtScoverage.sh - scripts/travis-publish.sh # http://austinpray.com/ops/2015/09/20/change-travis-node-version.html diff --git a/build.sbt b/build.sbt index 1e4685e66e..a4e9557fe8 100644 --- a/build.sbt +++ b/build.sbt @@ -105,8 +105,8 @@ lazy val disciplineDependencies = Seq( libraryDependencies += "org.typelevel" %%% "discipline" % disciplineVersion) lazy val testingDependencies = Seq( - libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.3-SNAPSHOT", - libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.3-SNAPSHOT" % "test", + libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.3", + libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.3" % "test", libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion % "test") @@ -184,14 +184,14 @@ lazy val cats = project.in(file(".")) .settings(catsSettings) .settings(noPublishSettings) .aggregate(catsJVM, catsJS) - .dependsOn(catsJVM, catsJS, testsJVM % "test-internal -> test")//, bench % "compile-internal;test-internal -> test") + .dependsOn(catsJVM, catsJS, testsJVM % "test-internal -> test", bench % "compile-internal;test-internal -> test") lazy val catsJVM = project.in(file(".catsJVM")) .settings(moduleName := "cats") .settings(catsSettings) .settings(commonJvmSettings) .aggregate(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM, jvm, docs) //, bench) - .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm) //, bench % "compile-internal;test-internal -> test") + .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm, bench % "compile-internal;test-internal -> test") lazy val catsJS = project.in(file(".catsJS")) .settings(moduleName := "cats") @@ -269,7 +269,7 @@ lazy val laws = crossProject.crossType(CrossType.Pure) .settings(catsSettings:_*) .settings(disciplineDependencies:_*) .configure(disableScoverage210Jvm) - .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.3-SNAPSHOT")) + .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.3")) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) .jsSettings(coverageEnabled := false) @@ -303,7 +303,7 @@ lazy val testsJVM = tests.jvm lazy val testsJS = tests.js // bench is currently JVM-only -/* + lazy val bench = project.dependsOn(macrosJVM, coreJVM, freeJVM, lawsJVM) .settings(moduleName := "cats-bench") .settings(catsSettings) @@ -311,9 +311,8 @@ lazy val bench = project.dependsOn(macrosJVM, coreJVM, freeJVM, lawsJVM) .settings(commonJvmSettings) .settings(coverageEnabled := false) .settings(libraryDependencies ++= Seq( - "org.scalaz" %% "scalaz-core" % "7.2.5")) + "org.scalaz" %% "scalaz-core" % "7.2.6")) .enablePlugins(JmhPlugin) - */ // cats-js is JS-only lazy val js = project diff --git a/project/plugins.sbt b/project/plugins.sbt index 5ac24a911b..c2df80a702 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,9 +3,9 @@ addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.9") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3") -//addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.12") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.15") addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.6-SNAPSHOT") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0-RC1") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.12") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.4.1") From b0afe147c2cdae8f972aa39be1e47ceb37955bc5 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 20 Oct 2016 11:09:27 -0500 Subject: [PATCH 04/20] Update Scala, etc. --- build.sbt | 17 ++++++++--------- project/build.properties | 2 +- project/plugins.sbt | 6 +++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/build.sbt b/build.sbt index a4e9557fe8..7e61f64860 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,7 @@ lazy val scoverageSettings = Seq( lazy val buildSettings = Seq( organization := "org.typelevel", scalaVersion := "2.11.8", - crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0-RC1") + crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0-RC2") ) lazy val catsDoctestSettings = Seq( @@ -40,10 +40,10 @@ lazy val commonSettings = Seq( Resolver.sonatypeRepo("snapshots") ), libraryDependencies ++= Seq( - "com.github.mpilquist" %%% "simulacrum" % "0.9.0", - "org.typelevel" %%% "machinist" % "0.5.0", + "com.github.mpilquist" %%% "simulacrum" % "0.10.0", + "org.typelevel" %%% "machinist" % "0.6.0", compilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full), - compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.0") + compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.2") ), fork in test := false, //true, parallelExecution in Test := false, @@ -98,15 +98,15 @@ lazy val catsSettings = buildSettings ++ commonSettings ++ publishSettings ++ sc lazy val scalaCheckVersion = "1.13.2" lazy val scalaTestVersion = "3.0.0" -lazy val disciplineVersion = "0.7" +lazy val disciplineVersion = "0.7.1" lazy val disciplineDependencies = Seq( libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion, libraryDependencies += "org.typelevel" %%% "discipline" % disciplineVersion) lazy val testingDependencies = Seq( - libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.3", - libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.3" % "test", + libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.4-SNAPSHOT", + libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.4-SNAPSHOT" % "test", libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion % "test") @@ -268,8 +268,7 @@ lazy val laws = crossProject.crossType(CrossType.Pure) .settings(moduleName := "cats-laws") .settings(catsSettings:_*) .settings(disciplineDependencies:_*) - .configure(disableScoverage210Jvm) - .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.3")) + .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.4-SNAPSHOT")) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) .jsSettings(coverageEnabled := false) diff --git a/project/build.properties b/project/build.properties index 35c88bab7d..e0d25e8c63 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.12 +sbt.version=0.13.13-RC3 diff --git a/project/plugins.sbt b/project/plugins.sbt index c2df80a702..7830566f2b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,13 +1,13 @@ addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.3") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.9") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.11") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.15") addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0-RC1") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0-RC2") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.12") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.4.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") addSbtPlugin("com.fortysevendeg" % "sbt-microsites" % "0.2.6") From 601b523651a33bdad321d16baaaac7205c6fc883 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 20 Oct 2016 11:53:18 -0500 Subject: [PATCH 05/20] Remove local Scoverage publishing --- scripts/publishLocalSbtScoverage.sh | 9 --------- scripts/publishLocalScoverage.sh | 10 ---------- 2 files changed, 19 deletions(-) delete mode 100755 scripts/publishLocalSbtScoverage.sh delete mode 100755 scripts/publishLocalScoverage.sh diff --git a/scripts/publishLocalSbtScoverage.sh b/scripts/publishLocalSbtScoverage.sh deleted file mode 100755 index 5e2056ec71..0000000000 --- a/scripts/publishLocalSbtScoverage.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -# - -set -euo pipefail - -cd "${TMPDIR:-/tmp}" -git clone -b topic/2-12 "https://github.com/BennyHill/sbt-scoverage.git" -( cd sbt-scoverage && sbt -sbt-version 0.13.13-M1 publishLocal) -rm -rf sbt-scoverage diff --git a/scripts/publishLocalScoverage.sh b/scripts/publishLocalScoverage.sh deleted file mode 100755 index be509c825b..0000000000 --- a/scripts/publishLocalScoverage.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -# - -set -euo pipefail - -cd "${TMPDIR:-/tmp}" -git clone -b tl-2-12 "https://github.com/BennyHill/scalac-scoverage-plugin.git" -( cd scalac-scoverage-plugin && sbt -sbt-version 0.13.13-M1 ++2.10.6 publishLocal ++2.11.8 publishLocal ++2.12.0-RC1 publishLocal ) -rm -rf scalac-scoverage-plugin - From 5945b9be5f671b2eb810d251a87b397a510a65ce Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 20 Oct 2016 11:59:08 -0500 Subject: [PATCH 06/20] Fix SBT warnings --- build.sbt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index 7e61f64860..f8e79264ba 100644 --- a/build.sbt +++ b/build.sbt @@ -49,7 +49,7 @@ lazy val commonSettings = Seq( parallelExecution in Test := false, scalacOptions in (Compile, doc) := (scalacOptions in (Compile, doc)).value.filter(_ != "-Xfatal-warnings"), // workaround for https://github.com/scalastyle/scalastyle-sbt-plugin/issues/47 - (scalastyleSources in Compile) <++= unmanagedSourceDirectories in Compile + scalastyleSources in Compile ++= (unmanagedSourceDirectories in Compile).value ) ++ warnUnusedImport ++ update2_12 lazy val tagName = Def.setting{ @@ -67,8 +67,6 @@ lazy val commonJsSettings = Seq( }, scalaJSStage in Global := FastOptStage, parallelExecution := false, - // Using Rhino as jsEnv to build scala.js code can lead to OOM, switch to PhantomJS by default - scalaJSUseRhino := false, requiresDOM := false, jsEnv := NodeJSEnv().value, // Only used for scala.js for now @@ -221,7 +219,7 @@ lazy val kernel = crossProject.crossType(CrossType.Pure) .settings(buildSettings: _*) .settings(publishSettings: _*) .settings(scoverageSettings: _*) - .settings(sourceGenerators in Compile <+= (sourceManaged in Compile).map(KernelBoiler.gen)) + .settings(sourceGenerators in Compile += (sourceManaged in Compile).map(KernelBoiler.gen).taskValue) .settings(includeGeneratedSrc) .jsSettings(commonJsSettings:_*) .jvmSettings((commonJvmSettings ++ (mimaPreviousArtifacts := Set("org.typelevel" %% "cats-kernel" % "0.7.0"))):_*) @@ -251,11 +249,11 @@ lazy val core = crossProject.crossType(CrossType.Pure) .dependsOn(macros, kernel) .settings(moduleName := "cats-core") .settings(catsSettings:_*) - .settings(sourceGenerators in Compile <+= (sourceManaged in Compile).map(Boilerplate.gen)) + .settings(sourceGenerators in Compile += (sourceManaged in Compile).map(Boilerplate.gen).taskValue) .settings(includeGeneratedSrc) .settings(fix2_12:_*) - .configure(disableScoverage210Jvm) - .configure(disableScoverage210Js) + .configureCross(disableScoverage210Jvm) + .configureCross(disableScoverage210Js) .settings(libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % "test") .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) @@ -524,7 +522,7 @@ lazy val warnUnusedImport = Seq( } }, scalacOptions in (Compile, console) ~= {_.filterNot("-Ywarn-unused-import" == _)}, - scalacOptions in (Test, console) <<= (scalacOptions in (Compile, console)) + scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value ) lazy val credentialSettings = Seq( From 36e1eaa1be1b48d73b3c3d60899125bb33ffb4e4 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 20 Oct 2016 12:17:11 -0500 Subject: [PATCH 07/20] Update Travis CI for Scala 2.12.0-RC2 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 50cc38c68e..3e936bf9d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ git: scala: - 2.10.6 - 2.11.8 + - 2.12.0-RC2 jdk: - oraclejdk7 From 765f4c9a47a03cf9234f16c429e97673eaffa6ce Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 20 Oct 2016 12:56:42 -0500 Subject: [PATCH 08/20] Update Either docs for 2.12, noting inconsistency --- docs/src/main/tut/datatypes/either.md | 28 ++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/src/main/tut/datatypes/either.md b/docs/src/main/tut/datatypes/either.md index fa0dc9655b..971ff31b41 100644 --- a/docs/src/main/tut/datatypes/either.md +++ b/docs/src/main/tut/datatypes/either.md @@ -235,16 +235,30 @@ object Service { Let's say we have an application that wants to do database things, and then take database values and do service things. Glancing at the types, it looks like `flatMap` will do it. -```tut:fail:silent +```scala def doApp = Database.databaseThings().flatMap(Service.serviceThings) ``` -This doesn't work! The reason this occurs is because the first type parameter in the two `Either`s are different - -`databaseThings()` can give us a `DatabaseError` whereas `serviceThings()` can give us a -`ServiceError`: two completely unrelated types. While `Either`'s type parameters are covariant, -the aforementioned syntax enrichment is invariant to avoid nasty variance issues like inferring -`Object`. Therefore, when the compiler sees `Either[E1, A1]` and an `Either[E2, A2]`, it -will simply reject the `flatMap` call. +If you're on Scala 2.12, this line will compile and work as expected, but if you're on an earlier +version of Scala it won't! This difference is related to the right-biasing of `Either` in Scala 2.12 +that was mentioned above. In Scala 2.12 the `flatMap` we get here is a method on `Either` with this +signature: + +```scala +def flatMap[AA >: A, Y](f: (B) => Either[AA, Y]): Either[AA, Y] +``` + +This `flatMap` is different from the ones you'll find on `List` or `Option`, for example, in that it +has two type parameters, with the extra `AA` parameter allowing us to `flatMap` into an `Either` +with a different type on the left side. + +This behavior is consistent with the covariance of `Either`, and in some cases it can be convenient, +but it also makes it easy to run into nasty variance issues (such as `Object` being inferred as the +type of the left side, as it is in this case). + +For this reason the `flatMap` provided by Cats's `Either` syntax (which is the one you'll get for +Scala 2.10 and 2.11) does not include this extra type parameter. Instead the left sides have to +match, which means our `doApp` definition above will not compile on versions of Scala before 2.12. ### Solution 1: Application-wide errors So clearly in order for us to easily compose `Either` values, the left type parameter must be the same. From 9a630ca2d54f7eeff7600d60e141cd6247b9a4d7 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 20 Oct 2016 13:22:13 -0500 Subject: [PATCH 09/20] Exclude bench from default build --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index f8e79264ba..d881578474 100644 --- a/build.sbt +++ b/build.sbt @@ -189,7 +189,7 @@ lazy val catsJVM = project.in(file(".catsJVM")) .settings(catsSettings) .settings(commonJvmSettings) .aggregate(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM, jvm, docs) //, bench) - .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm, bench % "compile-internal;test-internal -> test") + .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm) //, bench % "compile-internal;test-internal -> test") lazy val catsJS = project.in(file(".catsJS")) .settings(moduleName := "cats") From b347bf03851c0cbdfdea0d4f502a8aed7521a3d3 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sat, 22 Oct 2016 10:13:48 -0500 Subject: [PATCH 10/20] Fix Scala versions in Travis CI config --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e936bf9d6..0b91a0411a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,14 +10,13 @@ git: scala: - 2.10.6 - 2.11.8 - - 2.12.0-RC2 jdk: - oraclejdk7 matrix: include: - - scala: 2.12.0-RC1 + - scala: 2.12.0-RC2 jdk: oraclejdk8 before_install: From 9d7d6ccc8b151c8fd9ff90a62d570925eb74bfde Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sat, 22 Oct 2016 10:17:06 -0500 Subject: [PATCH 11/20] Turn JVM forking back on for tests --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index d881578474..804fe2611e 100644 --- a/build.sbt +++ b/build.sbt @@ -45,7 +45,7 @@ lazy val commonSettings = Seq( compilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full), compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.2") ), - fork in test := false, //true, + fork in test := true, parallelExecution in Test := false, scalacOptions in (Compile, doc) := (scalacOptions in (Compile, doc)).value.filter(_ != "-Xfatal-warnings"), // workaround for https://github.com/scalastyle/scalastyle-sbt-plugin/issues/47 From 2839a5dc45180a4ca67bf1e036587e2ceff64937 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sat, 22 Oct 2016 10:18:47 -0500 Subject: [PATCH 12/20] Update sbt-jmh and add bench back to build --- build.sbt | 4 ++-- project/plugins.sbt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 804fe2611e..ca48d107c6 100644 --- a/build.sbt +++ b/build.sbt @@ -188,8 +188,8 @@ lazy val catsJVM = project.in(file(".catsJVM")) .settings(moduleName := "cats") .settings(catsSettings) .settings(commonJvmSettings) - .aggregate(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM, jvm, docs) //, bench) - .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm) //, bench % "compile-internal;test-internal -> test") + .aggregate(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM, jvm, docs, bench) + .dependsOn(macrosJVM, kernelJVM, kernelLawsJVM, coreJVM, lawsJVM, freeJVM, testsJVM % "test-internal -> test", jvm, bench % "compile-internal;test-internal -> test") lazy val catsJS = project.in(file(".catsJS")) .settings(moduleName := "cats") diff --git a/project/plugins.sbt b/project/plugins.sbt index 7830566f2b..20815cccc0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.11") addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.15") +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-RC2") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") From b377bcca4baf9a0af13ba245b11829e1e0a5eac6 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sat, 22 Oct 2016 10:33:29 -0500 Subject: [PATCH 13/20] Ensure we get the right Tut version --- project/plugins.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project/plugins.sbt b/project/plugins.sbt index 20815cccc0..f91d20229f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,4 +10,7 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.4.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") +// Tut is transitively pulled in by sbt-microsites, but as of 0.2.6 that +// currently results in the wrong version (0.4.4 instead of 0.4.5). +addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.5") addSbtPlugin("com.fortysevendeg" % "sbt-microsites" % "0.2.6") From 2aa10f1e532fea7b9abc066e9c7f3eea4b6ed3db Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sat, 22 Oct 2016 10:38:36 -0500 Subject: [PATCH 14/20] Re-enable fatal warnings for 2.12 --- build.sbt | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/build.sbt b/build.sbt index ca48d107c6..953e19eb4e 100644 --- a/build.sbt +++ b/build.sbt @@ -174,7 +174,6 @@ lazy val docs = project .settings(docSettings) .settings(tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code")))) .settings(commonJvmSettings) - .settings(fix2_12:_*) .dependsOn(coreJVM, freeJVM) lazy val cats = project.in(file(".")) @@ -236,7 +235,6 @@ lazy val kernelLaws = crossProject.crossType(CrossType.Pure) .settings(scoverageSettings: _*) .settings(disciplineDependencies: _*) .settings(testingDependencies: _*) - .settings(fix2_12:_*) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) .jsSettings(coverageEnabled := false) @@ -251,7 +249,6 @@ lazy val core = crossProject.crossType(CrossType.Pure) .settings(catsSettings:_*) .settings(sourceGenerators in Compile += (sourceManaged in Compile).map(Boilerplate.gen).taskValue) .settings(includeGeneratedSrc) - .settings(fix2_12:_*) .configureCross(disableScoverage210Jvm) .configureCross(disableScoverage210Js) .settings(libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % "test") @@ -280,7 +277,6 @@ lazy val free = crossProject.crossType(CrossType.Pure) .settings(catsSettings:_*) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) - .settings(fix2_12:_*) lazy val freeJVM = free.jvm lazy val freeJS = free.js @@ -294,7 +290,6 @@ lazy val tests = crossProject.crossType(CrossType.Pure) .settings(testingDependencies: _*) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) - .settings(fix2_12:_*) lazy val testsJVM = tests.jvm lazy val testsJS = tests.js @@ -574,17 +569,3 @@ lazy val update2_12 = Seq( } ) -lazy val fix2_12 = Seq( - scalacOptions -= { - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, 12)) => "-Xfatal-warnings" - case _ => "" - } - }, - scalacOptions in (ScalaUnidoc, unidoc) -= { - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, 12)) => "-Xfatal-warnings" - case _ => "" - } - } -) From 56e011005b6f603dbc8f02dab59b00641e87e4e7 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sat, 22 Oct 2016 10:38:54 -0500 Subject: [PATCH 15/20] Add note about SI-9931 --- core/src/main/scala/cats/Eval.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/scala/cats/Eval.scala b/core/src/main/scala/cats/Eval.scala index b7d13b3f7e..487c17d3f4 100644 --- a/core/src/main/scala/cats/Eval.scala +++ b/core/src/main/scala/cats/Eval.scala @@ -74,6 +74,9 @@ sealed abstract class Eval[+A] extends Serializable { self => case c: Eval.Compute[A] => new Eval.Compute[B] { type Start = c.Start + // See https://issues.scala-lang.org/browse/SI-9931 for an explanation + // of why the type annotations are necessary in these two lines on + // Scala 2.12.0. val start: () => Eval[Start] = c.start val run: Start => Eval[B] = (s: c.Start) => new Eval.Compute[B] { From b1e6a99ff55e4d892b409dab5704244dc784c635 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sat, 22 Oct 2016 10:50:55 -0500 Subject: [PATCH 16/20] Avoid deprecated PropertyCheckConfig --- kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala | 7 ++++--- tests/src/test/scala/cats/tests/CatsSuite.scala | 2 +- tests/src/test/scala/cats/tests/NestedTests.scala | 2 +- tests/src/test/scala/cats/tests/NonEmptyListTests.scala | 2 +- tests/src/test/scala/cats/tests/NonEmptyVectorTests.scala | 2 +- tests/src/test/scala/cats/tests/OneAndTests.scala | 2 +- tests/src/test/scala/cats/tests/WriterTTests.scala | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala b/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala index 9b8b014cb3..f6b959cf54 100644 --- a/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala +++ b/kernel-laws/src/test/scala/cats/kernel/laws/LawTests.scala @@ -10,6 +10,7 @@ import org.typelevel.discipline.{ Laws } import org.typelevel.discipline.scalatest.Discipline import org.scalacheck.{ Arbitrary, Cogen, Gen } import Arbitrary.arbitrary +import org.scalactic.anyvals.{ PosInt, PosZInt } import org.scalatest.FunSuite import scala.util.Random @@ -18,11 +19,11 @@ import scala.collection.immutable.BitSet class LawTests extends FunSuite with Discipline { // The scalacheck defaults (100,100) are too high for scala-js. - final val PropMaxSize = if (Platform.isJs) 10 else 100 - final val PropMinSuccessful = if (Platform.isJs) 10 else 100 + final val PropMaxSize: PosZInt = if (Platform.isJs) 10 else 100 + final val PropMinSuccessful: PosInt = if (Platform.isJs) 10 else 100 implicit override val generatorDrivenConfig: PropertyCheckConfiguration = - PropertyCheckConfig(maxSize = PropMaxSize, minSuccessful = PropMinSuccessful) + PropertyCheckConfiguration(minSuccessful = PropMinSuccessful, sizeRange = PropMaxSize) implicit def orderLaws[A: Cogen: Eq: Arbitrary]: OrderLaws[A] = OrderLaws[A] implicit def groupLaws[A: Cogen: Eq: Arbitrary]: GroupLaws[A] = GroupLaws[A] diff --git a/tests/src/test/scala/cats/tests/CatsSuite.scala b/tests/src/test/scala/cats/tests/CatsSuite.scala index 2909a55b86..750273bb6b 100644 --- a/tests/src/test/scala/cats/tests/CatsSuite.scala +++ b/tests/src/test/scala/cats/tests/CatsSuite.scala @@ -23,7 +23,7 @@ trait TestSettings extends Configuration with Matchers { lazy val slowCheckConfiguration: PropertyCheckConfiguration = if (Platform.isJvm) checkConfiguration - else PropertyCheckConfig(maxSize = 1, minSuccessful = 1) + else PropertyCheckConfiguration(minSuccessful = 1, sizeRange = 1) } /** diff --git a/tests/src/test/scala/cats/tests/NestedTests.scala b/tests/src/test/scala/cats/tests/NestedTests.scala index 9063647450..0032ea502a 100644 --- a/tests/src/test/scala/cats/tests/NestedTests.scala +++ b/tests/src/test/scala/cats/tests/NestedTests.scala @@ -13,7 +13,7 @@ class NestedTests extends CatsSuite { // Scalacheck to calm down a bit so we don't hit memory and test duration // issues. implicit override val generatorDrivenConfig: PropertyCheckConfiguration = - PropertyCheckConfig(maxSize = 5, minSuccessful = 20) + PropertyCheckConfiguration(minSuccessful = 20, sizeRange = 5) implicit val iso = { implicit val instance = ListWrapper.functor diff --git a/tests/src/test/scala/cats/tests/NonEmptyListTests.scala b/tests/src/test/scala/cats/tests/NonEmptyListTests.scala index 024c58b626..c913a8f8db 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyListTests.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyListTests.scala @@ -10,7 +10,7 @@ import cats.laws.discipline.arbitrary._ class NonEmptyListTests extends CatsSuite { // Lots of collections here.. telling ScalaCheck to calm down a bit implicit override val generatorDrivenConfig: PropertyCheckConfiguration = - PropertyCheckConfig(maxSize = 5, minSuccessful = 20) + PropertyCheckConfiguration(minSuccessful = 20, sizeRange = 5) checkAll("NonEmptyList[Int]", OrderLaws[NonEmptyList[Int]].order) diff --git a/tests/src/test/scala/cats/tests/NonEmptyVectorTests.scala b/tests/src/test/scala/cats/tests/NonEmptyVectorTests.scala index 53c4feacb9..51d95b7197 100644 --- a/tests/src/test/scala/cats/tests/NonEmptyVectorTests.scala +++ b/tests/src/test/scala/cats/tests/NonEmptyVectorTests.scala @@ -14,7 +14,7 @@ import scala.util.Properties class NonEmptyVectorTests extends CatsSuite { // Lots of collections here.. telling ScalaCheck to calm down a bit implicit override val generatorDrivenConfig: PropertyCheckConfiguration = - PropertyCheckConfig(maxSize = 5, minSuccessful = 20) + PropertyCheckConfiguration(minSuccessful = 20, sizeRange = 5) checkAll("NonEmptyVector[Int]", OrderLaws[NonEmptyVector[Int]].eqv) diff --git a/tests/src/test/scala/cats/tests/OneAndTests.scala b/tests/src/test/scala/cats/tests/OneAndTests.scala index f3a7b26f61..a3ec809c2e 100644 --- a/tests/src/test/scala/cats/tests/OneAndTests.scala +++ b/tests/src/test/scala/cats/tests/OneAndTests.scala @@ -10,7 +10,7 @@ import cats.laws.discipline.arbitrary._ class OneAndTests extends CatsSuite { // Lots of collections here.. telling ScalaCheck to calm down a bit implicit override val generatorDrivenConfig: PropertyCheckConfiguration = - PropertyCheckConfig(maxSize = 5, minSuccessful = 20) + PropertyCheckConfiguration(minSuccessful = 20, sizeRange = 5) checkAll("OneAnd[Stream, Int]", OrderLaws[OneAnd[Stream, Int]].eqv) diff --git a/tests/src/test/scala/cats/tests/WriterTTests.scala b/tests/src/test/scala/cats/tests/WriterTTests.scala index b41c680b23..69a261c1d9 100644 --- a/tests/src/test/scala/cats/tests/WriterTTests.scala +++ b/tests/src/test/scala/cats/tests/WriterTTests.scala @@ -17,7 +17,7 @@ class WriterTTests extends CatsSuite { // Scalacheck to calm down a bit so we don't hit memory and test duration // issues. implicit override val generatorDrivenConfig: PropertyCheckConfiguration = - PropertyCheckConfig(maxSize = 5, minSuccessful = 20) + PropertyCheckConfiguration(minSuccessful = 20, sizeRange = 5) checkAll("WriterT[List, Int, Int]", OrderLaws[WriterT[List, Int, Int]].eqv) checkAll("Eq[WriterT[List, Int, Int]]", SerializableTests.serializable(Eq[WriterT[List, Int, Int]])) From eda475fde34bc1463b44ff169e412414ad35981b Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sun, 23 Oct 2016 13:14:21 -0500 Subject: [PATCH 17/20] Update to catalysts 0.0.4 release --- build.sbt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 953e19eb4e..236c1e2afb 100644 --- a/build.sbt +++ b/build.sbt @@ -103,8 +103,8 @@ lazy val disciplineDependencies = Seq( libraryDependencies += "org.typelevel" %%% "discipline" % disciplineVersion) lazy val testingDependencies = Seq( - libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.4-SNAPSHOT", - libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.4-SNAPSHOT" % "test", + libraryDependencies += "org.typelevel" %%% "catalysts-platform" % "0.0.4", + libraryDependencies += "org.typelevel" %%% "catalysts-macros" % "0.0.4" % "test", libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion % "test") @@ -263,7 +263,7 @@ lazy val laws = crossProject.crossType(CrossType.Pure) .settings(moduleName := "cats-laws") .settings(catsSettings:_*) .settings(disciplineDependencies:_*) - .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.4-SNAPSHOT")) + .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.4")) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*) .jsSettings(coverageEnabled := false) From a139801bd1204b5998a53357839aef041556099c Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sun, 23 Oct 2016 13:14:42 -0500 Subject: [PATCH 18/20] Update sbt-microsites and remove explicit Tut dependency --- project/plugins.sbt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index f91d20229f..a5f76070cf 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,7 +10,4 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.4.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") -// Tut is transitively pulled in by sbt-microsites, but as of 0.2.6 that -// currently results in the wrong version (0.4.4 instead of 0.4.5). -addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.5") -addSbtPlugin("com.fortysevendeg" % "sbt-microsites" % "0.2.6") +addSbtPlugin("com.fortysevendeg" % "sbt-microsites" % "0.2.7") From 4c6fad8b295019692d1ca3ce7222a1ad41936421 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sun, 23 Oct 2016 14:03:16 -0500 Subject: [PATCH 19/20] Reinstate no coverage highlighting on 2.10 --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 236c1e2afb..621cef7714 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,8 @@ lazy val botBuild = settingKey[Boolean]("Build by TravisCI instead of local dev lazy val scoverageSettings = Seq( coverageMinimum := 60, - coverageFailOnMinimum := false + coverageFailOnMinimum := false, + coverageHighlighting := scalaBinaryVersion.value != "2.10" ) lazy val buildSettings = Seq( From d5734c3b40e648038731b90476bb49cf1ed7d102 Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Sun, 23 Oct 2016 17:16:21 -0500 Subject: [PATCH 20/20] Disable Scoverage on Scala 2.10 for cats-laws --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 621cef7714..85af356214 100644 --- a/build.sbt +++ b/build.sbt @@ -8,8 +8,7 @@ lazy val botBuild = settingKey[Boolean]("Build by TravisCI instead of local dev lazy val scoverageSettings = Seq( coverageMinimum := 60, - coverageFailOnMinimum := false, - coverageHighlighting := scalaBinaryVersion.value != "2.10" + coverageFailOnMinimum := false ) lazy val buildSettings = Seq( @@ -264,6 +263,7 @@ lazy val laws = crossProject.crossType(CrossType.Pure) .settings(moduleName := "cats-laws") .settings(catsSettings:_*) .settings(disciplineDependencies:_*) + .configureCross(disableScoverage210Jvm) .settings(libraryDependencies ++= Seq("org.typelevel" %%% "catalysts-platform" % "0.0.4")) .jsSettings(commonJsSettings:_*) .jvmSettings(commonJvmSettings:_*)