Skip to content
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

Update scalafmt-core to 3.8.4 #1746

Merged
merged 3 commits into from
Jan 16, 2025
Merged
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
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.5.8
699c16e7a245b2ffee1ba4de9bfd1093a3d5072f

# Scala Steward: Reformat with scalafmt 3.8.4
cc2327d46a560d51bfc6d0e417dacd42fe8a8578
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.4
maxColumn = 160
align.preset = some
runner.dialect = scala213
Expand Down
5 changes: 2 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ lazy val publishSettings = Seq(
)
),
releaseVersionBump := sbtrelease.Version.Bump.Minor,
releaseProcess := {
releaseProcess :=
Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
Expand All @@ -148,8 +148,7 @@ lazy val publishSettings = Seq(
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
)
},
),
pomExtra :=
<developers>
<developer>
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/scala/io/finch/Bootstrap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ import shapeless._
* ==Supported Configuration Options==
*
* - `includeDateHeader` (default: `true`): whether or not to include the Date header into each response (see RFC2616, section 14.18)
*
* - `includeServerHeader` (default: `true`): whether or not to include the Server header into each response (see RFC2616, section 14.38)
*
* - `enableMethodNotAllowed` (default: `false`): whether or not to enable 405 MethodNotAllowed HTTP response (see RFC2616, section 10.4.6)
*
* - `enableUnsupportedMediaType` (default: `false`) whether or not to enable 415 UnsupportedMediaType HTTP response (see RFC7231, section 6.5.13)
*
* @see
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/io/finch/Endpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import scala.reflect.ClassTag
* val bar: Endpoint[Bar] = get("bar" :: path[String]) { s: String => Ok(Bar(s)) }
* }}}
*
* `Endpoint`s are also composable in terms of or-else combinator (known as a "space invader" operator `:+:`) that takes two `Endpoint`s and returns a
* `Endpoint` s are also composable in terms of or-else combinator (known as a "space invader" operator `:+:`) that takes two `Endpoint` s and returns a
* coproduct `Endpoint`.
*
* {{{
Expand Down
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/BootstrapSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class BootstrapSpec extends FinchSpec[SyncIO] {
}
}

it should "capture Trace for failures and successes" in {
it should "capture Trace for failures and successes" in
check { req: Request =>
val p = req.path.split("/").drop(1)

Expand All @@ -121,5 +121,4 @@ class BootstrapSpec extends FinchSpec[SyncIO] {

successCapture.toList === p.toList && failureCapture.toList === p.toList
}
}
}
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/EncodeSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ class EncodeSpec extends FinchSpec[Id] {
}
}

it should "encode exceptions" in {
it should "encode exceptions" in
check { (s: String, cs: Charset) =>
val e = new Exception(s)
val text = Encode[Exception, Text.Plain].apply(e, cs)

text === Buf.ByteArray.Owned(s.getBytes(cs.name))
}
}
}
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/EndToEndSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,14 @@ class EndToEndSpec extends FinchSpec[IO] {
}
}

it should "succeed when there is no Accept header even though Not Acceptable is enabled" in {
it should "succeed when there is no Accept header even though Not Acceptable is enabled" in
testService[Text.Plain](pathAny, _.configure(enableNotAcceptable = true)) { s =>
check { req: Request =>
req.accept = Nil
val rep = Await.result(s(req))
rep.status === Status.Ok
}
}
}
}

