Repository: http4s/http4s
Pull request #4392 (2021-02-10 03:16:19)

Several modules on Dotty and Cats-Effect 3
* main
* laws
* testing
* specs2
* ember-core
* blaze-core
* scalatags
* scala-xml
* jawn

Not all warning free, but it's progress!


Patch:
diff --git a/blaze-core/src/main/scala/org/http4s/blazecore/util/CachingChunkWriter.scala b/blaze-core/src/main/scala/org/http4s/blazecore/util/CachingChunkWriter.scala
index 781ecb47b4..eb3fab7b97 100644
--- a/blaze-core/src/main/scala/org/http4s/blazecore/util/CachingChunkWriter.scala
+++ b/blaze-core/src/main/scala/org/http4s/blazecore/util/CachingChunkWriter.scala
@@ -34,10 +34,10 @@ private[http4s] class CachingChunkWriter[F[_]](
     pipe: TailStage[ByteBuffer],
     trailer: F[Headers],
     bufferMaxSize: Int,
-    omitEmptyContentLength: Boolean)(
-    implicit protected val F: Async[F],
+    omitEmptyContentLength: Boolean)(implicit
+    protected val F: Async[F],
     protected val ec: ExecutionContext,
-    implicit protected val dispatcher: Dispatcher[F])
+    protected val dispatcher: Dispatcher[F])
     extends Http1Writer[F] {
   import ChunkWriter._
 
diff --git a/build.sbt b/build.sbt
index 5271f1410e..c74ed1bbc8 100644
--- a/build.sbt
+++ b/build.sbt
@@ -141,9 +141,7 @@ lazy val testing = libraryProject("testing")
       scalacheck,
       scalacheckEffect,
       scalacheckEffectMunit,
-      specs2Common.withDottyCompat(scalaVersion.value),
-      specs2Matcher.withDottyCompat(scalaVersion.value),
-    ),
+    ).map(_ % Test),
   )
   .dependsOn(laws)
 
diff --git a/core/src/main/scala/org/http4s/StaticFile.scala b/core/src/main/scala/org/http4s/StaticFile.scala
index 7d1f379374..30e94c05b2 100644
--- a/core/src/main/scala/org/http4s/StaticFile.scala
+++ b/core/src/main/scala/org/http4s/StaticFile.scala
@@ -16,7 +16,7 @@
 
 package org.http4s
 
-import cats.{Functor, MonadError, Semigroup}
+import cats.{Functor, MonadError, MonadThrow, Semigroup}
 import cats.data.OptionT
 import cats.effect.{Sync, SyncIO}
 import cats.syntax.all._
