From a81cfbb3b89f6917dc4a7c01cbe1a9326bbd437e Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 8 Oct 2024 15:06:11 +0000 Subject: [PATCH 1/3] Update sbt-wartremover, wartremover to 3.2.2 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 927e2a5..4195360 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.2.0") +addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.2.2") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.1") addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.2.1") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.7.0") From a975842ec1911d3c3eb295c852491160a37c351b Mon Sep 17 00:00:00 2001 From: Jonas Chapuis Date: Thu, 10 Oct 2024 16:34:55 +0200 Subject: [PATCH 2/3] Add wartremover warning suppression for false positive in Availabilities.scala --- .../src/main/scala/endless/example/app/impl/Availabilities.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/example/src/main/scala/endless/example/app/impl/Availabilities.scala b/example/src/main/scala/endless/example/app/impl/Availabilities.scala index 49df7eb..646b960 100644 --- a/example/src/main/scala/endless/example/app/impl/Availabilities.scala +++ b/example/src/main/scala/endless/example/app/impl/Availabilities.scala @@ -12,6 +12,7 @@ import java.time.Instant import scala.concurrent.duration.* trait Availabilities { + @SuppressWarnings(Array("org.wartremover.warts.ToString")) implicit def alwaysAvailable[F[_]: Logger: Monad: Async]: AvailabilityAlg[F] = (time: Instant, passengerCount: Int) => Logger[F].info( From 0a9fc9946a46da92471a6457edf44a9f7c305493 Mon Sep 17 00:00:00 2001 From: Jonas Chapuis Date: Thu, 10 Oct 2024 16:59:36 +0200 Subject: [PATCH 3/3] Simplify log entry in example --- .../endless/example/logic/BookingEntityBehavior.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/example/src/main/scala/endless/example/logic/BookingEntityBehavior.scala b/example/src/main/scala/endless/example/logic/BookingEntityBehavior.scala index 7ef06f5..d9cc8e3 100644 --- a/example/src/main/scala/endless/example/logic/BookingEntityBehavior.scala +++ b/example/src/main/scala/endless/example/logic/BookingEntityBehavior.scala @@ -59,10 +59,9 @@ final case class BookingEntityBehavior[F[_]: Logger: Clock]( booking.status match { case Status.Accepted | Status.Pending => EitherT.liftF( - (Clock[F].realTimeInstant >>= (timestamp => - Logger[F] - .info(show"Cancelling booking with ID ${booking.id} at ${timestamp.toString}") - )) >> entity.write(BookingCancelled) + Logger[F].info(show"Cancelling booking with ID ${booking.id}") >> entity.write( + BookingCancelled + ) ) case Status.Cancelled => EitherT.pure(()) case Status.Rejected => EitherT.leftT[F, Unit](BookingAlg.BookingWasRejected(booking.id))