From e4292536830d9e3338ab874078a09481bc976952 Mon Sep 17 00:00:00 2001 From: niladic Date: Wed, 2 Oct 2024 16:50:14 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20vers=20Scala=203.3.4=20(?= =?UTF-8?q?#2091)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helper/Pseudonymizer.scala | 1 - app/models/Mandat.scala | 1 - app/models/dataModels.scala | 3 +-- build.sbt | 24 ++++++++++++++++-------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/helper/Pseudonymizer.scala b/app/helper/Pseudonymizer.scala index f7041492b..da1e9a155 100644 --- a/app/helper/Pseudonymizer.scala +++ b/app/helper/Pseudonymizer.scala @@ -2,7 +2,6 @@ package helper import cats.syntax.all._ import com.github.tototoshi.csv.CSVReader -import helper.StringHelper import java.util.UUID import scala.util.Random diff --git a/app/models/Mandat.scala b/app/models/Mandat.scala index a77774a99..27e9b6ca9 100644 --- a/app/models/Mandat.scala +++ b/app/models/Mandat.scala @@ -3,7 +3,6 @@ package models import cats.syntax.all._ import java.time.ZonedDateTime import java.util.UUID -import models.Sms object Mandat { case class Id(underlying: UUID) diff --git a/app/models/dataModels.scala b/app/models/dataModels.scala index dbc0ce17c..c9d3ac656 100644 --- a/app/models/dataModels.scala +++ b/app/models/dataModels.scala @@ -7,7 +7,6 @@ import helper.{PlayFormHelpers, Time} import helper.MiscHelpers.toTuple import java.time.{Instant, ZonedDateTime} import java.util.UUID -import models.Answer import models.Application.{MandatType, SeenByUser} import play.api.libs.functional.syntax._ import play.api.libs.json._ @@ -207,7 +206,7 @@ object dataModels { } object SmsFormats { - import models.Sms + implicit val smsIdReads: Reads[Sms.ApiId] = implicitly[Reads[String]].map(Sms.ApiId.apply) implicit val smsIdWrites: Writes[Sms.ApiId] = diff --git a/build.sbt b/build.sbt index 98287aa9e..2c684880f 100644 --- a/build.sbt +++ b/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")) inThisBuild( List( - scalaVersion := "3.3.3", + scalaVersion := "3.3.4", // The following setting are for scalafix semanticdbEnabled := true, // enable SemanticDB semanticdbVersion := scalafixSemanticdb.revision // use Scalafix compatible version @@ -34,16 +34,24 @@ scalacOptions ++= Seq( "-feature", // "-deprecation", // Added by Play // "-unchecked", // Added by Play + // Note: To show all possible warns use "-W", for Wconf filters, use "-Wconf:help" + // Silence a warning from anorm https://github.com/playframework/anorm/issues/568 + "-Wconf:src=src/.*/anorm/macros/RowParserImpl.scala:s", + "-Wconf:src=app/services/.*.scala&msg=would fail on pattern case.*anorm:s", + // Silence warns generated by Play codes generators + // https://github.com/playframework/playframework/issues/6302 + // - first one is due to -Wnonunit-statement with routes generator + "-Wconf:src=routes/.*&msg=unused value:s", + // - second one is due to -Wunused:imports with twirl + "-Wconf:src=twirl/.*&msg=unused import:s", + // Silence specs2 warnings from -Wnonunit-statement + "-Wconf:src=aplus/test/.*&msg=unused value:s", // Sets warnings as errors on the CI if (insideCI.value) "-Wconf:any:error" else "-Wconf:any:warning", // Recommended for cats-effect // https://typelevel.org/cats-effect/docs/getting-started - // "-Wnonunit-statement", // TODO: the route warnings needs to be silenced - // Note: To show all possible warns, use "-W" - // TODO: 3.3.4 should have the src filter - // https://github.com/scala/scala3/pull/21087/files - // https://github.com/playframework/playframework/issues/6302 - // "-Wunused:imports", // gives non useful warns due to twirl + "-Wnonunit-statement", + "-Wunused:imports", "-Wunused:privates", "-Wunused:locals", // "-Wunused:explicits", // TODO: lot of warnings, enable later @@ -51,7 +59,7 @@ scalacOptions ++= Seq( "-Wvalue-discard", ) -val anormVersion = "2.7.0" +val anormVersion = "2.7.0" // TODO: on update, remove the warnings silencers lazy val anormDependency = "org.playframework.anorm" %% "anorm" % anormVersion