@@ -35,7 +35,7 @@ object StaticFile {
 
   val DefaultBufferSize = 10240
 
-  def fromString[F[_]: Files: MonadError[*[_], Throwable]](
+  def fromString[F[_]: Files: MonadThrow](
       url: String,
       req: Option[Request[F]] = None): OptionT[F, Response[F]] =
     fromFile(new File(url), req)
@@ -125,18 +125,18 @@ object StaticFile {
         .map(isFile =>
           if (isFile) s"${f.lastModified().toHexString}-${f.length().toHexString}" else "")
 
-  def fromFile[F[_]: Files: MonadError[*[_], Throwable]](
+  def fromFile[F[_]: Files: MonadThrow](
       f: File,
       req: Option[Request[F]] = None): OptionT[F, Response[F]] =
     fromFile(f, DefaultBufferSize, req, calcETag[F])
 
-  def fromFile[F[_]: Files: MonadError[*[_], Throwable]](
+  def fromFile[F[_]: Files: MonadThrow](
       f: File,
       req: Option[Request[F]],
       etagCalculator: File => F[String]): OptionT[F, Response[F]] =
     fromFile(f, DefaultBufferSize, req, etagCalculator)
 
-  def fromFile[F[_]: Files: MonadError[*[_], Throwable]](
+  def fromFile[F[_]: Files: MonadThrow](
       f: File,
       buffsize: Int,
       req: Option[Request[F]],
diff --git a/core/src/main/scala/org/http4s/multipart/MultipartParser.scala b/core/src/main/scala/org/http4s/multipart/MultipartParser.scala
index 04184997c4..5bfb7d83e2 100644
--- a/core/src/main/scala/org/http4s/multipart/MultipartParser.scala
+++ b/core/src/main/scala/org/http4s/multipart/MultipartParser.scala
@@ -616,7 +616,7 @@ object MultipartParser {
     }
   }
 
-  private[this] def cleanupFileOption[F[_]: Files: MonadError[*[_], Throwable]](
+  private[this] def cleanupFileOption[F[_]: Files: MonadThrow](
       p: Option[Path]
   ): Pull[F, Nothing, Unit] =
     p match {
@@ -629,7 +629,7 @@ object MultipartParser {
 
   private[this] def cleanupFile[F[_]](
       path: Path
-  )(implicit files: Files[F], F: MonadError[F, Throwable]): F[Unit] =
+  )(implicit files: Files[F], F: MonadThrow[F]): F[Unit] =
     files
       .delete(path)
       .handleErrorWith { err =>
diff --git a/project/Http4sPlugin.scala b/project/Http4sPlugin.scala
index a1b5a34e89..aa74d2ace3 100644
--- a/project/Http4sPlugin.scala
+++ b/project/Http4sPlugin.scala
@@ -326,7 +326,7 @@ object Http4sPlugin extends AutoPlugin {
     val tomcat = "9.0.43"
     val treehugger = "0.4.4"
     val twirl = "1.4.2"
-    val vault = "3.0.0-M1"
+    val vault = "3.0.0-M4"
   }
 
   lazy val asyncHttpClient                  = "org.asynchttpclient"    %  "async-http-client"         % V.asyncHttpClient
diff --git a/server/src/main/scala/org/http4s/server/middleware/BracketRequestResponse.scala b/server/src/main/scala/org/http4s/server/middleware/BracketRequestResponse.scala
index ce6d4d1571..ed383e486f 100644
--- a/server/src/main/scala/org/http4s/server/middleware/BracketRequestResponse.scala
+++ b/server/src/main/scala/org/http4s/server/middleware/BracketRequestResponse.scala
@@ -126,7 +126,7 @@ object BracketRequestResponse {
                 F.pure(Some(contextResponse.response.copy(body =
                   contextResponse.response.body.onFinalizeCaseWeak(ec =>
                     release(contextRequest.context, Some(contextResponse.context), exitCaseToOutcome(ec)))))))
-              .guaranteeCase { oc: Outcome[F, Throwable, Option[Response[F]]] =>
+              .guaranteeCase { (oc: Outcome[F, Throwable, Option[Response[F]]]) =>
                 oc match {
                   case Outcome.Succeeded(_) =>
                     F.unit
@@ -182,7 +182,7 @@ object BracketRequestResponse {
             .map(response =>
               response.copy(body =
                 response.body.onFinalizeCaseWeak(ec => release(a, exitCaseToOutcome(ec)))))
-            .guaranteeCase { oc: Outcome[F, Throwable, Response[F]] =>
+            .guaranteeCase { (oc: Outcome[F, Throwable, Response[F]]) =>
               oc match {
                 case Outcome.Succeeded(_) =>
                   F.unit
diff --git a/server/src/main/scala/org/http4s/server/middleware/RequestLogger.scala b/server/src/main/scala/org/http4s/server/middleware/RequestLogger.scala
index 0191abcfec..e69ab75e16 100644
--- a/server/src/main/scala/org/http4s/server/middleware/RequestLogger.scala
+++ b/server/src/main/scala/org/http4s/server/middleware/RequestLogger.scala
@@ -103,7 +103,7 @@ object RequestLogger {
               logMessage(req.withBodyStream(newBody))
             val response: G[Response[F]] =
               http(changedRequest)
-                .guaranteeCase { oc: Outcome[G, _, Response[F]] =>
+                .guaranteeCase { (oc: Outcome[G, _, Response[F]]) =>
                   oc match {
                     case Outcome.Succeeded(_) => G.unit
                     case _ => fk(logRequest)


Test patch:
diff --git a/testing/src/test/scala/org/http4s/testing/DispatcherIOFixture.scala b/testing/src/test/scala/org/http4s/testing/DispatcherIOFixture.scala
index b69aacd3cd..fa639cb0dc 100644
--- a/testing/src/test/scala/org/http4s/testing/DispatcherIOFixture.scala
+++ b/testing/src/test/scala/org/http4s/testing/DispatcherIOFixture.scala
@@ -18,9 +18,9 @@ package org.http4s.testing
 
 import cats.effect.{IO, SyncIO}
 import cats.effect.std.Dispatcher
-import munit.CatsEffectFunFixtures
+import munit.CatsEffectSuite
 
-trait DispatcherIOFixture { this: CatsEffectFunFixtures =>
+trait DispatcherIOFixture { this: CatsEffectSuite =>
 
   def dispatcher: SyncIO[FunFixture[Dispatcher[IO]]] = ResourceFixture(Dispatcher[IO])