diff --git a/input/src/main/scala/migrateSyntax/Any2String.scala b/input/src/main/scala/migrateSyntax/Any2String.scala new file mode 100644 index 00000000..b384d8b4 --- /dev/null +++ b/input/src/main/scala/migrateSyntax/Any2String.scala @@ -0,0 +1,5 @@ +package migrateSyntax + +object Any2String { + val str = new AnyRef + "foo" +} diff --git a/input/src/main/scala/migrateSyntax/AutoApplication.scala b/input/src/main/scala/migrateSyntax/AutoApplication.scala deleted file mode 100644 index 7da42408..00000000 --- a/input/src/main/scala/migrateSyntax/AutoApplication.scala +++ /dev/null @@ -1,8 +0,0 @@ -package migrateSyntax - -object AutoApplication { - trait Chunk { - def bytes(): Seq[Byte] - def toSeq: Seq[Byte] = bytes - } -} diff --git a/input/src/main/scala/migrateSyntax/LambdaParam.scala b/input/src/main/scala/migrateSyntax/LambdaParam.scala deleted file mode 100644 index ea8f5bc0..00000000 --- a/input/src/main/scala/migrateSyntax/LambdaParam.scala +++ /dev/null @@ -1,5 +0,0 @@ -package migrateSyntax - -object LambdaParam { - val f = { x: Int => x * x } -} \ No newline at end of file diff --git a/input/src/main/scala/migrateSyntax/ValueEtaExpansion.scala b/input/src/main/scala/migrateSyntax/ValueEtaExpansion.scala deleted file mode 100644 index e679fddd..00000000 --- a/input/src/main/scala/migrateSyntax/ValueEtaExpansion.scala +++ /dev/null @@ -1,6 +0,0 @@ -package migrateSyntax - -object ValueEtaExpansion { - val x = 1 - val f: () => Int = x _ -} \ No newline at end of file diff --git a/migrate/src/main/scala/migrate/utils/ScalafixService.scala b/migrate/src/main/scala/migrate/utils/ScalafixService.scala index 332210c9..de7c2c53 100644 --- a/migrate/src/main/scala/migrate/utils/ScalafixService.scala +++ b/migrate/src/main/scala/migrate/utils/ScalafixService.scala @@ -70,13 +70,7 @@ object ScalafixService { private lazy val internalRules = getClassPathforMigrateRules() private lazy val externalRules = getClassPathforRewriteRules() - val fixSyntaxRules: Seq[String] = Seq( - "ProcedureSyntax", - "fix.scala213.ExplicitNullaryEtaExpansion", - "fix.scala213.ParensAroundLambda", - "fix.scala213.ExplicitNonNullaryApply", - "fix.scala213.Any2StringAdd" - ) + val fixSyntaxRules: Seq[String] = Seq("ProcedureSyntax", "fix.scala213.Any2StringAdd", "ExplicitResultTypes") val addExplicitResultTypesAndImplicits: Seq[String] = Seq("MigrationRule") def from(compilerOptions: Seq[String], classpath: Classpath, targetRootSemantic: AbsolutePath): Try[ScalafixService] = diff --git a/migrate/src/test/scala/migrate/MigrateLibsSuite.scala b/migrate/src/test/scala/migrate/MigrateLibsSuite.scala index c2f3b44c..3465fe69 100644 --- a/migrate/src/test/scala/migrate/MigrateLibsSuite.scala +++ b/migrate/src/test/scala/migrate/MigrateLibsSuite.scala @@ -60,7 +60,6 @@ class MigrateLibsSuite extends AnyFunSuiteLike { val migrated = Scala3Migrate.migrateLibs(Seq(cats213)).allLibs val res = migrated(cats213) assert(res.isCompatibleWithScala3) - println(s"res = ${res}") assert(res.asInstanceOf[CompatibleWithScala3.Lib].crossVersion.isInstanceOf[CrossVersion.Binary]) } test("Don't show older version") { @@ -94,7 +93,6 @@ class MigrateLibsSuite extends AnyFunSuiteLike { assert(message == "Other versions are avaialble for Scala 3: \"1\", ..., \"4\"") val revisions2 = Seq(Revision("1"), Revision("2")) val message2 = Reason.Scala3LibAvailable(revisions2).why - println(s"message2 = ${message2}") assert(message2 == "Other versions are avaialble for Scala 3: \"1\", \"2\"") } diff --git a/output/src/main/scala/migrateSyntax/Any2String.scala b/output/src/main/scala/migrateSyntax/Any2String.scala new file mode 100644 index 00000000..21bd5b80 --- /dev/null +++ b/output/src/main/scala/migrateSyntax/Any2String.scala @@ -0,0 +1,5 @@ +package migrateSyntax + +object Any2String { + val str: String = String.valueOf(new AnyRef) + "foo" +} diff --git a/output/src/main/scala/migrateSyntax/AutoApplication.scala b/output/src/main/scala/migrateSyntax/AutoApplication.scala deleted file mode 100644 index 6f266e07..00000000 --- a/output/src/main/scala/migrateSyntax/AutoApplication.scala +++ /dev/null @@ -1,8 +0,0 @@ -package migrateSyntax - -object AutoApplication { - trait Chunk { - def bytes(): Seq[Byte] - def toSeq: Seq[Byte] = bytes() - } -} diff --git a/output/src/main/scala/migrateSyntax/LambdaParam.scala b/output/src/main/scala/migrateSyntax/LambdaParam.scala deleted file mode 100644 index 0d3767ae..00000000 --- a/output/src/main/scala/migrateSyntax/LambdaParam.scala +++ /dev/null @@ -1,5 +0,0 @@ -package migrateSyntax - -object LambdaParam { - val f = { (x: Int) => x * x } -} \ No newline at end of file diff --git a/output/src/main/scala/migrateSyntax/ValueEtaExpansion.scala b/output/src/main/scala/migrateSyntax/ValueEtaExpansion.scala deleted file mode 100644 index 99e55c35..00000000 --- a/output/src/main/scala/migrateSyntax/ValueEtaExpansion.scala +++ /dev/null @@ -1,6 +0,0 @@ -package migrateSyntax - -object ValueEtaExpansion { - val x = 1 - val f: () => Int = () => x -} diff --git a/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/main/scala/hello/MigrateSyntax.scala b/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/main/scala/hello/MigrateSyntax.scala index a9a23e9e..49de7e3b 100644 --- a/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/main/scala/hello/MigrateSyntax.scala +++ b/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/main/scala/hello/MigrateSyntax.scala @@ -13,20 +13,6 @@ object MigrateSyntaxTest { } } - //fix.scala213.ParensAroundLambda - val f = { x: Int => x * x } - - //fix.scala213.ExplicitNonNullaryApply - trait Chunk { - def bytes(): Seq[Byte] - - def toSeq: Seq[Byte] = bytes - } - - //fix.scala213.ExplicitNullaryEtaExpansion - val x = 1 - val g: () => Int = x _ - //fix.scala213.Any2StringAdd val str = new AnyRef + "foo" } diff --git a/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/test/scala/hello/MigrateSyntaxTest.scala b/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/test/scala/hello/MigrateSyntaxTest.scala index ec334e24..86e28abc 100644 --- a/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/test/scala/hello/MigrateSyntaxTest.scala +++ b/plugin/src/sbt-test/sbt-scala3-migrate/syntax-migration/src/test/scala/hello/MigrateSyntaxTest.scala @@ -13,20 +13,6 @@ object MigrateSyntax { } } - //fix.scala213.ParensAroundLambda - val f = { x: Int => x * x } - - //fix.scala213.ExplicitNonNullaryApply - trait Chunk { - def bytes(): Seq[Byte] - - def toSeq: Seq[Byte] = bytes - } - - //fix.scala213.ExplicitNullaryEtaExpansion - val x = 1 - val g: () => Int = x _ - //fix.scala213.Any2StringAdd val str = new AnyRef + "foo" }