From f6892e6611822fb5fe4839b6501954fc83b45628 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 30 Sep 2024 16:13:02 +0000 Subject: [PATCH 1/5] Update scalafmt-core to 3.8.3 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index d2becd8..8f5b0f6 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.1 +version = 3.8.3 runner.dialect = scala213source3 project.git = true maxColumn = 120 From 5cde0aed9209ba4f4d81bc19f2af65744d16811f Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 30 Sep 2024 16:13:08 +0000 Subject: [PATCH 2/5] Reformat with scalafmt 3.8.3 Executed command: scalafmt --non-interactive --- itest/src/custom-rule/build.sc | 5 +++-- itest/src/custom-rule/project/src/Fix.scala | 4 ++-- itest/src/fix-2.12/build.sc | 2 +- itest/src/fix-3.5/build.sc | 13 +++++++------ itest/src/fix-3.5/project/src/Fix.scala | 4 ++-- itest/src/fix/build.sc | 4 ++-- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/itest/src/custom-rule/build.sc b/itest/src/custom-rule/build.sc index dd94346..d78a7c7 100644 --- a/itest/src/custom-rule/build.sc +++ b/itest/src/custom-rule/build.sc @@ -5,8 +5,9 @@ import mill.scalalib._ import os._ object project extends ScalaModule with ScalafixModule { - def scalaVersion = "2.12.17" - def semanticDbEnablePluginScalacOptions = super.semanticDbEnablePluginScalacOptions() ++ Seq("-P:semanticdb:synthetics:on") + def scalaVersion = "2.12.17" + def semanticDbEnablePluginScalacOptions = + super.semanticDbEnablePluginScalacOptions() ++ Seq("-P:semanticdb:synthetics:on") def scalafixIvyDeps = Agg(ivy"org.scala-lang.modules::scala-collection-migrations:2.12.0") } diff --git a/itest/src/custom-rule/project/src/Fix.scala b/itest/src/custom-rule/project/src/Fix.scala index bd4ec6f..0fd716d 100644 --- a/itest/src/custom-rule/project/src/Fix.scala +++ b/itest/src/custom-rule/project/src/Fix.scala @@ -3,8 +3,8 @@ object Tuple2ZippedSrc213 { def zipped(xs: List[Int], ys: List[Int]): Unit = { (xs, ys).zipped (xs, ys).zipped - ((xs, ys) zipped) - ((xs, ys).zipped) + (xs, ys) zipped + (xs, ys).zipped (xs, ys).zipped /* a */ ( /* b */ xs /* c */, /* d */ ys /* e */ ) /* f */ . /* g */ zipped /* h */ diff --git a/itest/src/fix-2.12/build.sc b/itest/src/fix-2.12/build.sc index 21dd5f5..a26e953 100644 --- a/itest/src/fix-2.12/build.sc +++ b/itest/src/fix-2.12/build.sc @@ -7,7 +7,7 @@ import os._ object project extends ScalaModule with ScalafixModule { def scalaVersion = "2.12.17" def scalacOptions = Seq("-Ywarn-unused") - def ivyDeps = Agg(ivy"org.scala-lang.modules::scala-collection-compat:2.12.0") + def ivyDeps = Agg(ivy"org.scala-lang.modules::scala-collection-compat:2.12.0") } def verify() = diff --git a/itest/src/fix-3.5/build.sc b/itest/src/fix-3.5/build.sc index 1902c8e..c9be268 100644 --- a/itest/src/fix-3.5/build.sc +++ b/itest/src/fix-3.5/build.sc @@ -11,11 +11,12 @@ object project extends ScalaModule with ScalafixModule { def verify() = T.command { val fixedScala = read(pwd / "project" / "src" / "Fix.scala") - val expected = """object Fix { - | // use a 3.5.x-only feature to fail if a Scala 3 LTS compiler is used - | // https://www.scala-lang.org/blog/2024/08/22/scala-3.5.0-released.html#support-for-binary-integer-literals - | def myComplexMethod: Map[Int, String] = 1.to(0B1010).map(i => i -> i.toString).toMap - |} - |""".stripMargin + val expected = + """object Fix { + | // use a 3.5.x-only feature to fail if a Scala 3 LTS compiler is used + | // https://www.scala-lang.org/blog/2024/08/22/scala-3.5.0-released.html#support-for-binary-integer-literals + | def myComplexMethod: Map[Int, String] = 1.to(0B1010).map(i => i -> i.toString).toMap + |} + |""".stripMargin assert(fixedScala == expected) } diff --git a/itest/src/fix-3.5/project/src/Fix.scala b/itest/src/fix-3.5/project/src/Fix.scala index 015479f..26c845c 100644 --- a/itest/src/fix-3.5/project/src/Fix.scala +++ b/itest/src/fix-3.5/project/src/Fix.scala @@ -1,5 +1,5 @@ object Fix { - // use a 3.5.x-only feature to fail if a Scala 3 LTS compiler is used - // https://www.scala-lang.org/blog/2024/08/22/scala-3.5.0-released.html#support-for-binary-integer-literals + // use a 3.5.x-only feature to fail if a Scala 3 LTS compiler is used + // https://www.scala-lang.org/blog/2024/08/22/scala-3.5.0-released.html#support-for-binary-integer-literals def myComplexMethod = 1.to(0B1010).map(i => i -> i.toString).toMap } diff --git a/itest/src/fix/build.sc b/itest/src/fix/build.sc index e64d549..6ba1fb3 100644 --- a/itest/src/fix/build.sc +++ b/itest/src/fix/build.sc @@ -5,9 +5,9 @@ import mill.scalalib._ import os._ object project extends ScalaModule with ScalafixModule { - def scalaVersion = "2.13.12" + def scalaVersion = "2.13.12" def scalafixScalaBinaryVersion = mill.scalalib.api.ZincWorkerUtil.scalaBinaryVersion(scalaVersion()) - def scalacOptions = Seq("-Ywarn-unused") + def scalacOptions = Seq("-Ywarn-unused") } def verify() = From 8724f228d5ea1e622ffb336e6470b26d997e4f25 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 30 Sep 2024 16:13:08 +0000 Subject: [PATCH 3/5] Add 'Reformat with scalafmt 3.8.3' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..dab64f2 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.8.3 +5cde0aed9209ba4f4d81bc19f2af65744d16811f From d5c50c011e406ea29ed0aec074c694abc1834137 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 1 Oct 2024 10:28:38 +0200 Subject: [PATCH 4/5] Avoid infix notation --- itest/src/custom-rule/project/src/Fix.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itest/src/custom-rule/project/src/Fix.scala b/itest/src/custom-rule/project/src/Fix.scala index 0fd716d..89dc5ba 100644 --- a/itest/src/custom-rule/project/src/Fix.scala +++ b/itest/src/custom-rule/project/src/Fix.scala @@ -3,7 +3,7 @@ object Tuple2ZippedSrc213 { def zipped(xs: List[Int], ys: List[Int]): Unit = { (xs, ys).zipped (xs, ys).zipped - (xs, ys) zipped + (xs, ys).zipped (xs, ys).zipped (xs, ys).zipped /* a */ From c620fe08c4e04680a3834708e677f0f87eaa1c83 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 1 Oct 2024 10:31:01 +0200 Subject: [PATCH 5/5] Align string to new content of file --- itest/src/fix-3.5/build.sc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/itest/src/fix-3.5/build.sc b/itest/src/fix-3.5/build.sc index c9be268..283a68d 100644 --- a/itest/src/fix-3.5/build.sc +++ b/itest/src/fix-3.5/build.sc @@ -13,8 +13,8 @@ def verify() = val fixedScala = read(pwd / "project" / "src" / "Fix.scala") val expected = """object Fix { - | // use a 3.5.x-only feature to fail if a Scala 3 LTS compiler is used - | // https://www.scala-lang.org/blog/2024/08/22/scala-3.5.0-released.html#support-for-binary-integer-literals + | // use a 3.5.x-only feature to fail if a Scala 3 LTS compiler is used + | // https://www.scala-lang.org/blog/2024/08/22/scala-3.5.0-released.html#support-for-binary-integer-literals | def myComplexMethod: Map[Int, String] = 1.to(0B1010).map(i => i -> i.toString).toMap |} |""".stripMargin