Skip to content

Commit ad77217

Browse files
scala-stewardpjfanning
authored andcommitted
Reformat with scalafmt 3.10.4
Executed command: scalafmt --non-interactive
1 parent 88f2d62 commit ad77217

File tree

73 files changed

+345
-358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+345
-358
lines changed

build.sbt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ inThisBuild(Def.settings(
4444
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
4545
onLoad in Global := {
4646
sLog.value.info(
47-
s"Building Pekko HTTP ${version.value} against Pekko ${PekkoCoreDependency.version} on Scala ${(httpCore / scalaVersion).value}")
47+
s"Building Pekko HTTP ${version.value} against Pekko ${PekkoCoreDependency.version} on Scala ${(httpCore /
48+
scalaVersion).value}")
4849
(onLoad in Global).value
4950
},
5051
projectInfoVersion := (if (isSnapshot.value) "snapshot" else version.value),
@@ -424,8 +425,10 @@ lazy val docs = project("docs")
424425
"javadoc.org.apache.pekko.link_style" -> "direct",
425426
"scaladoc.org.apache.pekko.base_url" -> s"https://pekko.apache.org/api/pekko/${PekkoCoreDependency.default.link}",
426427
"scaladoc.org.apache.pekko.link_style" -> "direct",
427-
"javadoc.org.apache.pekko.http.base_url" -> s"https://pekko.apache.org/japi/pekko-http/${projectInfoVersion.value}",
428-
"scaladoc.org.apache.pekko.http.base_url" -> s"https://pekko.apache.org/api/pekko-http/${projectInfoVersion.value}",
428+
"javadoc.org.apache.pekko.http.base_url" ->
429+
s"https://pekko.apache.org/japi/pekko-http/${projectInfoVersion.value}",
430+
"scaladoc.org.apache.pekko.http.base_url" ->
431+
s"https://pekko.apache.org/api/pekko-http/${projectInfoVersion.value}",
429432
"github.base_url" -> GitHub.url(version.value, isSnapshot.value)),
430433
apidocRootPackage := "org.apache.pekko",
431434
ValidatePR / additionalTasks += Compile / paradox)

docs/src/test/scala/docs/http/scaladsl/HttpServerExampleSpec.scala

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -361,19 +361,18 @@ class HttpServerExampleSpec extends AnyWordSpec with Matchers
361361
// needed for the future flatMap/onComplete in the end
362362
implicit val executionContext = system.dispatcher
363363

