diff --git a/build.sbt b/build.sbt index 1a16477d..2f2d9976 100644 --- a/build.sbt +++ b/build.sbt @@ -16,12 +16,8 @@ promptTheme := PromptTheme(List( text(_ => "redis4cats", fg(15)).padRight(" λ ") )) -def cond[A](condition: Boolean, t: => Seq[A], f: => Seq[A]): Seq[A] = - if (condition) { - t - } else { - f - } +def pred[A](p: Boolean, t: => Seq[A], f: => Seq[A]): Seq[A] = + if (p) t else f def version(strVersion: String): Option[(Long, Long)] = CrossVersion.partialVersion(strVersion) @@ -36,7 +32,7 @@ val commonSettings = Seq( compilerPlugin(Libraries.betterMonadicFor), Libraries.redisClient, Libraries.scalaCheck % Test - ) ++ cond( + ) ++ pred( version(scalaVersion.value) == Some(2, 12), t = Seq( Libraries212.catsEffect, @@ -51,7 +47,7 @@ val commonSettings = Seq( Libraries213.catsTestKit % Test, )), resolvers += "Apache public" at "https://repository.apache.org/content/groups/public/", - scalacOptions ++= cond( + scalacOptions ++= pred( version(scalaVersion.value) == Some(2, 12), t = Seq("-Xmax-classfile-name", "80"), f = Seq.empty @@ -96,7 +92,7 @@ lazy val `redis4cats-core` = project.in(file("modules/core")) lazy val `redis4cats-log4cats` = project.in(file("modules/log4cats")) .settings(commonSettings: _*) .settings(libraryDependencies ++= - cond( + pred( version(scalaVersion.value) == Some(2, 12), t = Seq(Libraries212.log4CatsCore), f = Seq(Libraries213.log4CatsCore) @@ -115,7 +111,7 @@ lazy val `redis4cats-effects` = project.in(file("modules/effects")) lazy val `redis4cats-streams` = project.in(file("modules/streams")) .settings(commonSettings: _*) .settings(libraryDependencies ++= - cond( + pred( version(scalaVersion.value) == Some(2, 12), t = Seq(Libraries212.fs2Core), f = Seq(Libraries213.fs2Core) @@ -129,7 +125,7 @@ lazy val examples = project.in(file("modules/examples")) .settings(commonSettings: _*) .settings(noPublish) .settings(libraryDependencies ++= - cond( + pred( version(scalaVersion.value) == Some(2, 12), t = Seq(Libraries212.log4CatsSlf4j), f = Seq(Libraries213.log4CatsSlf4j) @@ -145,7 +141,7 @@ lazy val `redis4cats-test-support` = project.in(file("modules/test-support")) .settings(commonSettings: _*) .settings( libraryDependencies ++= - cond( + pred( version(scalaVersion.value) == Some(2, 12), t = Seq(Libraries212.scalaTest), f = Seq(Libraries213.scalaTest) diff --git a/modules/core/src/test/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala b/modules/core/src/test/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala index 98dc4f49..0b7cd442 100644 --- a/modules/core/src/test/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala +++ b/modules/core/src/test/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala @@ -18,6 +18,4 @@ package dev.profunktor.redis4cats.testutils import org.scalatest.AsyncFunSuite -class Redis4CatsAsyncFunSuite extends AsyncFunSuite { - -} +class Redis4CatsAsyncFunSuite extends AsyncFunSuite {} diff --git a/modules/core/src/test/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala b/modules/core/src/test/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala index 1341a930..a87883ea 100644 --- a/modules/core/src/test/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala +++ b/modules/core/src/test/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala @@ -18,7 +18,4 @@ package dev.profunktor.redis4cats.testutils import org.scalatest.funsuite.AsyncFunSuite -class Redis4CatsAsyncFunSuite extends AsyncFunSuite { - -} - +class Redis4CatsAsyncFunSuite extends AsyncFunSuite {} diff --git a/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala b/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala index 98dc4f49..0b7cd442 100644 --- a/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala +++ b/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala @@ -18,6 +18,4 @@ package dev.profunktor.redis4cats.testutils import org.scalatest.AsyncFunSuite -class Redis4CatsAsyncFunSuite extends AsyncFunSuite { - -} +class Redis4CatsAsyncFunSuite extends AsyncFunSuite {} diff --git a/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala b/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala index b6c6eb10..2659977a 100644 --- a/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala +++ b/modules/test-support/src/main/scala-2.12/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala @@ -18,6 +18,4 @@ package dev.profunktor.redis4cats.testutils import org.scalatest.FunSuite -class Redis4CatsFunSuite extends FunSuite { - -} +class Redis4CatsFunSuite extends FunSuite {} diff --git a/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala b/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala index 1341a930..a87883ea 100644 --- a/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala +++ b/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsAsyncFunSuite.scala @@ -18,7 +18,4 @@ package dev.profunktor.redis4cats.testutils import org.scalatest.funsuite.AsyncFunSuite -class Redis4CatsAsyncFunSuite extends AsyncFunSuite { - -} - +class Redis4CatsAsyncFunSuite extends AsyncFunSuite {} diff --git a/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala b/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala index 894d0174..8f9313c7 100644 --- a/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala +++ b/modules/test-support/src/main/scala-2.13/dev/profunktor/redis4cats/testutils/Redis4CatsFunSuite.scala @@ -18,6 +18,4 @@ package dev.profunktor.redis4cats.testutils import org.scalatest.funsuite.AnyFunSuite -class Redis4CatsFunSuite extends AnyFunSuite { - -} +class Redis4CatsFunSuite extends AnyFunSuite {} diff --git a/modules/test-support/src/main/scala/dev/profunktor/redis4cats/DockerRedis.scala b/modules/test-support/src/main/scala/dev/profunktor/redis4cats/DockerRedis.scala index bc333bca..a6a022f0 100644 --- a/modules/test-support/src/main/scala/dev/profunktor/redis4cats/DockerRedis.scala +++ b/modules/test-support/src/main/scala/dev/profunktor/redis4cats/DockerRedis.scala @@ -17,7 +17,6 @@ package dev.profunktor.redis4cats import cats.effect._ -import cats.syntax.apply._ import cats.syntax.functor._ import dev.profunktor.redis4cats.algebra._ import dev.profunktor.redis4cats.connection.{ RedisClient, RedisURI } @@ -82,9 +81,7 @@ trait DockerRedis extends BeforeAndAfterAll with BeforeAndAfterEach { self: Suit withAbstractRedis[A, String, String](f)(stringCodec) private def flushAll(): Unit = - withRedis { - _.flushAll *> IO(println(">>>>>> FLUSHALL done <<<<<<<")) - } + withRedis(_.flushAll) } object DockerRedis { diff --git a/modules/test-support/src/main/scala/dev/profunktor/redis4cats/RedisClusterTest.scala b/modules/test-support/src/main/scala/dev/profunktor/redis4cats/RedisClusterTest.scala index a3717cc1..877ef0fb 100644 --- a/modules/test-support/src/main/scala/dev/profunktor/redis4cats/RedisClusterTest.scala +++ b/modules/test-support/src/main/scala/dev/profunktor/redis4cats/RedisClusterTest.scala @@ -88,7 +88,5 @@ trait RedisClusterTest extends BeforeAndAfterAll with BeforeAndAfterEach { self: withAbstractRedisCluster[A, String, String](f)(stringCodec) private def flushAll(): Unit = - withRedisCluster { - _.flushAll *> IO(println(">>>>>> CLUSTER FLUSHALL done <<<<<<<")) - } + withRedisCluster(_.flushAll) } diff --git a/version.sbt b/version.sbt index 3f0ac089..8e8a39d9 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "0.8.2" +version in ThisBuild := "0.8.3"