Repository: scala-steward-org/scala-steward
Pull request #1601 (2020-09-03 20:33:54)

Update Scala to 2.13.3


Patch:
diff --git a/.travis.yml b/.travis.yml
index ceb7e6f9..039647df 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ os: linux
 dist: xenial
 
 scala: 
-  - 2.13.2
+  - 2.13.3
   - 2.12.10
 
 jdk:
diff --git a/build.sbt b/build.sbt
index 32944682..b696ceb3 100644
--- a/build.sbt
+++ b/build.sbt
@@ -15,7 +15,7 @@ val moduleCrossPlatformMatrix: Map[String, List[Platform]] = Map(
 )
 
 val Scala212 = "2.12.10"
-val Scala213 = "2.13.2"
+val Scala213 = "2.13.3"
 
 /// projects
 
@@ -62,8 +62,7 @@ lazy val core = myCrossProject("core")
       Dependencies.http4sDsl % Test,
       Dependencies.refinedScalacheck % Test,
       Dependencies.scalacheck % Test,
-      Dependencies.scalaTestFunSuite % Test,
-      Dependencies.scalaTestShouldMatcher % Test
+      Dependencies.scalaTest % Test
     ),
     assembly / test := {},
     assemblyMergeStrategy in assembly := {
diff --git a/modules/core/src/main/resources/scalafix-migrations.conf b/modules/core/src/main/resources/scalafix-migrations.conf
index dcd43e7c..cb8c9026 100644
--- a/modules/core/src/main/resources/scalafix-migrations.conf
+++ b/modules/core/src/main/resources/scalafix-migrations.conf
@@ -93,7 +93,7 @@ migrations = [
   {
     groupId: "org.typelevel",
     artifactIds: ["cats-core"],
-    newVersion: "2.2.0",
+    newVersion: "2.2.0-RC4",
     rewriteRules: ["github:typelevel/cats/Cats_v2_2_0"],
     doc: "https://github.com/typelevel/cats/blob/master/scalafix/README.md#migration-to-cats-v220",
     scalacOptions: ["-P:semanticdb:synthetics:on"]
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index b0c31d37..a241f334 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -1,10 +1,9 @@
 import sbt._
 import sbt.Keys._
-import sbt.librarymanagement.syntax.ExclusionRule
 
 object Dependencies {
   val mill = Def.setting {
-    val version = if (scalaBinaryVersion.value == "2.12") "0.6.3" else "0.8.0-8-0a8d46"
+    val version = if (scalaBinaryVersion.value == "2.12") "0.6.3" else "0.8.0-6-bbbf19"
     "com.lihaoyi" %% "mill-scalalib" % version
   }
   val attoCore = "org.tpolecat" %% "atto-core" % "0.8.0"
@@ -24,8 +23,7 @@ object Dependencies {
   val coursierCore = "io.get-coursier" %% "coursier" % "2.0.0-RC6-25"
   val coursierCatsInterop = "io.get-coursier" %% "coursier-cats-interop" % coursierCore.revision
   val cron4sCore = "com.github.alonsodomin.cron4s" %% "cron4s-core" % "0.6.1"
-  val disciplineScalatest = ("org.typelevel" %% "discipline-scalatest" % "2.0.1")
-    .excludeAll(ExclusionRule().withOrganization("org.scalatest"))
+  val disciplineScalatest = "org.typelevel" %% "discipline-scalatest" % "2.0.1"
   val fs2Core = "co.fs2" %% "fs2-core" % "2.4.4"
   val http4sAsyncHttpClient = "org.http4s" %% "http4s-async-http-client" % "0.21.7"
   val http4sCirce = "org.http4s" %% "http4s-circe" % http4sAsyncHttpClient.revision
@@ -41,7 +39,5 @@ object Dependencies {
   val scalacacheCatsEffect =
     "com.github.cb372" %% "scalacache-cats-effect" % scalacacheCaffeine.revision
   val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.3"
-  val scalaTestFunSuite = "org.scalatest" %% "scalatest-funsuite" % "3.2.2"
-  val scalaTestShouldMatcher =
-    "org.scalatest" %% "scalatest-shouldmatchers" % scalaTestFunSuite.revision
+  val scalaTest = "org.scalatest" %% "scalatest" % "3.2.2"
 }


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/data/ExampleTest.scala b/modules/core/src/test/scala/org/scalasteward/core/data/ExampleTest.scala
new file mode 100644
index 00000000..ceb821b7
--- /dev/null
+++ b/modules/core/src/test/scala/org/scalasteward/core/data/ExampleTest.scala
@@ -0,0 +1,86 @@
+package org.scalasteward.core.data
+
+import org.scalasteward.core.TestSyntax._
+import org.scalasteward.core.data.Update.Single
+import org.scalasteward.core.edit.UpdateHeuristicTest.UpdateOps
+import org.scalasteward.core.util.Nel
+import org.scalatest.matchers.should.Matchers
+import org.scalatest.wordspec.AnyWordSpec
+
+class ExampleTest extends AnyWordSpec with Matchers {
+  "Good examples of dependency definitions".which {
+    "will be identified by scala-steward without any problems are".that {
+      val goodExample1 = """val scalajsJqueryVersion = "0.9.3""""
+      s"$goodExample1" in {
+        val expectedResult = Some("""val scalajsJqueryVersion = "0.9.4"""")
+        Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
+          .replaceVersionIn(goodExample1)
+          ._1 shouldBe expectedResult
+      }
+
+      val goodExample2 = """val SCALAJSJQUERYVERSION = "0.9.3""""
+      s"$goodExample2" in {
+        val expectedResult = Some("""val SCALAJSJQUERYVERSION = "0.9.4"""")
+        Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
+          .replaceVersionIn(goodExample2)
+          ._1 shouldBe expectedResult
+      }
+
+      val goodExample3 = """val scalajsjquery = "0.9.3""""
+      s"$goodExample3" in {
+        val expectedResult = Some("""val scalajsjquery = "0.9.4"""")
+        Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
+          .replaceVersionIn(goodExample3)
+          ._1 shouldBe expectedResult
+      }
+
+      val goodExample4 = """addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24")"""
+      s"$goodExample4" in {
+        val expectedResult = Some("""addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.25")""")
+        Single("org.scala-js" % "sbt-scalajs" % "0.6.24", Nel.of("0.6.25"))
+          .replaceVersionIn(goodExample4)
+          ._1 shouldBe expectedResult
+      }
+
+      val goodExample5 = """"be.doeraene" %% "scalajs-jquery"  % "0.9.3""""
+      s"$goodExample5" in {
+        val expectedResult = Some(""""be.doeraene" %% "scalajs-jquery"  % "0.9.4"""")
+        Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
+          .replaceVersionIn(goodExample5)
+          ._1 shouldBe expectedResult
+      }
+
+      val goodExample6 = """val `scalajs-jquery-version` = "0.9.3""""
+      s"$goodExample6" in {
+        val expectedResult = Some("""val `scalajs-jquery-version` = "0.9.4"""")
+        Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
+          .replaceVersionIn(goodExample6)
+          ._1 shouldBe expectedResult
+      }
+    }
+  }
+
+  "Bad examples of dependency definitions".which {
+    "won't be identified by scala-steward are".that {
+      val badExample1 =
+        """val scalajsJqueryVersion =
+          |  "0.9.3"""".stripMargin
+      s"$badExample1" in {
+        val expectedResult = None
+        Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
+          .replaceVersionIn(badExample1)
+          ._1 shouldBe expectedResult
+      }
+
+      val badExample2 =
+        """val scalajsJqueryVersion = "0.9.3" // val scalajsJqueryVersion = "0.9.3""""
+      s"$badExample2" in {
+        val expectedResult =
+          Some("""val scalajsJqueryVersion = "0.9.3" // val scalajsJqueryVersion = "0.9.4"""")
+        Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
+          .replaceVersionIn(badExample2)
+          ._1 shouldBe expectedResult
+      }
+    }
+  }
+}
diff --git a/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala b/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
index 5a22bc7c..41ac80b0 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/edit/UpdateHeuristicTest.scala
@@ -41,13 +41,6 @@ class UpdateHeuristicTest extends AnyFunSuite with Matchers {
       .replaceVersionIn(original) shouldBe (None -> UpdateHeuristic.all.last.name)
   }
 
-  test("all on one line") {
-    val original = """"be.doeraene" %% "scalajs-jquery"  % "0.9.3""""
-    val expected = """"be.doeraene" %% "scalajs-jquery"  % "0.9.4""""
-    Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
-      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.moduleId.name)
-  }
-
   test("ignore hyphen in artifactId") {
     val original = """val scalajsJqueryVersion = "0.9.3""""
     val expected = """val scalajsJqueryVersion = "0.9.4""""
@@ -55,27 +48,6 @@ class UpdateHeuristicTest extends AnyFunSuite with Matchers {
       .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.original.name)
   }
 
-  test("with single quotes around val") {
-    val original = """val `scalajs-jquery-version` = "0.9.3""""
-    val expected = """val `scalajs-jquery-version` = "0.9.4""""
-    Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
-      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.relaxed.name)
-  }
-
-  test("all upper case") {
-    val original = """val SCALAJSJQUERYVERSION = "0.9.3""""
-    val expected = """val SCALAJSJQUERYVERSION = "0.9.4""""
-    Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
-      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.original.name)
-  }
-
-  test("just artifactId without version") {
-    val original = """val scalajsjquery = "0.9.3""""
-    val expected = """val scalajsjquery = "0.9.4""""
-    Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
-      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.original.name)
-  }
-
   test("commented val") {
     val original =
       """// val scalajsJqueryVersion = "0.9.3
@@ -433,21 +405,6 @@ class UpdateHeuristicTest extends AnyFunSuite with Matchers {
     Single("org.typelevel" % "cats-core" % "1.2.0", Nel.of("1.3.0"))
       .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.moduleId.name)
   }
-
-  test("fail on versions with line break") {
-    val original = """val scalajsJqueryVersion =
-                     |  "0.9.3"""".stripMargin
-    Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
-      .replaceVersionIn(original)
-      ._1 shouldBe None
-  }
-
-  test("fail on versions duplicated in a comment") {
-    val original = """val scalajsJqueryVersion = "0.9.3" // val scalajsJqueryVersion = "0.9.3""""
-    val expected = """val scalajsJqueryVersion = "0.9.3" // val scalajsJqueryVersion = "0.9.4""""
-    Single("be.doeraene" % "scalajs-jquery" % "0.9.3", Nel.of("0.9.4"))
-      .replaceVersionIn(original) shouldBe (Some(expected) -> UpdateHeuristic.original.name)
-  }
 }
 
 object UpdateHeuristicTest {