Skip to content

Update scalafmt-core to 3.8.6 #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Scala Steward: Reformat with scalafmt 3.8.3
585dfcc18c2106ab35f69e495627a0bc5770caaa

# Scala Steward: Reformat with scalafmt 3.8.6
d103efa85a9fc8c607c315b67160bc9db9e48883
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.3"
version = "3.8.6"
runner.dialect = scala213
maxColumn = 140
align.preset = some
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."""))
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -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 =
Expand Down
Loading