object EndToEndSpec {
Expand Down
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/EndpointSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,8 @@ class EndpointSpec extends FinchSpec[SyncIO] {

val put = ab(Input.put("/foo"))
put.isMatched shouldBe false
put.asInstanceOf[EndpointResult.NotMatched.MethodNotAllowed[IO]].allowed.toSet shouldBe {
put.asInstanceOf[EndpointResult.NotMatched.MethodNotAllowed[IO]].allowed.toSet shouldBe
Set(Method.Post, Method.Get)
}
}

it should "support the as[A] method on Endpoint[Seq[String]]" in {
Expand Down
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/FinchSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ trait FinchSpec[F[_]]

def checkAll(name: String, ruleSet: Laws#RuleSet): Unit =
for ((id, prop) <- ruleSet.all.properties)
it should (name + "." + id) in {
it should (name + "." + id) in
check(prop)
}

case class BasicAuthCredentials(user: String, pass: String)

Expand Down
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/InputSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ class InputSpec extends FinchSpec[IO] {
}
}

it should "parse route correctly" in {
it should "parse route correctly" in
check { i: Input =>
i.route === i.request.path.split("/").toList.drop(1)
}
}
}
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/MethodSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ class MethodSpec extends FinchSpec[SyncIO] {
checkFunction2(get(path[Int] :: path[Int])((x: Int, y: Int) => SyncIO.pure(Ok(s"$x$y"))))
}

it should "map (A, B) => F[Response] function to endpoint" in {
it should "map (A, B) => F[Response] function to endpoint" in
checkFunction2(get(path[Int] :: path[Int]) { (x: Int, y: Int) =>
SyncIO.pure(Ok(s"$x$y").toResponse[Id, Text.Plain])
})
}

private def checkValue[A: Arbitrary](f: A => Endpoint[SyncIO, A]): Unit =
forAll { (input: A) =>
Expand Down
9 changes: 3 additions & 6 deletions core/src/test/scala/io/finch/MultipartSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,25 @@ class MultipartSpec extends FinchSpec[SyncIO] {
}

it should "fail when attribute is missing" in {
an[Error.NotPresent] should be thrownBy {
an[Error.NotPresent] should be thrownBy
multipartAttribute("foo").apply(Input.get("/")).value.unsafeRunSync()
}
}

it should "return None for when attribute is missing for optional endpoint" in {
multipartAttributeOption("foo").apply(Input.get("/")).valueOption.unsafeRunSync().flatten shouldBe None
}

it should "fail when attributes are missing" in {
an[Error.NotPresent] should be thrownBy {
an[Error.NotPresent] should be thrownBy
multipartAttributesNel("foo").apply(Input.get("/")).value.unsafeRunSync()
}
}

it should "return empty sequence when attributes are missing for seq endpoint" in {
multipartAttributes("foo").apply(Input.get("/")).valueOption.unsafeRunSync() === Some(Seq())
}

it should "fail when attribute is malformed" in {
an[Error.NotParsed] should be thrownBy {
an[Error.NotParsed] should be thrownBy
multipartAttribute[Int]("foo").apply(withAttribute("foo" -> "bar")).value.unsafeRunSync()
}
}
}
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/OutputSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ class OutputSpec extends FinchSpec[Id] {
}
}

it should "traverse arbitrary outputs" in {
it should "traverse arbitrary outputs" in
check { oa: Output[String] =>
oa.traverse[Try, String](_ => Success(oa.value)) === Success(oa)
}
}
}
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/TraceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ class TraceSpec extends FinchSpec[Id] {
}
}

it should "create fromRoute" in {
it should "create fromRoute" in
check { l: List[String] =>
Trace.fromRoute(l).toList === l
}
}
}
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/internal/HttpContentSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ class HttpContentSpec extends FinchSpec[Id] {
}
}

it should "asString" in {
it should "asString" in
check { (b: Buf, cs: Charset) =>
b.asString(cs) === new String(Buf.ByteArray.Owned.extract(b), cs)
}
}
}
3 changes: 1 addition & 2 deletions core/src/test/scala/io/finch/internal/HttpMessageSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ class HttpMessageSpec extends FinchSpec[Id] {
assert(Request().charsetOrUtf8 == StandardCharsets.UTF_8)
}

it should "mediaTypeOrEmpty" in {
it should "mediaTypeOrEmpty" in
check { cs: Option[Charset] =>
val req = Request()
req.contentType = "application/json"
cs.foreach(c => req.charset = c.displayName())

req.mediaTypeOrEmpty === "application/json"
}
}
}
3 changes: 1 addition & 2 deletions examples/src/test/scala/io/finch/todo/TodoSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class TodoSpec extends AnyFlatSpec with Matchers with Checkers {
}
}

it should "patch a todo" in {
it should "patch a todo" in
check { (app: TestApp, todo: TodoCompleted) =>
def input(id: Int): Input = Input.patch(s"/todos/$id").withBody[Application.Json](todo)

Expand All @@ -82,5 +82,4 @@ class TodoSpec extends AnyFlatSpec with Matchers with Checkers {

shouldBeTrue.unsafeRunSync()
}
}
}
Loading