From 98188cdeb28eced7c49b4a0354f87e02b1365769 Mon Sep 17 00:00:00 2001 From: Kevin Lee Date: Thu, 23 Nov 2023 21:02:46 +1100 Subject: [PATCH] Upgrade sbt and sbt plugins / Clean up * sbt-devoops to 3.0.0 * sbt-docusaur to 0.15.0 * Clean up the code as suggested by sbt-tpolecat --- .scalafix-scala2.conf | 126 ++++++++++-------- .scalafix-scala3.conf | 107 +++++++++------ build.sbt | 50 ++++--- .../scala/loggerf/cats/instancesSpec.scala | 12 +- .../test/scala/loggerf/cats/syntaxSpec.scala | 54 ++++---- .../scala/loggerf/cats/instancesSpec.scala | 16 +-- .../test/scala/loggerf/cats/syntaxSpec.scala | 43 ++---- .../loggerf/instances/extraSyntaxSpec.scala | 54 ++++---- .../scala/loggerf/instances/futureSpec.scala | 24 ++-- .../test/scala/loggerf/instances/idSpec.scala | 24 ++-- .../loggerf/instances/instancesSpec.scala | 24 ++-- .../loggerf/instances/loggingSyntaxSpec.scala | 96 +++++++------ .../scala/loggerf/instances/triesSpec.scala | 24 ++-- .../core/syntax/LogMessageSyntax.scala | 3 + .../loggerf/instances/instancesSpec.scala | 16 +-- .../scala/loggerf/instances/syntaxSpec.scala | 32 ++--- .../scala/loggerf/instances/triesSpec.scala | 12 +- .../logger/logback/Monix3MdcAdapterSpec.scala | 1 + .../scala/loggerf/monix/instancesSpec.scala | 6 +- .../test/scala/loggerf/monix/syntaxSpec.scala | 30 ++--- project/plugins.sbt | 4 +- 21 files changed, 389 insertions(+), 369 deletions(-) diff --git a/.scalafix-scala2.conf b/.scalafix-scala2.conf index 089356e0..c37b3c03 100644 --- a/.scalafix-scala2.conf +++ b/.scalafix-scala2.conf @@ -3,58 +3,78 @@ rules = [ LeakingImplicitClassVal NoValInForComprehension ProcedureSyntax - RedundantSyntax - RemoveUnused - - # xuwei-k/scalafix-rules - AddExplicitImplicitTypes - AddLambdaParamParentheses - CirceCodec - CollectHead - CollectHeadOption - - FlatTraverse - ImplicitValueClass - KindProjector - LambdaParamParentheses - MapDistinctSize - MapSequenceTraverse - NoElse - ObjectSelfType - OptionMapFlatMap - OptionMatchToRight - - SimplifyForYield - ThrowableToNonFatal - UnnecessaryCase - UnnecessaryMatch - UnnecessarySort - - UnusedConstructorParams - UnusedTypeParams - WithFilter ] +DisableSyntax.noVars = true +DisableSyntax.noThrows = true +DisableSyntax.noNulls = true +DisableSyntax.noReturns = true +DisableSyntax.noWhileLoops = true +DisableSyntax.noAsInstanceOf = true +DisableSyntax.noIsInstanceOf = true +DisableSyntax.noXml = true +DisableSyntax.noDefaultArgs = true +DisableSyntax.noFinalVal = true +DisableSyntax.noFinalize = true +DisableSyntax.noValPatterns = true +DisableSyntax.regex = [] -DisableSyntax { - noVars = true - noThrows = true - noNulls = true - noReturns = true - noWhileLoops = true - noAsInstanceOf = true - noIsInstanceOf = true - noXml = true - noDefaultArgs = true - noFinalVal = true - noFinalize = true - noValPatterns = true - regex = [] -} - -RemoveUnused { - imports = true - privates = true - locals = true - patternvars = true - params = true -} +//rules = [ +// DisableSyntax +// LeakingImplicitClassVal +// NoValInForComprehension +// ProcedureSyntax +// RedundantSyntax +// RemoveUnused +// +// # xuwei-k/scalafix-rules +// AddExplicitImplicitTypes +// AddLambdaParamParentheses +// CirceCodec +// CollectHead +// CollectHeadOption +// +// FlatTraverse +// ImplicitValueClass +// KindProjector +// LambdaParamParentheses +// MapDistinctSize +// MapSequenceTraverse +// NoElse +// ObjectSelfType +// OptionMapFlatMap +// OptionMatchToRight +// +// SimplifyForYield +// ThrowableToNonFatal +// UnnecessaryCase +// UnnecessaryMatch +// UnnecessarySort +// +// UnusedConstructorParams +// UnusedTypeParams +// WithFilter +//] +// +//DisableSyntax { +// noVars = true +// noThrows = true +// noNulls = true +// noReturns = true +// noWhileLoops = true +// noAsInstanceOf = true +// noIsInstanceOf = true +// noXml = true +// noDefaultArgs = true +// noFinalVal = true +// noFinalize = true +// noValPatterns = true +// regex = [] +//} +// +//RemoveUnused { +// imports = true +// privates = true +// locals = true +// patternvars = true +// params = true +//} diff --git a/.scalafix-scala3.conf b/.scalafix-scala3.conf index 608608e1..3b9eb310 100644 --- a/.scalafix-scala3.conf +++ b/.scalafix-scala3.conf @@ -2,49 +2,68 @@ rules = [ DisableSyntax LeakingImplicitClassVal NoValInForComprehension - RedundantSyntax - - # xuwei-k/scalafix-rules - AddExplicitImplicitTypes - AddLambdaParamParentheses - CirceCodec - CollectHead - CollectHeadOption - - FlatTraverse - ImplicitValueClass - KindProjector - LambdaParamParentheses - MapDistinctSize - MapSequenceTraverse - NoElse - ObjectSelfType - OptionMapFlatMap - OptionMatchToRight - - SimplifyForYield - ThrowableToNonFatal - UnnecessaryCase - UnnecessaryMatch - UnnecessarySort - - UnusedConstructorParams - UnusedTypeParams - WithFilter ] +DisableSyntax.noVars = true +DisableSyntax.noThrows = true +DisableSyntax.noNulls = true +DisableSyntax.noReturns = true +DisableSyntax.noWhileLoops = true +DisableSyntax.noAsInstanceOf = true +DisableSyntax.noIsInstanceOf = true +DisableSyntax.noXml = true +DisableSyntax.noDefaultArgs = true +DisableSyntax.noFinalVal = true +DisableSyntax.noFinalize = true +DisableSyntax.noValPatterns = true +DisableSyntax.regex = [] -DisableSyntax { - noVars = true - noThrows = true - noNulls = true - noReturns = true - noWhileLoops = true - noAsInstanceOf = true - noIsInstanceOf = true - noXml = true - noDefaultArgs = true - noFinalVal = true - noFinalize = true - noValPatterns = true - regex = [] -} +//rules = [ +// DisableSyntax +// LeakingImplicitClassVal +// NoValInForComprehension +// RedundantSyntax +// +// # xuwei-k/scalafix-rules +// AddExplicitImplicitTypes +// AddLambdaParamParentheses +// CirceCodec +// CollectHead +// CollectHeadOption +// +// FlatTraverse +// ImplicitValueClass +// KindProjector +// LambdaParamParentheses +// MapDistinctSize +// MapSequenceTraverse +// NoElse +// ObjectSelfType +// OptionMapFlatMap +// OptionMatchToRight +// +// SimplifyForYield +// ThrowableToNonFatal +// UnnecessaryCase +// UnnecessaryMatch +// UnnecessarySort +// +// UnusedConstructorParams +// UnusedTypeParams +// WithFilter +//] +// +//DisableSyntax { +// noVars = true +// noThrows = true +// noNulls = true +// noReturns = true +// noWhileLoops = true +// noAsInstanceOf = true +// noIsInstanceOf = true +// noXml = true +// noDefaultArgs = true +// noFinalVal = true +// noFinalize = true +// noValPatterns = true +// regex = [] +//} diff --git a/build.sbt b/build.sbt index 3573e63a..2a68e43e 100644 --- a/build.sbt +++ b/build.sbt @@ -27,29 +27,31 @@ ThisBuild / licenses := props.licenses ThisBuild / resolvers += "sonatype-snapshots" at s"https://${props.SonatypeCredentialHost}/content/repositories/snapshots" -ThisBuild / semanticdbEnabled := true -ThisBuild / semanticdbVersion := scalafixSemanticdb.revision - -ThisBuild / scalafixConfig := ( - if (scalaVersion.value.startsWith("3")) file(".scalafix-scala3.conf").some - else file(".scalafix-scala2.conf").some -) - -ThisBuild / scalafixScalaBinaryVersion := { - val log = sLog.value - val newVersion = if (scalaVersion.value.startsWith("3")) { - (ThisBuild / scalafixScalaBinaryVersion).value - } else { - CrossVersion.binaryScalaVersion(scalaVersion.value) - } - - log.info( - s">> Change ThisBuild / scalafixScalaBinaryVersion from ${(ThisBuild / scalafixScalaBinaryVersion).value} to $newVersion" +//ThisBuild / semanticdbEnabled := true +//ThisBuild / semanticdbVersion := scalafixSemanticdb.revision + +ThisBuild / scalafixConfig := ( + if (scalaVersion.value.startsWith("3")) + ((ThisBuild / baseDirectory).value / ".scalafix-scala3.conf").some + else + ((ThisBuild / baseDirectory).value / ".scalafix-scala2.conf").some ) - newVersion -} -ThisBuild / scalafixDependencies += "com.github.xuwei-k" %% "scalafix-rules" % "0.2.12" +//ThisBuild / scalafixScalaBinaryVersion := { +// val log = sLog.value +// val newVersion = if (scalaVersion.value.startsWith("3")) { +// (ThisBuild / scalafixScalaBinaryVersion).value +// } else { +// CrossVersion.binaryScalaVersion(scalaVersion.value) +// } +// +// log.info( +// s">> Change ThisBuild / scalafixScalaBinaryVersion from ${(ThisBuild / scalafixScalaBinaryVersion).value} to $newVersion" +// ) +// newVersion +//} + +//ThisBuild / scalafixDependencies += "com.github.xuwei-k" %% "scalafix-rules" % "0.2.12" lazy val loggerF = (project in file(".")) .enablePlugins(DevOopsGitHubReleasePlugin) @@ -653,6 +655,12 @@ def projectCommonSettings(projectName: String, crossProject: CrossProject.Builde .settings( name := projectName, licenses := props.licenses, + scalafixConfig := ( + if (scalaVersion.value.startsWith("3")) + ((ThisBuild / baseDirectory).value / ".scalafix-scala3.conf").some + else + ((ThisBuild / baseDirectory).value / ".scalafix-scala2.conf").some + ), /* WartRemover and scalacOptions { */ // , Compile / compile / wartremoverErrors ++= commonWarts((update / scalaBinaryVersion).value) // , Test / compile / wartremoverErrors ++= commonWarts((update / scalaBinaryVersion).value) diff --git a/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/instancesSpec.scala b/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/instancesSpec.scala index b381a921..ba1f7f8a 100644 --- a/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/instancesSpec.scala +++ b/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/instancesSpec.scala @@ -158,7 +158,7 @@ object instancesSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -198,7 +198,7 @@ object instancesSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -290,7 +290,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -332,7 +332,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -366,7 +366,7 @@ object instancesSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -408,7 +408,7 @@ object instancesSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/syntaxSpec.scala b/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/syntaxSpec.scala index 9b003245..87977b8a 100644 --- a/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/syntaxSpec.scala +++ b/modules/logger-f-cats-effect/shared/src/test/scala/loggerf/cats/syntaxSpec.scala @@ -189,7 +189,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -229,7 +229,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -321,7 +321,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -363,7 +363,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -397,7 +397,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -439,7 +439,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -499,8 +499,7 @@ object syntaxSpec extends Properties { } private[syntaxSpec] def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -556,7 +555,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -595,7 +594,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -687,7 +686,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -729,7 +728,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -763,7 +762,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -805,7 +804,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -956,7 +955,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -996,7 +995,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1088,7 +1087,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1130,7 +1129,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1164,7 +1163,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1206,7 +1205,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1266,8 +1265,7 @@ object syntaxSpec extends Properties { } private[syntaxSpec] def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -1323,7 +1321,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1362,7 +1360,7 @@ object syntaxSpec extends Properties { runLog[IO](logMsg).unsafeRunSync() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1454,7 +1452,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1496,7 +1494,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1530,7 +1528,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1572,7 +1570,7 @@ object syntaxSpec extends Properties { runLog[IO](eab).unsafeRunSync() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/instancesSpec.scala b/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/instancesSpec.scala index ca26a444..a853d562 100644 --- a/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/instancesSpec.scala +++ b/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/instancesSpec.scala @@ -2,7 +2,6 @@ package loggerf.cats import cats._ import cats.effect._ -import cats.effect.unsafe.IORuntime import cats.syntax.all._ import effectie.core.FxCtor import effectie.syntax.all._ @@ -10,9 +9,9 @@ import extras.concurrent.testing.ConcurrentSupport import extras.hedgehog.ce3.syntax.runner._ import hedgehog._ import hedgehog.runner._ -import loggerf.syntax.all._ import loggerf.core._ import loggerf.logger.LoggerForTesting +import loggerf.syntax.all._ import java.util.concurrent.ExecutorService @@ -158,11 +157,8 @@ object instancesSpec extends Properties { _ <- Log[F].log(effectOf(oa))(error(ifEmptyMsg), _ => ignore) } yield ().some) - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -252,7 +248,7 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - testing.IoAppUtils.runWithRuntime(testing.IoAppUtils.runtime(es)) { implicit runtime => + testing.IoAppUtils.runWithRuntime(testing.IoAppUtils.runtime(es)) { _ => val expected = eab match { case Right(n) => @@ -263,7 +259,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -299,10 +295,10 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - testing.IoAppUtils.runWithRuntime(testing.IoAppUtils.runtime(es)) { implicit runtime => + testing.IoAppUtils.runWithRuntime(testing.IoAppUtils.runtime(es)) { _ => val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/syntaxSpec.scala b/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/syntaxSpec.scala index 1eb281cb..af03ff6a 100644 --- a/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/syntaxSpec.scala +++ b/modules/logger-f-cats-effect3/shared/src/test/scala/loggerf/cats/syntaxSpec.scala @@ -3,11 +3,9 @@ package loggerf.cats import cats._ import cats.data.{EitherT, OptionT} import cats.effect._ -import cats.effect.unsafe.IORuntime import cats.syntax.all._ import effectie.core.FxCtor import effectie.syntax.all._ -import extras.concurrent.testing.ConcurrentSupport import extras.hedgehog.ce3.syntax.runner._ import hedgehog._ import hedgehog.runner._ @@ -15,8 +13,6 @@ import loggerf.core.Log import loggerf.logger.LoggerForTesting import loggerf.syntax.all._ -import java.util.concurrent.ExecutorService - /** @author Kevin Lee * @since 2020-04-12 */ @@ -99,9 +95,6 @@ object syntaxSpec extends Properties { _ <- log(effectOf(oa))(error(ifEmptyMsg), error) } yield ().some) - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expected = logMsg match { case Some(logMsg) => LoggerForTesting( @@ -142,9 +135,6 @@ object syntaxSpec extends Properties { _ <- log(effectOf(oa))(ignore, error) } yield ().some) - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expected = logMsg match { case Some(logMsg) => LoggerForTesting( @@ -187,7 +177,7 @@ object syntaxSpec extends Properties { } yield ().some) val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -281,7 +271,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -316,7 +306,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -382,8 +372,7 @@ object syntaxSpec extends Properties { def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield withIO { implicit ticker => implicit val logger: LoggerForTesting = LoggerForTesting() @@ -435,11 +424,8 @@ object syntaxSpec extends Properties { _ <- log(OptionT(effectOf(oa)))(error(ifEmptyMsg), _ => ignore) } yield ()).value - val es: ExecutorService = ConcurrentSupport.newExecutorService(2) - implicit val rt: IORuntime = testing.IoAppUtils.runtime(es) - val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -533,7 +519,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -568,7 +554,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -723,7 +709,7 @@ object syntaxSpec extends Properties { } yield ().some) val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -817,7 +803,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -852,7 +838,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -918,8 +904,7 @@ object syntaxSpec extends Properties { def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield withIO { implicit ticker => implicit val logger: LoggerForTesting = LoggerForTesting() @@ -972,7 +957,7 @@ object syntaxSpec extends Properties { } yield ()).value val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1066,7 +1051,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1101,7 +1086,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/extraSyntaxSpec.scala b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/extraSyntaxSpec.scala index 4efee46d..fe5052ec 100644 --- a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/extraSyntaxSpec.scala +++ b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/extraSyntaxSpec.scala @@ -117,7 +117,7 @@ object extraSyntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[Unit] = + def runLog[F[*]: Log: Monad]: F[Unit] = (for { _ <- logS(debugMsg)(debug(prefix(prefixString))) _ <- logS(infoMsg)(info(prefix(prefixString))) @@ -137,7 +137,6 @@ object extraSyntaxSpec extends Properties { ConcurrentSupport.newExecutionContextWithLogger(es, ErrorLogger.printlnExecutionContextErrorLogger) ConcurrentSupport.futureToValueAndTerminate(es, waitFor500Millis) { - import effectie.instances.future.fxCtor._ import loggerf.instances.future.logFuture runLog[Future] } @@ -155,7 +154,7 @@ object extraSyntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[Unit] = + def runLog[F[*]: Log: Monad]: F[Unit] = (for { _ <- logS_(debugMsg)(debug(prefix(prefixString))) _ <- logS_(infoMsg)(info(prefix(prefixString))) @@ -175,7 +174,6 @@ object extraSyntaxSpec extends Properties { ConcurrentSupport.newExecutionContextWithLogger(es, ErrorLogger.printlnExecutionContextErrorLogger) ConcurrentSupport.futureToValueAndTerminate(es, waitFor500Millis) { - import effectie.instances.future.fxCtor._ import loggerf.instances.future.logFuture runLog[Future] } @@ -331,7 +329,7 @@ object extraSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -378,7 +376,7 @@ object extraSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -484,7 +482,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -533,7 +531,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -574,7 +572,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -623,7 +621,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -760,7 +758,7 @@ object extraSyntaxSpec extends Properties { } yield ()).value val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -866,7 +864,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -915,7 +913,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -956,7 +954,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1005,7 +1003,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1049,7 +1047,7 @@ object extraSyntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[Unit] = + def runLog[F[*]: Log: Monad]: F[Unit] = for { _ <- debugMsg.logS(debug(prefix(prefixString))) _ <- infoMsg.logS(info(prefix(prefixString))) @@ -1069,7 +1067,6 @@ object extraSyntaxSpec extends Properties { ConcurrentSupport.newExecutionContextWithLogger(es, ErrorLogger.printlnExecutionContextErrorLogger) ConcurrentSupport.futureToValueAndTerminate(es, waitFor500Millis) { - import effectie.instances.future.fxCtor._ import loggerf.instances.future.logFuture runLog[Future] } @@ -1087,7 +1084,7 @@ object extraSyntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[Unit] = + def runLog[F[*]: Log: Monad]: F[Unit] = for { _ <- debugMsg.logS_(debug(prefix(prefixString))) _ <- infoMsg.logS_(info(prefix(prefixString))) @@ -1107,7 +1104,6 @@ object extraSyntaxSpec extends Properties { ConcurrentSupport.newExecutionContextWithLogger(es, ErrorLogger.printlnExecutionContextErrorLogger) ConcurrentSupport.futureToValueAndTerminate(es, waitFor500Millis) { - import effectie.instances.future.fxCtor._ import loggerf.instances.future.logFuture runLog[Future] } @@ -1263,7 +1259,7 @@ object extraSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1369,7 +1365,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1418,7 +1414,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1459,7 +1455,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1508,7 +1504,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1645,7 +1641,7 @@ object extraSyntaxSpec extends Properties { } yield ()).value val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1751,7 +1747,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1800,7 +1796,7 @@ object extraSyntaxSpec extends Properties { errorMessages = Vector(prefixString + n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1841,7 +1837,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1890,7 +1886,7 @@ object extraSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/futureSpec.scala b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/futureSpec.scala index 160b83c7..a8f3b0b3 100644 --- a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/futureSpec.scala +++ b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/futureSpec.scala @@ -187,7 +187,7 @@ object futureSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -321,7 +321,7 @@ object futureSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -424,7 +424,7 @@ object futureSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -463,7 +463,7 @@ object futureSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -565,7 +565,7 @@ object futureSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -604,7 +604,7 @@ object futureSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -771,7 +771,7 @@ object futureSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -900,7 +900,7 @@ object futureSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1001,7 +1001,7 @@ object futureSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1040,7 +1040,7 @@ object futureSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1144,7 +1144,7 @@ object futureSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1183,7 +1183,7 @@ object futureSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/idSpec.scala b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/idSpec.scala index ad320308..c3237a94 100644 --- a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/idSpec.scala +++ b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/idSpec.scala @@ -180,7 +180,7 @@ object idSpec extends Properties { } yield ().some) val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -299,7 +299,7 @@ object idSpec extends Properties { } yield () val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -391,7 +391,7 @@ object idSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -425,7 +425,7 @@ object idSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -517,7 +517,7 @@ object idSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -551,7 +551,7 @@ object idSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -698,7 +698,7 @@ object idSpec extends Properties { .flatMap { _ => Log[F].log_(Fx[F].effectOf(oa))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -811,7 +811,7 @@ object idSpec extends Properties { .flatMap { _ => log_(OptionT(Fx[F].effectOf(oa)))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -903,7 +903,7 @@ object idSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -937,7 +937,7 @@ object idSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1031,7 +1031,7 @@ object idSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1065,7 +1065,7 @@ object idSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/instancesSpec.scala b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/instancesSpec.scala index ef092923..e6c8c5eb 100644 --- a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/instancesSpec.scala +++ b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/instancesSpec.scala @@ -203,7 +203,7 @@ object instancesSpec extends Properties { } yield ().some) val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -340,7 +340,7 @@ object instancesSpec extends Properties { } yield () val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -444,7 +444,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -484,7 +484,7 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -588,7 +588,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -628,7 +628,7 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -800,7 +800,7 @@ object instancesSpec extends Properties { .flatMap { _ => Log[F].log_(effectOf(oa))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -931,7 +931,7 @@ object instancesSpec extends Properties { .flatMap { _ => log_(OptionT(effectOf(oa)))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1035,7 +1035,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1075,7 +1075,7 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1181,7 +1181,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1221,7 +1221,7 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/loggingSyntaxSpec.scala b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/loggingSyntaxSpec.scala index 5c0bcd41..780554e7 100644 --- a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/loggingSyntaxSpec.scala +++ b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/loggingSyntaxSpec.scala @@ -250,7 +250,7 @@ object loggingSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -296,7 +296,7 @@ object loggingSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -400,7 +400,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -448,7 +448,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -488,7 +488,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -536,7 +536,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -612,8 +612,7 @@ object loggingSyntaxSpec extends Properties { } def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -671,7 +670,7 @@ object loggingSyntaxSpec extends Properties { } yield ()).value val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -775,7 +774,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -823,7 +822,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -863,7 +862,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -911,7 +910,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1086,7 +1085,7 @@ object loggingSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1132,7 +1131,7 @@ object loggingSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1236,7 +1235,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1284,7 +1283,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1324,7 +1323,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1372,7 +1371,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1448,8 +1447,7 @@ object loggingSyntaxSpec extends Properties { } def testLog_OptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -1507,7 +1505,7 @@ object loggingSyntaxSpec extends Properties { } yield ()).value val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1611,7 +1609,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1659,7 +1657,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1699,7 +1697,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1747,7 +1745,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1926,7 +1924,7 @@ object loggingSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2030,7 +2028,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2078,7 +2076,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2118,7 +2116,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2166,7 +2164,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2242,8 +2240,7 @@ object loggingSyntaxSpec extends Properties { } def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -2301,7 +2298,7 @@ object loggingSyntaxSpec extends Properties { } yield ()).value val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2405,7 +2402,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2453,7 +2450,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2493,7 +2490,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2541,7 +2538,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2715,7 +2712,7 @@ object loggingSyntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2819,7 +2816,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2867,7 +2864,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2907,7 +2904,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -2955,7 +2952,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -3031,8 +3028,7 @@ object loggingSyntaxSpec extends Properties { } def testLog_OptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -3090,7 +3086,7 @@ object loggingSyntaxSpec extends Properties { } yield ()).value val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -3194,7 +3190,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -3242,7 +3238,7 @@ object loggingSyntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -3282,7 +3278,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -3330,7 +3326,7 @@ object loggingSyntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/triesSpec.scala b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/triesSpec.scala index 9075f7f7..32449a3d 100644 --- a/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/triesSpec.scala +++ b/modules/logger-f-cats/shared/src/test/scala/loggerf/instances/triesSpec.scala @@ -177,7 +177,7 @@ object triesSpec extends Properties { } yield ().some) val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -293,7 +293,7 @@ object triesSpec extends Properties { } yield () val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -383,7 +383,7 @@ object triesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -416,7 +416,7 @@ object triesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -506,7 +506,7 @@ object triesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -539,7 +539,7 @@ object triesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -682,7 +682,7 @@ object triesSpec extends Properties { .flatMap { _ => Log[F].log_(Fx[F].effectOf(oa))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -792,7 +792,7 @@ object triesSpec extends Properties { .flatMap { _ => log_(OptionT(Fx[F].effectOf(oa)))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -882,7 +882,7 @@ object triesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -915,7 +915,7 @@ object triesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1007,7 +1007,7 @@ object triesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1040,7 +1040,7 @@ object triesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-core/shared/src/main/scala-2/loggerf/core/syntax/LogMessageSyntax.scala b/modules/logger-f-core/shared/src/main/scala-2/loggerf/core/syntax/LogMessageSyntax.scala index 50dedd22..122b0664 100644 --- a/modules/logger-f-core/shared/src/main/scala-2/loggerf/core/syntax/LogMessageSyntax.scala +++ b/modules/logger-f-core/shared/src/main/scala-2/loggerf/core/syntax/LogMessageSyntax.scala @@ -2,6 +2,8 @@ package loggerf.core.syntax import loggerf.core.ToLog +import scala.annotation.nowarn + trait LogMessageSyntax { import loggerf.LogMessage._ @@ -33,6 +35,7 @@ trait LogMessageSyntax { def ignore: LogMessage with Ignorable = Ignore + @nowarn(value = "msg=parameter value a in method ignoreA is never used") def ignoreA[A](a: A): LogMessage with Ignorable = ignore } diff --git a/modules/logger-f-core/shared/src/test/scala/loggerf/instances/instancesSpec.scala b/modules/logger-f-core/shared/src/test/scala/loggerf/instances/instancesSpec.scala index fc0fb431..dbd0fca5 100644 --- a/modules/logger-f-core/shared/src/test/scala/loggerf/instances/instancesSpec.scala +++ b/modules/logger-f-core/shared/src/test/scala/loggerf/instances/instancesSpec.scala @@ -261,7 +261,7 @@ object instancesSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: Fx: Log: Monad]: F[(String, String, String, String)] = + def runLog[F[*]: Log: Monad]: F[(String, String, String, String)] = for { msg1 <- Log[F].logS(debugMsg)(debug) msg2 <- Log[F].logS(infoMsg)(info) @@ -297,7 +297,7 @@ object instancesSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: Fx: Log: Monad]: F[Unit] = + def runLog[F[*]: Log: Monad]: F[Unit] = Log[F] .logS_(debugMsg)(debug) .flatMap { _ => Log[F].logS_(infoMsg)(info) } @@ -427,7 +427,7 @@ object instancesSpec extends Properties { } yield ().some) val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -555,7 +555,7 @@ object instancesSpec extends Properties { .flatMap { _ => Log[F].log_(Fx[F].effectOf(oa))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -655,7 +655,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -693,7 +693,7 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -793,7 +793,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -831,7 +831,7 @@ object instancesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-core/shared/src/test/scala/loggerf/instances/syntaxSpec.scala b/modules/logger-f-core/shared/src/test/scala/loggerf/instances/syntaxSpec.scala index bf558d68..77046eba 100644 --- a/modules/logger-f-core/shared/src/test/scala/loggerf/instances/syntaxSpec.scala +++ b/modules/logger-f-core/shared/src/test/scala/loggerf/instances/syntaxSpec.scala @@ -281,7 +281,7 @@ object syntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[(String, String, String, String)] = + def runLog[F[*]: Log: Monad]: F[(String, String, String, String)] = for { msg1 <- logS(debugMsg)(debug) msg2 <- logS(infoMsg)(info) @@ -318,7 +318,7 @@ object syntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[(Unit, Unit, Unit, Unit)] = + def runLog[F[*]: Log: Monad]: F[(Unit, Unit, Unit, Unit)] = for { r1 <- logS_(debugMsg)(debug) r2 <- logS_(infoMsg)(info) @@ -451,7 +451,7 @@ object syntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -579,7 +579,7 @@ object syntaxSpec extends Properties { .flatMap { _ => log_(FxCtor[F].effectOf(oa))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -681,7 +681,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -720,7 +720,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -820,7 +820,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -858,7 +858,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1108,7 +1108,7 @@ object syntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[(String, String, String, String)] = + def runLog[F[*]: Log: Monad]: F[(String, String, String, String)] = for { msg1 <- debugMsg.logS(debug) msg2 <- infoMsg.logS(info) @@ -1145,7 +1145,7 @@ object syntaxSpec extends Properties { implicit val logger: LoggerForTesting = LoggerForTesting() - def runLog[F[*]: FxCtor: Log: Monad]: F[(Unit, Unit, Unit, Unit)] = + def runLog[F[*]: Log: Monad]: F[(Unit, Unit, Unit, Unit)] = for { r1 <- debugMsg.logS_(debug) r2 <- infoMsg.logS_(info) @@ -1278,7 +1278,7 @@ object syntaxSpec extends Properties { } yield ().some val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1412,7 +1412,7 @@ object syntaxSpec extends Properties { .flatMap { _ => FxCtor[F].effectOf(oa).log_(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1514,7 +1514,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1553,7 +1553,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1657,7 +1657,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1697,7 +1697,7 @@ object syntaxSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-core/shared/src/test/scala/loggerf/instances/triesSpec.scala b/modules/logger-f-core/shared/src/test/scala/loggerf/instances/triesSpec.scala index 39a686a0..1e63c0a8 100644 --- a/modules/logger-f-core/shared/src/test/scala/loggerf/instances/triesSpec.scala +++ b/modules/logger-f-core/shared/src/test/scala/loggerf/instances/triesSpec.scala @@ -164,7 +164,7 @@ object triesSpec extends Properties { } yield ().some) val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -254,7 +254,7 @@ object triesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -287,7 +287,7 @@ object triesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -430,7 +430,7 @@ object triesSpec extends Properties { .flatMap { _ => Log[F].log_(Fx[F].effectOf(oa))(error(ifEmptyMsg), _ => ignore) } val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -520,7 +520,7 @@ object triesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -553,7 +553,7 @@ object triesSpec extends Properties { val eab = if (isRight) rightInt.asRight[String] else leftString.asLeft[Int] val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-logback-mdc-monix3/shared/src/test/scala/loggerf/logger/logback/Monix3MdcAdapterSpec.scala b/modules/logger-f-logback-mdc-monix3/shared/src/test/scala/loggerf/logger/logback/Monix3MdcAdapterSpec.scala index e6228d71..a420484e 100644 --- a/modules/logger-f-logback-mdc-monix3/shared/src/test/scala/loggerf/logger/logback/Monix3MdcAdapterSpec.scala +++ b/modules/logger-f-logback-mdc-monix3/shared/src/test/scala/loggerf/logger/logback/Monix3MdcAdapterSpec.scala @@ -453,6 +453,7 @@ object Monix3MdcAdapterSpec extends Properties { ) } yield Result.all( List( + keySet, keySetAfter, keySetAfter, keySetAfter2, diff --git a/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/instancesSpec.scala b/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/instancesSpec.scala index 23a61fb0..e43a9ff9 100644 --- a/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/instancesSpec.scala +++ b/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/instancesSpec.scala @@ -157,7 +157,7 @@ object instancesSpec extends Properties { runLog[Task](logMsg).runSyncUnsafe() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -249,7 +249,7 @@ object instancesSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -283,7 +283,7 @@ object instancesSpec extends Properties { runLog[Task](eab).runSyncUnsafe() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/syntaxSpec.scala b/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/syntaxSpec.scala index 29290844..8c91e84b 100644 --- a/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/syntaxSpec.scala +++ b/modules/logger-f-monix/shared/src/test/scala/loggerf/monix/syntaxSpec.scala @@ -178,7 +178,7 @@ object syntaxSpec extends Properties { runLog[Task](logMsg).runSyncUnsafe() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -270,7 +270,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -304,7 +304,7 @@ object syntaxSpec extends Properties { runLog[Task](eab).runSyncUnsafe() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -364,8 +364,7 @@ object syntaxSpec extends Properties { } def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -421,7 +420,7 @@ object syntaxSpec extends Properties { runLog[Task](logMsg).runSyncUnsafe() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -513,7 +512,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -547,7 +546,7 @@ object syntaxSpec extends Properties { runLog[Task](eab).runSyncUnsafe() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -698,7 +697,7 @@ object syntaxSpec extends Properties { runLog[Task](logMsg).runSyncUnsafe() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -790,7 +789,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -824,7 +823,7 @@ object syntaxSpec extends Properties { runLog[Task](eab).runSyncUnsafe() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -884,8 +883,7 @@ object syntaxSpec extends Properties { } def testLogOptionTFAIgnoreEmpty: Property = for { - logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") - ifEmptyMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).map("[Empty] " + _).log("ifEmptyMsg") + logMsg <- Gen.string(Gen.unicode, Range.linear(1, 20)).option.log("logMsg") } yield { implicit val logger: LoggerForTesting = LoggerForTesting() @@ -941,7 +939,7 @@ object syntaxSpec extends Properties { runLog[Task](logMsg).runSyncUnsafe() val expected = logMsg match { - case Some(logMsg) => + case Some(logMsg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1033,7 +1031,7 @@ object syntaxSpec extends Properties { errorMessages = Vector(n.toString), ) - case Left(msg) => + case Left(msg @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, @@ -1067,7 +1065,7 @@ object syntaxSpec extends Properties { runLog[Task](eab).runSyncUnsafe() val expected = eab match { - case Right(n) => + case Right(n @ _) => LoggerForTesting( debugMessages = Vector.empty, infoMessages = Vector.empty, diff --git a/project/plugins.sbt b/project/plugins.sbt index 3d894ac7..9da7e607 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,12 +10,12 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.2") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2") -addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.13.0") +addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.15.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") -val sbtDevOopsVersion = "2.24.0" +val sbtDevOopsVersion = "3.0.0" addSbtPlugin("io.kevinlee" % "sbt-devoops-scala" % sbtDevOopsVersion) addSbtPlugin("io.kevinlee" % "sbt-devoops-sbt-extra" % sbtDevOopsVersion) addSbtPlugin("io.kevinlee" % "sbt-devoops-github" % sbtDevOopsVersion)