From 2f1f192d144da2aea21438ce779949fb90c94efd Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 19 Jan 2025 04:44:47 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.8.5 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 3f3b3f7b..c4246144 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.8.3" +version = "3.8.5" runner.dialect = scala213 maxColumn = 140 align.preset = some From 249ca6dbd9746489a9c650bab0473564c892ec25 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 19 Jan 2025 04:45:05 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.8.5 Executed command: scalafmt --non-interactive --- .../sttp/oauth2/ValidScopeTest.scala | 9 +++---- .../json/OAuth2ErrorDeserializationSpec.scala | 27 +++++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/ValidScopeTest.scala b/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/ValidScopeTest.scala index d2336109..a8caf0fb 100644 --- a/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/ValidScopeTest.scala +++ b/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/ValidScopeTest.scala @@ -11,20 +11,17 @@ class ValidScopeTest extends AnyWordSpec with Matchers { val allowedChars: List[Char] = 33.toChar +: List(' ') ::: (35 to 91).map(_.toChar).toList ::: (93 to 125).map(_.toChar).toList "Scope" should { - "be created according to RFC allowed characters" in { + "be created according to RFC allowed characters" in assert( refineV[ValidScope](allowedChars.mkString("")).toOption === Scope.of("! #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}") ) - } - "not be created for empty string" in { + "not be created for empty string" in assert(refineV[ValidScope]("") === Left("""Predicate failed: "" matches ValidScope.""")) - } - "not be created for characters outside allowed range" in { + "not be created for characters outside allowed range" in assert(refineV[ValidScope](""" "\""") === Left("""Predicate failed: " "\" matches ValidScope.""")) - } } } diff --git a/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/json/OAuth2ErrorDeserializationSpec.scala b/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/json/OAuth2ErrorDeserializationSpec.scala index 1fd1685a..32c2cc52 100644 --- a/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/json/OAuth2ErrorDeserializationSpec.scala +++ b/oauth2/shared/src/test/scala/com/ocadotechnology/sttp/oauth2/json/OAuth2ErrorDeserializationSpec.scala @@ -22,7 +22,7 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with private def check[A <: OAuth2Error](json: String, deserialized: A) = JsonDecoder[OAuth2Error].decodeString(json) shouldBe Right(deserialized) - "invalid_request error JSON" should "be deserialized to InvalidRequest" in { + "invalid_request error JSON" should "be deserialized to InvalidRequest" in check( // language=JSON """ @@ -34,9 +34,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, OAuth2ErrorResponse(InvalidRequest, Some("Grant type is missing.")) ) - } - "invalid_client error JSON" should "be deserialized to InvalidClient" in { + "invalid_client error JSON" should "be deserialized to InvalidClient" in check( // language=JSON """ @@ -48,9 +47,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, OAuth2ErrorResponse(InvalidClient, Some("Client is missing or invalid.")) ) - } - "invalid_grant error JSON" should "be deserialized to InvalidGrant" in { + "invalid_grant error JSON" should "be deserialized to InvalidGrant" in check( // language=JSON """ @@ -62,9 +60,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, OAuth2ErrorResponse(InvalidGrant, Some("Provided domain cannot be used with given grant type.")) ) - } - "unauthorized_client error JSON" should "be deserialized to UnauthorizedClient" in { + "unauthorized_client error JSON" should "be deserialized to UnauthorizedClient" in check( // language=JSON """ @@ -76,9 +73,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, OAuth2ErrorResponse(UnauthorizedClient, Some("Client is not allowed to use provided grant type.")) ) - } - "unsupported_grant_type error JSON" should "be deserialized to InvalidGrant" in { + "unsupported_grant_type error JSON" should "be deserialized to InvalidGrant" in check( // language=JSON """ @@ -90,9 +86,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, OAuth2ErrorResponse(UnsupportedGrantType, Some("Requested grant type is invalid.")) ) - } - "invalid_scope error JSON" should "be deserialized to InvalidGrant" in { + "invalid_scope error JSON" should "be deserialized to InvalidGrant" in check( // language=JSON """ @@ -104,9 +99,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, OAuth2ErrorResponse(InvalidScope, Some("Client is not allowed to use requested scope.")) ) - } - "invalid_token error JSON" should "be deserialized to Unknown" in { + "invalid_token error JSON" should "be deserialized to Unknown" in check( // language=JSON """ @@ -118,9 +112,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, UnknownOAuth2Error(error = "invalid_token", Some("Invalid access token.")) ) - } - "insufficient_scope error JSON" should "be deserialized to Unknown" in { + "insufficient_scope error JSON" should "be deserialized to Unknown" in check( // language=JSON """ @@ -132,9 +125,8 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, UnknownOAuth2Error(error = "insufficient_scope", Some("Access token does not contain requested scope.")) ) - } - "unknown error JSON" should "be deserialized to Unknown" in { + "unknown error JSON" should "be deserialized to Unknown" in check( // language=JSON """ @@ -146,7 +138,6 @@ trait OAuth2ErrorDeserializationSpec extends AnyFlatSpecLike with Matchers with """, UnknownOAuth2Error(error = "unknown_error", errorDescription = Some("I don't know this error type.")) ) - } "JSON in wrong format" should "not be deserialized" in { val json = From 659ea39fdfe867cefe8024839f6f5f4d49c78411 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 19 Jan 2025 04:45:05 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.8.5' 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 7342d27d..43dfd08f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -3,3 +3,6 @@ # Scala Steward: Reformat with scalafmt 3.8.3 585dfcc18c2106ab35f69e495627a0bc5770caaa + +# Scala Steward: Reformat with scalafmt 3.8.5 +249ca6dbd9746489a9c650bab0473564c892ec25