From 27044ad0ae0ab1e214bc2b5fc1e1fecf4a2ca3a3 Mon Sep 17 00:00:00 2001 From: scala-steward Date: Thu, 16 Jan 2025 00:30:45 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.8.4 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index d43f241f7..8c4092f3b 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.2 +version = 3.8.4 maxColumn = 120 runner.dialect = scala213 fileOverride { From ff27a751590faa03e6507bec3cd18b6b8ed15003 Mon Sep 17 00:00:00 2001 From: scala-steward Date: Thu, 16 Jan 2025 00:30:55 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.8.4 Executed command: scalafmt --non-interactive --- core/src/main/scala/sttp/client4/backend.scala | 2 +- core/src/main/scala/sttp/client4/request.scala | 8 ++++---- core/src/main/scala/sttp/client4/ws/SyncWebSocket.scala | 2 +- .../examples/wrapper/CircuitBreakerCatsEffect.scala | 3 +-- .../scala/sttp/client4/testing/server/HttpServer.scala | 4 +++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/src/main/scala/sttp/client4/backend.scala b/core/src/main/scala/sttp/client4/backend.scala index 9a2147e5f..29b6c375a 100644 --- a/core/src/main/scala/sttp/client4/backend.scala +++ b/core/src/main/scala/sttp/client4/backend.scala @@ -38,7 +38,7 @@ trait GenericBackend[F[_], +P] { */ def close(): F[Unit] - /** A monad instance for the `F` effect type. Allows writing wrapper backends, which `map`/`flatMap`` over the return + /** A monad instance for the `F` effect type. Allows writing wrapper backends, which `map` /`flatMap`` over the return * value of [[send]]. */ def monad: MonadError[F] diff --git a/core/src/main/scala/sttp/client4/request.scala b/core/src/main/scala/sttp/client4/request.scala index bea6012ea..cf6775fd7 100644 --- a/core/src/main/scala/sttp/client4/request.scala +++ b/core/src/main/scala/sttp/client4/request.scala @@ -158,7 +158,7 @@ case class Request[T]( /** Sends the request, using the given backend. * * @return - * An `F`-effect, containing a [[Response]], with the body handled as specified by this request (see + * An `F` -effect, containing a [[Response]], with the body handled as specified by this request (see * [[Request.response]]). Effects might include asynchronous computations (e.g. [[scala.concurrent.Future]]), pure * effect descriptions (`IO`), or error wrappers (e.g. [[TryBackend]]). Exceptions are represented as failed * effects (e.g. failed futures). @@ -249,7 +249,7 @@ final case class StreamRequest[T, R]( * supported streams type must match, as well as the optional effect type. * * @return - * An `F`-effect, containing a [[Response]], with the body handled as specified by this request (see + * An `F` -effect, containing a [[Response]], with the body handled as specified by this request (see * [[Request.response]]). Effects might include asynchronous computations (e.g. [[scala.concurrent.Future]]), pure * effect descriptions (`IO`), or error wrappers (e.g. [[TryBackend]]). Exceptions are represented as failed * effects (e.g. failed futures). @@ -314,7 +314,7 @@ final case class WebSocketRequest[F[_], T]( /** Sends the WebSocket request, using the given backend. * * @return - * An `F`-effect, containing a [[Response]], with the body handled as specified by this request (see + * An `F` -effect, containing a [[Response]], with the body handled as specified by this request (see * [[Request.response]]). Effects might include asynchronous computations (e.g. [[scala.concurrent.Future]]), pure * effect descriptions (`IO`), or error wrappers (e.g. [[TryBackend]]). Exceptions are represented as failed * effects (e.g. failed futures). @@ -383,7 +383,7 @@ final case class WebSocketStreamRequest[T, S]( * The required streams capability `S` must match the streams supported by the backend. * * @return - * An `F`-effect, containing a [[Response]], with the body handled as specified by this request (see + * An `F` -effect, containing a [[Response]], with the body handled as specified by this request (see * [[Request.response]]). Effects might include asynchronous computations (e.g. [[scala.concurrent.Future]]), pure * effect descriptions (`IO`), or error wrappers (e.g. [[TryBackend]]). Exceptions are represented as failed * effects (e.g. failed futures). diff --git a/core/src/main/scala/sttp/client4/ws/SyncWebSocket.scala b/core/src/main/scala/sttp/client4/ws/SyncWebSocket.scala index a08e71491..92f516e03 100644 --- a/core/src/main/scala/sttp/client4/ws/SyncWebSocket.scala +++ b/core/src/main/scala/sttp/client4/ws/SyncWebSocket.scala @@ -23,7 +23,7 @@ class SyncWebSocket(val delegate: WebSocket[Identity]) { * happen. * * However, not all implementations expose the close frame, and web sockets might also get closed without the proper - * close frame exchange. In such cases, as well as when invoking `receive`/`send` after receiving a close frame, a + * close frame exchange. In such cases, as well as when invoking `receive` /`send` after receiving a close frame, a * [[WebSocketClosed]] exception will be thrown. * * *Should be only called sequentially!* (from a single thread/fiber). Because web socket frames might be fragmented, diff --git a/examples/src/main/scala/sttp/client4/examples/wrapper/CircuitBreakerCatsEffect.scala b/examples/src/main/scala/sttp/client4/examples/wrapper/CircuitBreakerCatsEffect.scala index 6ab66a80f..9de6a1297 100644 --- a/examples/src/main/scala/sttp/client4/examples/wrapper/CircuitBreakerCatsEffect.scala +++ b/examples/src/main/scala/sttp/client4/examples/wrapper/CircuitBreakerCatsEffect.scala @@ -43,8 +43,7 @@ object CircuitBreakerBackendWrapper: try monadError.handleError(monadError.map(service): r => circuitBreaker.onSuccess(System.nanoTime() - start, TimeUnit.NANOSECONDS) - r - ) { case t => + r) { case t => circuitBreaker.onError(System.nanoTime() - start, TimeUnit.NANOSECONDS, t) monadError.error(t) } diff --git a/testing/server/src/main/scala/sttp/client4/testing/server/HttpServer.scala b/testing/server/src/main/scala/sttp/client4/testing/server/HttpServer.scala index 518bcb0d4..16fa31d22 100644 --- a/testing/server/src/main/scala/sttp/client4/testing/server/HttpServer.scala +++ b/testing/server/src/main/scala/sttp/client4/testing/server/HttpServer.scala @@ -413,7 +413,9 @@ private class HttpServer(port: Int, info: String => Unit) extends AutoCloseable protocol = HttpProtocols.`HTTP/1.1` ) ) - } ~ pathPrefix("retry") { // #1616: calling the endpoint with the same tag will give status codes 401, 401, 400, 200, ... + } ~ pathPrefix( + "retry" + ) { // #1616: calling the endpoint with the same tag will give status codes 401, 401, 400, 200, ... parameter("tag") { tag => val current = Option(retryTestCache.get(tag)).getOrElse(0) retryTestCache.put(tag, current + 1) From 67aaf10c7dedd3dc3cbd1fec39b7ee505ed03444 Mon Sep 17 00:00:00 2001 From: scala-steward Date: Thu, 16 Jan 2025 00:30:55 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.8.4' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 07c077e9b..ab60059b0 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -23,3 +23,6 @@ a5e39d1f4d49c7e32a9b834ebbf429f8f5cab5ee # Scala Steward: Reformat with scalafmt 3.8.2 be3cd01c8ea70ee2383d0d05ab8d129f67b70c28 + +# Scala Steward: Reformat with scalafmt 3.8.4 +ff27a751590faa03e6507bec3cd18b6b8ed15003