Skip to content

Commit

Permalink
Upgrade sbt and sbt plugins / Clean up
Browse files Browse the repository at this point in the history
* sbt-devoops to 3.0.0
* sbt-docusaur to 0.15.0
* Clean up the code as suggested by sbt-tpolecat
  • Loading branch information
kevin-lee committed Nov 23, 2023
1 parent baf02cf commit bffda21
Show file tree
Hide file tree
Showing 19 changed files with 214 additions and 244 deletions.
3 changes: 0 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -500,7 +500,6 @@ 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")
} yield {

implicit val logger: LoggerForTesting = LoggerForTesting()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1267,7 +1266,6 @@ 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")
} yield {

implicit val logger: LoggerForTesting = LoggerForTesting()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ 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._
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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) =>
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading

0 comments on commit bffda21

Please sign in to comment.