364-
val route =
365-
(put & path("lines")) {
366-
withoutSizeLimit {
367-
extractDataBytes { bytes =>
368-
val finishedWriting = bytes.runWith(FileIO.toPath(new File("/tmp/example.out").toPath))
369-
370-
// we only want to respond once the incoming data has been handled:
371-
onComplete(finishedWriting) { ioResult =>
372-
complete("Finished writing data: " + ioResult)
373-
}
364+
val route = (put & path("lines")) {
365+
withoutSizeLimit {
366+
extractDataBytes { bytes =>
367+
val finishedWriting = bytes.runWith(FileIO.toPath(new File("/tmp/example.out").toPath))
368+
369+
// we only want to respond once the incoming data has been handled:
370+
onComplete(finishedWriting) { ioResult =>
371+
complete("Finished writing data: " + ioResult)
374372
}
375373
}
376374
}
375+
}
377376
// #consume-raw-dataBytes
378377
}
379378

@@ -388,19 +387,18 @@ class HttpServerExampleSpec extends AnyWordSpec with Matchers
388387
// needed for the future flatMap/onComplete in the end
389388
implicit val executionContext = system.dispatcher
390389

391-
val route =
392-
(put & path("lines")) {
393-
withoutSizeLimit {
394-
extractRequest { (r: HttpRequest) =>
395-
val finishedWriting = r.discardEntityBytes().future
396-
397-
// we only want to respond once the incoming data has been handled:
398-
onComplete(finishedWriting) { done =>
399-
complete("Drained all data from connection... (" + done + ")")
400-
}
390+
val route = (put & path("lines")) {
391+
withoutSizeLimit {
392+
extractRequest { (r: HttpRequest) =>
393+
val finishedWriting = r.discardEntityBytes().future
394+
395+
// we only want to respond once the incoming data has been handled:
396+
onComplete(finishedWriting) { done =>
397+
complete("Drained all data from connection... (" + done + ")")
401398
}
402399
}
403400
}
401+
}
404402
// #discard-discardEntityBytes
405403
}
406404

@@ -416,22 +414,21 @@ class HttpServerExampleSpec extends AnyWordSpec with Matchers
416414
// needed for the future flatMap/onComplete in the end
417415
implicit val executionContext = system.dispatcher
418416

419-
val route =
420-
(put & path("lines")) {
421-
withoutSizeLimit {
422-
extractDataBytes { data =>
423-
// Closing connections, method 1 (eager):
424-
// we deem this request as illegal, and close the connection right away:
425-
data.runWith(Sink.cancelled) // "brutally" closes the connection
426-
427-
// Closing connections, method 2 (graceful):
428-
// consider draining connection and replying with `Connection: Close` header
429-
// if you want the client to close after this request/reply cycle instead:
430-
respondWithHeader(Connection("close"))
431-
complete(StatusCodes.Forbidden -> "Not allowed!")
432-
}
417+
val route = (put & path("lines")) {
418+
withoutSizeLimit {
419+
extractDataBytes { data =>
420+
// Closing connections, method 1 (eager):
421+
// we deem this request as illegal, and close the connection right away:
422+
data.runWith(Sink.cancelled) // "brutally" closes the connection
423+
424+
// Closing connections, method 2 (graceful):
425+
// consider draining connection and replying with `Connection: Close` header
426+
// if you want the client to close after this request/reply cycle instead:
427+
respondWithHeader(Connection("close"))
428+
complete(StatusCodes.Forbidden -> "Not allowed!")
433429
}
434430
}
431+
}
435432
// #discard-close-connections
436433
}
437434

docs/src/test/scala/docs/http/scaladsl/server/CaseClassExtractionExamplesSpec.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ class CaseClassExtractionExamplesSpec extends RoutingSpec with Inside {
5555
// #example-3
5656
case class Color(name: String, red: Int, green: Int, blue: Int)
5757

58-
val route =
59-
(path("color" / Segment) & parameters("r".as[Int], "g".as[Int], "b".as[Int]))
60-
.as(Color.apply _) { color =>
61-
// ... route working with the `color` instance
62-
doSomethingWith(color) // #hide
63-
}
58+
val route = (path("color" / Segment) & parameters("r".as[Int], "g".as[Int], "b".as[Int]))
59+
.as(Color.apply _) { color =>
60+
// ... route working with the `color` instance
61+
doSomethingWith(color) // #hide
62+
}
6463
Get("/color/abc?r=1&g=2&b=3") ~> route ~> check { responseAs[String] shouldEqual "Color(abc,1,2,3)" } // #hide
6564
// #example-3
6665
}
@@ -77,7 +76,7 @@ class CaseClassExtractionExamplesSpec extends RoutingSpec with Inside {
7776
"example 4 test" in {
7877
val route =
7978
(path("color" / Segment) &
80-
parameters("r".as[Int], "g".as[Int], "b".as[Int])).as(Color.apply _) { color =>
79+
parameters("r".as[Int], "g".as[Int], "b".as[Int])).as(Color.apply _) { color =>
8180
// ... route working with the `color` instance
8281
doSomethingWith(color) // #hide
8382
}

docs/src/test/scala/docs/http/scaladsl/server/DirectiveExamplesSpec.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@ class DirectiveExamplesSpec extends RoutingSpec with CompileOnlySpec {
102102
"example-6" in {
103103
// #example-6
104104
val getOrPut = get | put
105-
val route =
106-
(path("order" / IntNumber) & getOrPut & extractMethod) { (id, m) =>
107-
complete(s"Received ${m.name} request for order $id")
108-
}
105+
val route = (path("order" / IntNumber) & getOrPut & extractMethod) { (id, m) =>
106+
complete(s"Received ${m.name} request for order $id")
107+
}
109108
verify(route) // #hide
110109
// #example-6
111110
}

docs/src/test/scala/docs/http/scaladsl/server/directives/HeaderDirectivesExamplesSpec.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ class HeaderDirectivesExamplesSpec extends RoutingSpec with CompileOnlySpec with
7171
case _ => None
7272
}
7373

74-
val route =
75-
(headerValue(extractExampleHeader) | provide("newValue")) { value =>
76-
complete(s"headerValue $value")
77-
}
74+
val route = (headerValue(extractExampleHeader) | provide("newValue")) { value =>
75+
complete(s"headerValue $value")
76+
}
7877

7978
// tests:
8079
Get("/") ~> RawHeader("exampleHeaderValue", "theHeaderValue") ~> route ~> check {

docs/src/test/scala/docs/http/scaladsl/server/directives/ParameterDirectivesExamplesSpec.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ class ParameterDirectivesExamplesSpec extends RoutingSpec with CompileOnlySpec w
121121

122122
Get("/?color=blue&count=blub") ~> Route.seal(route) ~> check {
123123
status shouldEqual StatusCodes.BadRequest
124-
responseAs[String] shouldEqual "The query parameter 'count' was malformed:\n'blub'" +
124+
responseAs[String] shouldEqual
125+
"The query parameter 'count' was malformed:\n'blub'" +
125126
" is not a valid 32-bit signed integer value"
126127
}
127128
// #mapped-value

docs/src/test/scala/docs/http/scaladsl/server/directives/RouteDirectivesExamplesSpec.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ class RouteDirectivesExamplesSpec extends RoutingSpec with CompileOnlySpec {
162162

163163
Get("/foo") ~> route ~> check {
164164
status shouldEqual StatusCodes.PermanentRedirect
165-
responseAs[String] shouldEqual """The request, and all future requests should be repeated using <a href="/foo/">this URI</a>."""
165+
responseAs[String] shouldEqual
166+
"""The request, and all future requests should be repeated using <a href="/foo/">this URI</a>."""
166167
}
167168
// #redirect-examples
168169
}

http-bench-jmh/src/main/scala/org/apache/pekko/http/impl/engine/MessageToFrameRendererBenchmark.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ import scala.concurrent.Await
2323
import scala.concurrent.duration.{ Duration, DurationInt }
2424

2525
import org.openjdk.jmh.annotations.{
26-
Benchmark,
27-
BenchmarkMode,
28-
Mode,
29-
OperationsPerInvocation,
30-
OutputTimeUnit,
31-
Scope,
32-
State,
33-
TearDown
26+
Benchmark, BenchmarkMode, Mode, OperationsPerInvocation, OutputTimeUnit, Scope, State, TearDown
3427
}
3528

3629
import org.apache.pekko

http-bench-jmh/src/main/scala/org/apache/pekko/http/impl/engine/http2/H2RequestResponseBenchmark.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ import org.apache.pekko
1919
import pekko.http.impl.engine.http2.FrameEvent.{ DataFrame, HeadersFrame }
2020
import pekko.http.impl.engine.http2.framing.FrameRenderer
2121
import pekko.http.scaladsl.model.{
22-
AttributeKeys,
23-
ContentTypes,
24-
HttpEntity,
25-
HttpMethods,
26-
HttpRequest,
27-
HttpResponse,
28-
Trailer
22+
AttributeKeys, ContentTypes, HttpEntity, HttpMethods, HttpRequest, HttpResponse, Trailer
2923
}
3024
import pekko.http.scaladsl.model.HttpEntity.{ Chunk, LastChunk }
3125
import pekko.http.scaladsl.model.headers.RawHeader

http-core/src/main/scala/org/apache/pekko/http/impl/engine/client/PoolMasterActor.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ package org.apache.pekko.http.impl.engine.client
1616
import org.apache.pekko
1717
import pekko.Done
1818
import pekko.actor.{
19-
Actor,
20-
ActorLogging,
21-
ActorRef,
22-
DeadLetterSuppression,
23-
Deploy,
24-
ExtendedActorSystem,
25-
NoSerializationVerificationNeeded,
19+
Actor, ActorLogging, ActorRef, DeadLetterSuppression, Deploy, ExtendedActorSystem, NoSerializationVerificationNeeded,
2620
Props
2721
}
2822
import pekko.annotation.InternalApi

0 commit comments

Comments
 (0)