From 8fa81c42c862681c9562dc3952e3db6408e0b361 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 31 Mar 2024 04:02:43 +0000 Subject: [PATCH 1/4] Scala-Steward: Update scalafmt-core from 3.8.0 to 3.8.1 --- .scalafmt.conf | 2 +- examples/akka-cluster-app/.scalafmt.conf | 2 +- examples/akka-persistence-app/.scalafmt.conf | 2 +- examples/event-migration/.scalafmt.conf | 2 +- project/.scalafmt.conf | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index ff1900e4..70782a49 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.0 +version = 3.8.1 style = defaultWithAlign diff --git a/examples/akka-cluster-app/.scalafmt.conf b/examples/akka-cluster-app/.scalafmt.conf index 564f994a..0a5ec280 100644 --- a/examples/akka-cluster-app/.scalafmt.conf +++ b/examples/akka-cluster-app/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.0 +version = 3.8.1 style = defaultWithAlign diff --git a/examples/akka-persistence-app/.scalafmt.conf b/examples/akka-persistence-app/.scalafmt.conf index 564f994a..0a5ec280 100644 --- a/examples/akka-persistence-app/.scalafmt.conf +++ b/examples/akka-persistence-app/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.0 +version = 3.8.1 style = defaultWithAlign diff --git a/examples/event-migration/.scalafmt.conf b/examples/event-migration/.scalafmt.conf index 564f994a..0a5ec280 100644 --- a/examples/event-migration/.scalafmt.conf +++ b/examples/event-migration/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.0 +version = 3.8.1 style = defaultWithAlign diff --git a/project/.scalafmt.conf b/project/.scalafmt.conf index ff1900e4..70782a49 100644 --- a/project/.scalafmt.conf +++ b/project/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.0 +version = 3.8.1 style = defaultWithAlign From 3c28a3cb993c2eb15115644c75f54e7a0f764e89 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 31 Mar 2024 04:02:59 +0000 Subject: [PATCH 2/4] Reformat with scalafmt 3.8.1 Executed command: scalafmt --non-interactive --- .../org/virtuslab/example/ExampleSerializer.scala | 3 +-- .../scala/org/virtuslab/example/StatsService.scala | 5 +---- .../org/virtuslab/example/ExampleSerializer.scala | 3 +-- .../scala/org/virtuslab/example/ShoppingCart.scala | 4 ++-- .../example/repository/ScalikeJdbcSetup.scala | 13 ++++--------- .../org.virtuslab/example/ShoppingCartSpec.scala | 12 +++--------- 6 files changed, 12 insertions(+), 28 deletions(-) diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala index fb32e11a..6b27e3a8 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala +++ b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala @@ -8,8 +8,7 @@ import org.virtuslab.ash.circe.Register import org.virtuslab.ash.circe.Registration @Serializer(classOf[CirceAkkaSerializable], Register.REGISTRATION_REGEX) -class ExampleSerializer(actorSystem: ExtendedActorSystem) - extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { +class ExampleSerializer(actorSystem: ExtendedActorSystem) extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { override def identifier: Int = 2137 override lazy val codecs: Seq[Registration[_ <: CirceAkkaSerializable]] = Seq( diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala index bf5fd8f9..6cd34f4e 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala +++ b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala @@ -68,10 +68,7 @@ object StatsAggregator { waiting(replyTo, words.size, Nil) } - private def waiting( - replyTo: ActorRef[StatsService.Response], - expectedResponses: Int, - results: List[Int]): Behavior[Event] = + private def waiting(replyTo: ActorRef[StatsService.Response], expectedResponses: Int, results: List[Int]): Behavior[Event] = Behaviors.receiveMessage { case CalculationComplete(length) => val newResults = results :+ length diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala index ec5226a1..e16ede05 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala +++ b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala @@ -8,8 +8,7 @@ import org.virtuslab.ash.circe.Register import org.virtuslab.ash.circe.Registration @Serializer(classOf[CirceAkkaSerializable], Register.REGISTRATION_REGEX) -class ExampleSerializer(actorSystem: ExtendedActorSystem) - extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { +class ExampleSerializer(actorSystem: ExtendedActorSystem) extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { override def identifier: Int = 7312 override lazy val codecs: Seq[Registration[_ <: CirceAkkaSerializable]] = Seq( diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala index f1da7daf..5bc3fe00 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala +++ b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala @@ -51,8 +51,8 @@ object ShoppingCart { /** * A command to add an item to the cart. * - * It replies with `StatusReply[Summary]`, which is sent back to the caller when all the events emitted by this - * command are successfully persisted. + * It replies with `StatusReply[Summary]`, which is sent back to the caller when all the events emitted by this command are + * successfully persisted. */ final case class AddItem(itemId: String, quantity: Int, replyTo: ActorRef[StatusReply[Summary]]) extends Command diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala index 4861fcad..4ad6b8b6 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala +++ b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala @@ -15,8 +15,7 @@ import scalikejdbc.config.TypesafeConfigReader object ScalikeJdbcSetup { /** - * Initiate the ScalikeJDBC connection pool configuration and shutdown. The DataSource is setup with ActorSystem's - * config. + * Initiate the ScalikeJDBC connection pool configuration and shutdown. The DataSource is setup with ActorSystem's config. * * The connection pool will be closed when the actor system terminates. */ @@ -29,8 +28,8 @@ object ScalikeJdbcSetup { } /** - * Builds a Hikari DataSource with values from jdbc-connection-settings. The DataSource is then configured as the - * 'default' connection pool for ScalikeJDBC. + * Builds a Hikari DataSource with values from jdbc-connection-settings. The DataSource is then configured as the 'default' + * connection pool for ScalikeJDBC. */ private def initFromConfig(config: Config): Unit = { @@ -62,11 +61,7 @@ object ScalikeJdbcSetup { /** * This is only needed to allow ScalikeJdbc to load its logging configurations from the passed Config */ - private class DBsFromConfig(val config: Config) - extends DBs - with TypesafeConfigReader - with TypesafeConfig - with NoEnvPrefix + private class DBsFromConfig(val config: Config) extends DBs with TypesafeConfigReader with TypesafeConfig with NoEnvPrefix /** * ScalikeJdbc needs a closer for the DataSource to delegate the closing call. diff --git a/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala b/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala index 7a3eefc9..7fec26ba 100644 --- a/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala +++ b/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala @@ -23,16 +23,11 @@ object ShoppingCartSpec { .withFallback(EventSourcedBehaviorTestKit.config) } -class ShoppingCartSpec - extends ScalaTestWithActorTestKit(ShoppingCartSpec.config) - with AnyWordSpecLike - with BeforeAndAfterEach { +class ShoppingCartSpec extends ScalaTestWithActorTestKit(ShoppingCartSpec.config) with AnyWordSpecLike with BeforeAndAfterEach { private val cartId = "testCart" private val eventSourcedTestKit = - EventSourcedBehaviorTestKit[ShoppingCart.Command, ShoppingCart.Event, ShoppingCart.State]( - system, - ShoppingCart(cartId)) + EventSourcedBehaviorTestKit[ShoppingCart.Command, ShoppingCart.Event, ShoppingCart.State](system, ShoppingCart(cartId)) override protected def beforeEach(): Unit = { super.beforeEach() @@ -43,8 +38,7 @@ class ShoppingCartSpec "add item" in { val result1 = - eventSourcedTestKit.runCommand[StatusReply[ShoppingCart.Summary]](replyTo => - ShoppingCart.AddItem("foo", 42, replyTo)) + eventSourcedTestKit.runCommand[StatusReply[ShoppingCart.Summary]](replyTo => ShoppingCart.AddItem("foo", 42, replyTo)) result1.reply should ===(StatusReply.Success(ShoppingCart.Summary(Map("foo" -> 42)))) result1.event should ===(ShoppingCart.ItemAdded(cartId, "foo", 42)) } From edb3b2f902e01eaad3a9092518dd6544b146da35 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 31 Mar 2024 04:02:59 +0000 Subject: [PATCH 3/4] Add 'Reformat with scalafmt 3.8.1' 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 0d3160c3..12d40736 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -15,3 +15,6 @@ # Scala Steward: Reformat with scalafmt 3.8.0 2033f263ea3043d73c8a37e690686034aea62170 + +# Scala Steward: Reformat with scalafmt 3.8.1 +3c28a3cb993c2eb15115644c75f54e7a0f764e89 From 8ae556cba2af7a6e65512009356431f4578b6c3a Mon Sep 17 00:00:00 2001 From: Pawel Lipski Date: Tue, 2 Apr 2024 19:59:53 +0200 Subject: [PATCH 4/4] Revert scalafmt changes --- .scala-steward.conf | 2 ++ .../org/virtuslab/example/ExampleSerializer.scala | 3 ++- .../scala/org/virtuslab/example/StatsService.scala | 5 ++++- .../org/virtuslab/example/ExampleSerializer.scala | 3 ++- .../scala/org/virtuslab/example/ShoppingCart.scala | 4 ++-- .../example/repository/ScalikeJdbcSetup.scala | 13 +++++++++---- .../org.virtuslab/example/ShoppingCartSpec.scala | 12 +++++++++--- 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.scala-steward.conf b/.scala-steward.conf index ea2f2a56..3e6bcfbc 100644 --- a/.scala-steward.conf +++ b/.scala-steward.conf @@ -11,6 +11,8 @@ buildRoots = [ "sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple", ] +scalafmt.runAfterUpgrading = false + pullRequests { frequency = "7 days" grouping = [ diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala index 6b27e3a8..fb32e11a 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala +++ b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala @@ -8,7 +8,8 @@ import org.virtuslab.ash.circe.Register import org.virtuslab.ash.circe.Registration @Serializer(classOf[CirceAkkaSerializable], Register.REGISTRATION_REGEX) -class ExampleSerializer(actorSystem: ExtendedActorSystem) extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { +class ExampleSerializer(actorSystem: ExtendedActorSystem) + extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { override def identifier: Int = 2137 override lazy val codecs: Seq[Registration[_ <: CirceAkkaSerializable]] = Seq( diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala index 6cd34f4e..bf5fd8f9 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala +++ b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala @@ -68,7 +68,10 @@ object StatsAggregator { waiting(replyTo, words.size, Nil) } - private def waiting(replyTo: ActorRef[StatsService.Response], expectedResponses: Int, results: List[Int]): Behavior[Event] = + private def waiting( + replyTo: ActorRef[StatsService.Response], + expectedResponses: Int, + results: List[Int]): Behavior[Event] = Behaviors.receiveMessage { case CalculationComplete(length) => val newResults = results :+ length diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala index e16ede05..ec5226a1 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala +++ b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala @@ -8,7 +8,8 @@ import org.virtuslab.ash.circe.Register import org.virtuslab.ash.circe.Registration @Serializer(classOf[CirceAkkaSerializable], Register.REGISTRATION_REGEX) -class ExampleSerializer(actorSystem: ExtendedActorSystem) extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { +class ExampleSerializer(actorSystem: ExtendedActorSystem) + extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { override def identifier: Int = 7312 override lazy val codecs: Seq[Registration[_ <: CirceAkkaSerializable]] = Seq( diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala index 5bc3fe00..f1da7daf 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala +++ b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala @@ -51,8 +51,8 @@ object ShoppingCart { /** * A command to add an item to the cart. * - * It replies with `StatusReply[Summary]`, which is sent back to the caller when all the events emitted by this command are - * successfully persisted. + * It replies with `StatusReply[Summary]`, which is sent back to the caller when all the events emitted by this + * command are successfully persisted. */ final case class AddItem(itemId: String, quantity: Int, replyTo: ActorRef[StatusReply[Summary]]) extends Command diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala index 4ad6b8b6..4861fcad 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala +++ b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala @@ -15,7 +15,8 @@ import scalikejdbc.config.TypesafeConfigReader object ScalikeJdbcSetup { /** - * Initiate the ScalikeJDBC connection pool configuration and shutdown. The DataSource is setup with ActorSystem's config. + * Initiate the ScalikeJDBC connection pool configuration and shutdown. The DataSource is setup with ActorSystem's + * config. * * The connection pool will be closed when the actor system terminates. */ @@ -28,8 +29,8 @@ object ScalikeJdbcSetup { } /** - * Builds a Hikari DataSource with values from jdbc-connection-settings. The DataSource is then configured as the 'default' - * connection pool for ScalikeJDBC. + * Builds a Hikari DataSource with values from jdbc-connection-settings. The DataSource is then configured as the + * 'default' connection pool for ScalikeJDBC. */ private def initFromConfig(config: Config): Unit = { @@ -61,7 +62,11 @@ object ScalikeJdbcSetup { /** * This is only needed to allow ScalikeJdbc to load its logging configurations from the passed Config */ - private class DBsFromConfig(val config: Config) extends DBs with TypesafeConfigReader with TypesafeConfig with NoEnvPrefix + private class DBsFromConfig(val config: Config) + extends DBs + with TypesafeConfigReader + with TypesafeConfig + with NoEnvPrefix /** * ScalikeJdbc needs a closer for the DataSource to delegate the closing call. diff --git a/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala b/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala index 7fec26ba..7a3eefc9 100644 --- a/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala +++ b/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala @@ -23,11 +23,16 @@ object ShoppingCartSpec { .withFallback(EventSourcedBehaviorTestKit.config) } -class ShoppingCartSpec extends ScalaTestWithActorTestKit(ShoppingCartSpec.config) with AnyWordSpecLike with BeforeAndAfterEach { +class ShoppingCartSpec + extends ScalaTestWithActorTestKit(ShoppingCartSpec.config) + with AnyWordSpecLike + with BeforeAndAfterEach { private val cartId = "testCart" private val eventSourcedTestKit = - EventSourcedBehaviorTestKit[ShoppingCart.Command, ShoppingCart.Event, ShoppingCart.State](system, ShoppingCart(cartId)) + EventSourcedBehaviorTestKit[ShoppingCart.Command, ShoppingCart.Event, ShoppingCart.State]( + system, + ShoppingCart(cartId)) override protected def beforeEach(): Unit = { super.beforeEach() @@ -38,7 +43,8 @@ class ShoppingCartSpec extends ScalaTestWithActorTestKit(ShoppingCartSpec.config "add item" in { val result1 = - eventSourcedTestKit.runCommand[StatusReply[ShoppingCart.Summary]](replyTo => ShoppingCart.AddItem("foo", 42, replyTo)) + eventSourcedTestKit.runCommand[StatusReply[ShoppingCart.Summary]](replyTo => + ShoppingCart.AddItem("foo", 42, replyTo)) result1.reply should ===(StatusReply.Success(ShoppingCart.Summary(Map("foo" -> 42)))) result1.event should ===(ShoppingCart.ItemAdded(cartId, "foo", 42)) }