From 8d76ebb26ea14c0ae72d71590f800a40faacbf56 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:12:16 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.10.2 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 8ec24185..a251a02e 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.10.1" +version = "3.10.2" runner.dialect=scala213source3 From 484f3dfa40b657e703a9d5a6024e39c60a620375 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:12:21 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.10.2 Executed command: scalafmt --non-interactive --- scalafix/build.sbt | 6 ++- .../src/main/scala/fix/AddClueToExpect.scala | 6 +-- .../src/main/scala/fix/RemoveTagged.scala | 15 ++++++-- ...ssertionExceptionToExpectationFailed.scala | 12 ++++-- .../rules/src/main/scala/fix/v0_11_0.scala | 29 ++++++++++---- ...tionExceptionToExpectationFailedTest.scala | 10 +++-- ...tionExceptionToExpectationFailedTest.scala | 10 +++-- .../main/scala/fix/AddClueToExpectTest.scala | 4 +- .../main/scala/fix/RewriteExpectTest.scala | 10 ++--- .../main/scala/fix/AddClueToExpectTest.scala | 13 ++++--- .../main/scala/fix/RewriteExpectTest.scala | 38 ++++++++++--------- 11 files changed, 97 insertions(+), 56 deletions(-) diff --git a/scalafix/build.sbt b/scalafix/build.sbt index c00581da..824aad4f 100644 --- a/scalafix/build.sbt +++ b/scalafix/build.sbt @@ -56,11 +56,13 @@ lazy val v0_9_0_tests = makeTests("v0_9_0", v0_9_0_input, v0_9_0_output) lazy val v0_11_0_input = makeInput("v0_11_0", "org.typelevel" %% "weaver-cats" % "0.10.1") lazy val v0_11_0_output = - makeOutput("v0_11_0", "org.typelevel" %% "weaver-cats" % "0.11-799b8e6-SNAPSHOT") + makeOutput("v0_11_0", + "org.typelevel" %% "weaver-cats" % "0.11-799b8e6-SNAPSHOT") lazy val v0_11_0_tests = makeTests("v0_11_0", v0_11_0_input, v0_11_0_output) lazy val testsAggregate = Project("tests", file("target/testsAggregate")) - .aggregate(v0_8_3_tests.projectRefs ++ v0_9_0_tests.projectRefs ++ v0_11_0_tests.projectRefs: _*) + .aggregate( + v0_8_3_tests.projectRefs ++ v0_9_0_tests.projectRefs ++ v0_11_0_tests.projectRefs: _*) .settings( publish / skip := true ) diff --git a/scalafix/rules/src/main/scala/fix/AddClueToExpect.scala b/scalafix/rules/src/main/scala/fix/AddClueToExpect.scala index 68af3a6d..88555400 100644 --- a/scalafix/rules/src/main/scala/fix/AddClueToExpect.scala +++ b/scalafix/rules/src/main/scala/fix/AddClueToExpect.scala @@ -24,10 +24,10 @@ class AddClueToExpect extends SemanticRule("AddClueToExpect") { private def makeClue(expr: Term)(implicit doc: SemanticDocument): Term = { expr match { - case _: Term.Name => q"clue($expr)" - case _: Term.Apply => q"clue($expr)" + case _: Term.Name => q"clue($expr)" + case _: Term.Apply => q"clue($expr)" case _: Term.Select => q"clue($expr)" - case _ => expr + case _ => expr } } diff --git a/scalafix/rules/src/main/scala/fix/RemoveTagged.scala b/scalafix/rules/src/main/scala/fix/RemoveTagged.scala index fec008b3..4d134296 100644 --- a/scalafix/rules/src/main/scala/fix/RemoveTagged.scala +++ b/scalafix/rules/src/main/scala/fix/RemoveTagged.scala @@ -6,13 +6,20 @@ class RemoveTagged extends SemanticRule("RemoveTagged") { override def fix(implicit doc: SemanticDocument): Patch = { val taggedMethod = - SymbolMatcher.normalized("weaver/Expectations.Helpers#StringOps#tagged().") + SymbolMatcher.normalized( + "weaver/Expectations.Helpers#StringOps#tagged().") doc.tree.collect { - case tree @ Term.Apply.After_4_6_0(Term.Select(testName, taggedMethod(_)), Term.ArgClause(List(Lit.String("ignore")), None)) => + case tree @ Term.Apply.After_4_6_0( + Term.Select(testName, taggedMethod(_)), + Term.ArgClause(List(Lit.String("ignore")), None)) => Patch.replaceTree(tree, q"$testName.ignore".toString) - case tree @ Term.Apply.After_4_6_0(Term.Select(testName, taggedMethod(_)), Term.ArgClause(List(Lit.String("only")), None)) => + case tree @ Term.Apply.After_4_6_0( + Term.Select(testName, taggedMethod(_)), + Term.ArgClause(List(Lit.String("only")), None)) => Patch.replaceTree(tree, q"$testName.only".toString) - case tree @ Term.Apply.After_4_6_0(Term.Select(testName, taggedMethod(_)), Term.ArgClause(List(Lit.String(other)), None)) => + case tree @ Term.Apply.After_4_6_0( + Term.Select(testName, taggedMethod(_)), + Term.ArgClause(List(Lit.String(other)), None)) => Patch.replaceTree(tree, s"$testName") }.asPatch } diff --git a/scalafix/rules/src/main/scala/fix/RenameAssertionExceptionToExpectationFailed.scala b/scalafix/rules/src/main/scala/fix/RenameAssertionExceptionToExpectationFailed.scala index 5efadfda..d447ec8b 100644 --- a/scalafix/rules/src/main/scala/fix/RenameAssertionExceptionToExpectationFailed.scala +++ b/scalafix/rules/src/main/scala/fix/RenameAssertionExceptionToExpectationFailed.scala @@ -2,16 +2,20 @@ package fix import scalafix.v1._ import scala.meta._ -class RenameAssertionExceptionToExpectationFailed extends SemanticRule("RenameAssertionExceptionToExpectationFailed") { +class RenameAssertionExceptionToExpectationFailed + extends SemanticRule("RenameAssertionExceptionToExpectationFailed") { override def fix(implicit doc: SemanticDocument): Patch = { val symbol = SymbolMatcher.normalized("weaver/AssertionException") doc.tree.collect { case symbol(tree) => tree match { - case q"AssertionException" => Patch.replaceTree(tree, s"new ExpectationFailed") - case t"AssertionException" => Patch.replaceTree(tree, s"ExpectationFailed") - case importee"AssertionException" => Patch.replaceTree(tree, s"ExpectationFailed") + case q"AssertionException" => + Patch.replaceTree(tree, s"new ExpectationFailed") + case t"AssertionException" => + Patch.replaceTree(tree, s"ExpectationFailed") + case importee"AssertionException" => + Patch.replaceTree(tree, s"ExpectationFailed") case _ => Patch.empty } }.asPatch diff --git a/scalafix/rules/src/main/scala/fix/v0_11_0.scala b/scalafix/rules/src/main/scala/fix/v0_11_0.scala index bf5f752a..18ed1eaa 100644 --- a/scalafix/rules/src/main/scala/fix/v0_11_0.scala +++ b/scalafix/rules/src/main/scala/fix/v0_11_0.scala @@ -5,7 +5,10 @@ import scala.meta._ class v0_11_0 extends SemanticRule("v0_11_0") { override def fix(implicit doc: SemanticDocument): Patch = - List(renameCancelToIgnore, renameAssertionException, removeTagged, renameVerify).asPatch + List(renameCancelToIgnore, + renameAssertionException, + removeTagged, + renameVerify).asPatch def renameCancelToIgnore(implicit doc: SemanticDocument): Patch = { val cancelMethod = @@ -26,9 +29,12 @@ class v0_11_0 extends SemanticRule("v0_11_0") { doc.tree.collect { case symbol(tree) => tree match { - case q"AssertionException" => Patch.replaceTree(tree, s"new ExpectationFailed") - case t"AssertionException" => Patch.replaceTree(tree, s"ExpectationFailed") - case importee"AssertionException" => Patch.replaceTree(tree, s"ExpectationFailed") + case q"AssertionException" => + Patch.replaceTree(tree, s"new ExpectationFailed") + case t"AssertionException" => + Patch.replaceTree(tree, s"ExpectationFailed") + case importee"AssertionException" => + Patch.replaceTree(tree, s"ExpectationFailed") case _ => Patch.empty } }.asPatch @@ -36,13 +42,20 @@ class v0_11_0 extends SemanticRule("v0_11_0") { def removeTagged(implicit doc: SemanticDocument): Patch = { val taggedMethod = - SymbolMatcher.normalized("weaver/Expectations.Helpers#StringOps#tagged().") + SymbolMatcher.normalized( + "weaver/Expectations.Helpers#StringOps#tagged().") doc.tree.collect { - case tree @ Term.Apply.After_4_6_0(Term.Select(testName, taggedMethod(_)), Term.ArgClause(List(Lit.String("ignore")), None)) => + case tree @ Term.Apply.After_4_6_0( + Term.Select(testName, taggedMethod(_)), + Term.ArgClause(List(Lit.String("ignore")), None)) => Patch.replaceTree(tree, q"$testName.ignore".toString) - case tree @ Term.Apply.After_4_6_0(Term.Select(testName, taggedMethod(_)), Term.ArgClause(List(Lit.String("only")), None)) => + case tree @ Term.Apply.After_4_6_0( + Term.Select(testName, taggedMethod(_)), + Term.ArgClause(List(Lit.String("only")), None)) => Patch.replaceTree(tree, q"$testName.only".toString) - case tree @ Term.Apply.After_4_6_0(Term.Select(testName, taggedMethod(_)), Term.ArgClause(List(Lit.String(other)), None)) => + case tree @ Term.Apply.After_4_6_0( + Term.Select(testName, taggedMethod(_)), + Term.ArgClause(List(Lit.String(other)), None)) => Patch.replaceTree(tree, s"$testName") }.asPatch } diff --git a/scalafix/v0_11_0/input/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala b/scalafix/v0_11_0/input/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala index 6ff5c5b1..4154e94e 100644 --- a/scalafix/v0_11_0/input/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala +++ b/scalafix/v0_11_0/input/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala @@ -9,19 +9,23 @@ import cats.effect.IO object RenameAssertionExceptionToExpectationFailed extends SimpleIOSuite { test("raise") { - IO.raiseError(AssertionException("some reason", NonEmptyList.of(implicitly[SourceLocation]))).as(success) + IO.raiseError(AssertionException( + "some reason", + NonEmptyList.of(implicitly[SourceLocation]))).as(success) } test("match") { val program: IO[Unit] = IO.unit program.attemptTap { case Left(ex: AssertionException) => IO.println(ex) - case _ => IO.unit + case _ => IO.unit }.as(success) } test("import") { import weaver.AssertionException - IO.raiseError(AssertionException("some reason", NonEmptyList.of(implicitly[SourceLocation]))).as(success) + IO.raiseError(AssertionException( + "some reason", + NonEmptyList.of(implicitly[SourceLocation]))).as(success) } } diff --git a/scalafix/v0_11_0/output/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala b/scalafix/v0_11_0/output/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala index 5c7e5d0f..0c2b92b1 100644 --- a/scalafix/v0_11_0/output/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala +++ b/scalafix/v0_11_0/output/src/main/scala/fix/RenameAssertionExceptionToExpectationFailedTest.scala @@ -6,19 +6,23 @@ import cats.effect.IO object RenameAssertionExceptionToExpectationFailed extends SimpleIOSuite { test("raise") { - IO.raiseError(new ExpectationFailed("some reason", NonEmptyList.of(implicitly[SourceLocation]))).as(success) + IO.raiseError(new ExpectationFailed( + "some reason", + NonEmptyList.of(implicitly[SourceLocation]))).as(success) } test("match") { val program: IO[Unit] = IO.unit program.attemptTap { case Left(ex: ExpectationFailed) => IO.println(ex) - case _ => IO.unit + case _ => IO.unit }.as(success) } test("import") { import weaver.ExpectationFailed - IO.raiseError(new ExpectationFailed("some reason", NonEmptyList.of(implicitly[SourceLocation]))).as(success) + IO.raiseError(new ExpectationFailed( + "some reason", + NonEmptyList.of(implicitly[SourceLocation]))).as(success) } } diff --git a/scalafix/v0_9_0/input/src/main/scala/fix/AddClueToExpectTest.scala b/scalafix/v0_9_0/input/src/main/scala/fix/AddClueToExpectTest.scala index 76825a9f..41d172f2 100644 --- a/scalafix/v0_9_0/input/src/main/scala/fix/AddClueToExpectTest.scala +++ b/scalafix/v0_9_0/input/src/main/scala/fix/AddClueToExpectTest.scala @@ -44,7 +44,7 @@ object AddClueToExpectTest extends SimpleIOSuite { expect(!a.isInstanceOf[Int]) } - pureTest("select"){ + pureTest("select") { val either = Left[Int, Int](1) expect(either.toOption.isEmpty) } @@ -79,7 +79,7 @@ object AddClueToExpectTest extends SimpleIOSuite { } pureTest("ignore blocks") { - expect(Some(1).fold(true)({_ => b == c })) + expect(Some(1).fold(true)({ _ => b == c })) } } diff --git a/scalafix/v0_9_0/input/src/main/scala/fix/RewriteExpectTest.scala b/scalafix/v0_9_0/input/src/main/scala/fix/RewriteExpectTest.scala index 12a48682..945f3c8c 100644 --- a/scalafix/v0_9_0/input/src/main/scala/fix/RewriteExpectTest.scala +++ b/scalafix/v0_9_0/input/src/main/scala/fix/RewriteExpectTest.scala @@ -97,7 +97,7 @@ object RewriteExpectTest extends SimpleIOSuite { pureTest("infer order with sealed traits") { sealed trait Pet object Pet { - case object Cat extends Pet + case object Cat extends Pet case class Dog(friend: Pet) extends Pet } val petCat = Pet.Cat @@ -107,10 +107,10 @@ object RewriteExpectTest extends SimpleIOSuite { pureTest("infer order with common names") { val expectedId = 1 - val actualId = 2 + val actualId = 2 val obtainedId = 3 - val result = 4 - expect(result == expectedId && actualId == expectedId && obtainedId == expectedId) + val result = 4 + expect( + result == expectedId && actualId == expectedId && obtainedId == expectedId) } } - diff --git a/scalafix/v0_9_0/output/src/main/scala/fix/AddClueToExpectTest.scala b/scalafix/v0_9_0/output/src/main/scala/fix/AddClueToExpectTest.scala index 3a8fc90d..bca34757 100644 --- a/scalafix/v0_9_0/output/src/main/scala/fix/AddClueToExpectTest.scala +++ b/scalafix/v0_9_0/output/src/main/scala/fix/AddClueToExpectTest.scala @@ -8,7 +8,8 @@ object AddClueToExpectTest extends SimpleIOSuite { val c: Int = 3 pureTest("multiple") { - expect(clue(a) == clue(b)) and expect(clue(b) == clue(c)) && not(expect(clue(c) == clue(a))) + expect(clue(a) == clue(b)) and expect(clue(b) == clue(c)) && not( + expect(clue(c) == clue(a))) } pureTest("infix") { @@ -41,7 +42,7 @@ object AddClueToExpectTest extends SimpleIOSuite { expect(!clue(a).isInstanceOf[Int]) } - pureTest("select"){ + pureTest("select") { val either = Left[Int, Int](1) expect(clue(either.toOption).isEmpty) } @@ -64,7 +65,9 @@ object AddClueToExpectTest extends SimpleIOSuite { pureTest("all") { def isGreater(a: Int, b: Int, c: Int): Boolean = a > b && b > c - expect.all(clue(a) == clue(b), clue(Some(2)).nonEmpty, isGreater(clue(a), clue(b), clue(c))) + expect.all(clue(a) == clue(b), + clue(Some(2)).nonEmpty, + isGreater(clue(a), clue(b), clue(c))) } pureTest("ignore clue in expect.all") { @@ -77,8 +80,8 @@ object AddClueToExpectTest extends SimpleIOSuite { pureTest("ignore blocks") { expect(clue(Some(1)).fold(true) { - _ => b == c -}) + _ => b == c + }) } } diff --git a/scalafix/v0_9_0/output/src/main/scala/fix/RewriteExpectTest.scala b/scalafix/v0_9_0/output/src/main/scala/fix/RewriteExpectTest.scala index 494387e7..7578f002 100644 --- a/scalafix/v0_9_0/output/src/main/scala/fix/RewriteExpectTest.scala +++ b/scalafix/v0_9_0/output/src/main/scala/fix/RewriteExpectTest.scala @@ -13,7 +13,8 @@ object RewriteExpectTest extends SimpleIOSuite { } pureTest("nested ==") { - expect.same(1, 1).and(expect.same(2, 2)) and expect.same(1, 1).and(expect(2 >= 2)) + expect.same(1, 1).and(expect.same(2, 2)) and expect.same(1, 1).and(expect( + 2 >= 2)) } pureTest("===") { @@ -37,27 +38,28 @@ object RewriteExpectTest extends SimpleIOSuite { } pureTest("if then else if") { - if (1 == 2) expect(3 > 4) else if (2 == 3) expect.same(5, 5) else expect(4 > 3) + if (1 == 2) expect(3 > 4) + else if (2 == 3) expect.same(5, 5) else expect(4 > 3) } pureTest("match") { val n: Int = 1 n match { - case 2 => - expect(1 > 2) - case 3 => - success - case 4 => - failure("Assertion failed") -} + case 2 => + expect(1 > 2) + case 3 => + success + case 4 => + failure("Assertion failed") + } } pureTest("match with wildcard false") { val n: Int = 1 matches(n) { - case 2 => - expect(1 > 2) -} + case 2 => + expect(1 > 2) + } } pureTest("expect.all ==") { @@ -77,7 +79,8 @@ object RewriteExpectTest extends SimpleIOSuite { } pureTest("expect.all with || and &&") { - expect(1 > 0).and(expect.same(2, 2)).and(expect(2 > 0).or(expect(3 > 4))).and(expect.same(2, 2)) + expect(1 > 0).and(expect.same(2, 2)).and(expect( + 2 > 0).or(expect(3 > 4))).and(expect.same(2, 2)) } pureTest("expect.all ignore clue") { @@ -97,7 +100,7 @@ object RewriteExpectTest extends SimpleIOSuite { pureTest("infer order with sealed traits") { sealed trait Pet object Pet { - case object Cat extends Pet + case object Cat extends Pet case class Dog(friend: Pet) extends Pet } val petCat = Pet.Cat @@ -107,9 +110,10 @@ object RewriteExpectTest extends SimpleIOSuite { pureTest("infer order with common names") { val expectedId = 1 - val actualId = 2 + val actualId = 2 val obtainedId = 3 - val result = 4 - expect.same(expectedId, result).and(expect.same(expectedId, actualId)).and(expect.same(expectedId, obtainedId)) + val result = 4 + expect.same(expectedId, result).and(expect.same(expectedId, actualId)).and( + expect.same(expectedId, obtainedId)) } } From a78d4767cd4473aafad612f926af7ae902e69fa7 Mon Sep 17 00:00:00 2001 From: "typelevel-steward[bot]" <106827141+typelevel-steward[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:12:21 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.10.2' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 3842600e..232188f8 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -6,3 +6,6 @@ # Scala Steward: Reformat with scalafmt 3.9.10 1d6b2d8f534c6fa2ede2e46c872e09f7704bdbed + +# Scala Steward: Reformat with scalafmt 3.10.2 +484f3dfa40b657e703a9d5a6024e39c60a620375