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

update scala3-migrate to 2.13.7 and 3.1.0 #302

Merged
merged 1 commit into from
Jan 4, 2022
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
12 changes: 6 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ lazy val `scalafix-output` = project
crossScalaVersions := List(V.scala213, V.scala3),
scalacOptions ++= (if (scalaVersion.value.startsWith("3")) Seq("-Ykind-projector") else Seq()),
libraryDependencies ++= {
Seq("org.typelevel" % "cats-core_2.13" % V.catsCore, "dev.zio" %% "zio" % V.zio) ++
Seq("org.typelevel" %% "cats-core" % V.catsCore, "dev.zio" %% "zio" % V.zio) ++
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) =>
Seq(compilerPlugin(("org.typelevel" %% "kind-projector" % V.kindProjector).cross(CrossVersion.full)))
Expand Down Expand Up @@ -204,19 +204,19 @@ addCommandAlias("compileScalafixOutputinScala3", s"""set `scalafix-output`/scala
def isCI = System.getenv("CI") != null

lazy val V = new {
val scala213 = "2.13.6"
val scala213 = "2.13.7"
val scala213BinaryVersion = "2.13"
val scala212 = "2.12.14"
val scalatest = "3.2.10"
val scala3 = "3.0.2"
val scalafix = "0.9.31"
val scala3 = "3.1.0"
val scalafix = "0.9.33"
val scribe = "3.6.7"
val organizeImports = "0.4.3"
val catsCore = "2.7.0"
val kindProjector = "0.13.2"
val coursierApi = "2.0.16"
val coursierInterface = "1.0.4"
val scalameta = "4.4.21"
val localSnapshotVersion = "0.4.0-SNAPSHOT"
val scalameta = "4.4.31"
val localSnapshotVersion = "0.5.0-SNAPSHOT"
val zio = "1.0.12"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void doReport(dotty.tools.dotc.reporting.Diagnostic dia, Context ctx) {
if (dia.level() == Diagnostic.ERROR) {
Message message = dia.msg();
StringBuilder rendered = new StringBuilder();
rendered.append(messageAndPos(message, dia.pos(), diagnosticLevel(dia), ctx));
rendered.append(messageAndPos(dia, ctx));

boolean shouldExplain = dotty.tools.dotc.reporting.Diagnostic.shouldExplain(dia, ctx);
if (shouldExplain && !message.explanation().isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/scala/migrate/Messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ private[migrate] object Messages {
|
|Your project must be in 2.13 and not in $scalaVersion
|Please change the scalaVersion following this command
|set LocalProject("$projectId") / scalaVersion := "2.13.5"
|set LocalProject("$projectId") / scalaVersion := "2.13.7"
|
|
|""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
ThisBuild / scalaVersion := "2.13.5"
ThisBuild / scalaVersion := "2.13.7"

lazy val subproject = project
.in(file("subproject"))
.settings(TaskKey[Unit]("checkNotMigrated") := {
assert(scalaVersion.value == "2.13.5")
assert(scalaVersion.value == "2.13.7")
})

lazy val `aggregate-project` = project
.in(file("."))
.settings(TaskKey[Unit]("checkMigration") := {
assert(scalaVersion.value == "3.0.2", s"Wrong scala version ${scalaVersion.value}. Expected 3.0.2")
assert(scalaVersion.value == "3.1.0", s"Wrong scala version ${scalaVersion.value}. Expected 3.1.0")
(Compile / compile).value
})
.aggregate(subproject)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.3
sbt.version=1.6.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ lazy val `integration-test` = project
.in(file("integration-test"))
.configs(IntegrationTest)
.settings(
scalaVersion := "2.13.5",
scalaVersion := "2.13.7",
// Enable migration on IntegrationTest config
inConfig(IntegrationTest)(Defaults.itSettings ++ ScalaMigratePlugin.configSettings),
TaskKey[Unit]("checkMigration") := {
assert(scalaVersion.value == "3.0.2")
assert(scalaVersion.value == "3.1.0")
(IntegrationTest / compile).value
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ lazy val `library-dependencies` = project
else Seq(compilerPlugin("org.typelevel" % "kind-projector" % V.kindProjector cross CrossVersion.full))
},
TaskKey[Unit]("checkMigration") := {
assert(scalaVersion.value == "3.0.2", s"Wrong scala version ${scalaVersion.value}. Expected 3.0.2")
assert(scalaVersion.value == "3.1.0", s"Wrong scala version ${scalaVersion.value}. Expected 3.1.0")
(Compile / compile).value
}
)

lazy val V = new {
val scala213 = "2.13.5"
val scala213 = "2.13.7"
val catsCore = "2.7.0"
val kindProjector = "0.13.2"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lazy val `managed-sources` = project
.in(file("."))
.settings(
scalaVersion := "2.13.5",
scalaVersion := "2.13.7",
Compile / sourceGenerators += Def.task {
val file = (Compile / sourceManaged).value / "buildinfo" / "BuildInfo.scala"
val buildInfo = s"""|
Expand All @@ -15,7 +15,7 @@ lazy val `managed-sources` = project
Seq(file)
},
TaskKey[Unit]("checkMigration") := {
assert(scalaVersion.value == "3.0.2", s"Wrong scala version ${scalaVersion.value}. Expected 3.0.2")
assert(scalaVersion.value == "3.1.0", s"Wrong scala version ${scalaVersion.value}. Expected 3.1.0")
(Compile / compile).value
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import migrate.ScalaMigratePlugin
lazy val `scalac-options-migration` = project
.in(file("."))
.settings(
scalaVersion := "2.13.5",
scalaVersion := "2.13.7",
scalacOptions ++= Seq(
"-encoding",
"UTF-8",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
lazy val `syntax-migration` = project
.in(file("."))
.settings(scalaVersion := "2.13.5")
.settings(scalaVersion := "2.13.7")
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lazy val `type-inference-migration` = project
.in(file("."))
.settings(
scalaVersion := "2.13.5",
scalaVersion := "2.13.7",
TaskKey[Unit]("checkMigration") := {
assert(scalaVersion.value == "3.0.2", s"Wrong scala version ${scalaVersion.value}. Expected 3.0.2")
assert(scalaVersion.value == "3.1.0", s"Wrong scala version ${scalaVersion.value}. Expected 3.1.0")
(Test / compile).value
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lazy val `unresolved-dependencies` = project
)

lazy val V = new {
val scala213 = "2.13.5"
val scala213 = "2.13.7"
val catsCore = "2.7.0"
val kindProjector = "0.13.2"
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.7
sbt.version=1.6.1
4 changes: 2 additions & 2 deletions scalafix/output/src/main/scala/incompat/Cats5.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ trait MapInstances extends cats.kernel.instances.MapInstances {
def flatMap[A, B](fa: Map[K, A])(f: (A) => Map[K, B]): Map[K, B] =
fa.flatMap[K, B] { case (k, a) => f(a).get(k).map[(K, B)]((k, _)) }

def unorderedFoldMap[A, B: CommutativeMonoid](fa: Map[K, A])(f: (A) => B): B =
fa.foldLeft[B](Monoid[B].empty) { case (b, (k, a)) => Monoid[B].combine(b, f(a)) }
def unorderedFoldMap[A, B: CommutativeMonoid](fa: Map[K, A])(f: (A) => B) =
fa.foldLeft(Monoid[B].empty) { case (b, (k, a)) => Monoid[B].combine(b, f(a)) }

def tailRecM[A, B](a: A)(f: A => Map[K, Either[A, B]]): Map[K, B] = {
val bldr: collection.mutable.Builder[(K, B),Map[K,B]] = Map.newBuilder[K, B]
Expand Down
2 changes: 1 addition & 1 deletion scalafix/tests/src/test/scala/migrate/RuleSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import scalafix.testkit._
class RuleSuite extends AbstractSemanticRuleSuite with FunSuiteLike {
val (passing, failing) = testsToRun.partition(!_.path.testName.contains("_fails"))
passing.foreach(runOn)
// runSpecificTests("Polytypes2")
// runSpecificTests("Cats5")
// writeTestResult("TypeApply2")

// writeTestResult("implicits/")
Expand Down