Skip to content

Commit f84a730

Browse files
Update scalafmt-core to 3.9.7 (#409)
* Update scalafmt-core to 3.9.7 * Reformat with scalafmt 3.9.7 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.9.7' to .git-blame-ignore-revs
1 parent bf91585 commit f84a730

File tree

17 files changed

+36
-32
lines changed

17 files changed

+36
-32
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ b24ba10341261bd7f44e08fc26862d43b860f06a
66

77
# Scala Steward: Reformat with scalafmt 3.8.4
88
cbb28af43af57945f6096c40a0fb8ee1d11a4a68
9+
10+
# Scala Steward: Reformat with scalafmt 3.9.7
11+
cb1c5d06835ed0d274bbea2ef90485d1cdf2f834

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.9.6"
1+
version = "3.9.7"
22
runner.dialect = scala213
33
maxColumn = 120
44
project.git = true

modules/api/src/main/scala/com/github/andyglow/websocket/Platform.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ trait Platform {
155155
/** We trigger this partial function in case of failures
156156
* @return
157157
*/
158-
def onFailure: PartialFunction[Throwable, Unit] = { case _: Throwable => /* ignore errors */
158+
def onFailure: PartialFunction[Throwable, Unit] = {
159+
case _: Throwable => /* ignore errors */
159160
}
160161

161162
/** This function is going to be called when the socket is closed.

modules/api/src/main/scala/com/github/andyglow/websocket/ServerAddress.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ object ServerAddress {
4040

4141
def apply(uri: URI): ServerAddress = {
4242
require(uri.getScheme == "ws" || uri.getScheme == "wss")
43-
val secure = uri.getScheme == "wss"
44-
val host = uri.getHost
45-
val port = uri.getPort
46-
val path = uri.getPath
43+
val secure = uri.getScheme == "wss"
44+
val host = uri.getHost
45+
val port = uri.getPort
46+
val path = uri.getPath
4747
val queryList =
4848
if (uri.getRawQuery == null) List.empty
4949
else
5050
(uri.getRawQuery split "&").toList map { token =>
5151
token split "=" match {
5252
case Array(k: String, v: String) => (k, URLDecoder.decode(v, "UTF-8"))
53-
case arr =>
53+
case arr =>
5454
throw new Exception(
5555
s"Query Parameter Parse Exception. Invalid token [$token] lead to [${arr mkString ","}]. Expected 'k=v' form"
5656
)

modules/api/src/test/scala/com/github/andyglow/websocket/IntegrationSpecBase.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object IntegrationSpecBase {
1919
}
2020

2121
protected class EmbeddedServer(ssl: Boolean) extends ServerHandle {
22-
protected final lazy val server = WebsocketServer.newServer(ssl)
22+
protected final lazy val server = WebsocketServer.newServer(ssl)
2323
override def address: ServerAddress = {
2424
val scheme: String = if (ssl) "wss" else "ws"
2525
ServerAddress(s"$scheme://localhost:${server.port}${WebsocketServer.WebsocketPath}")
@@ -99,9 +99,9 @@ trait IntegrationSpecBase extends AnyWordSpec with BeforeAndAfterAll {
9999
protected def withState[T <: State](init: T): Builder0[T] = Builder0(init)
100100

101101
protected case class CountingDownState(count: Int = 1) extends State {
102-
val latch = new CountDownLatch(count)
103-
def countDown(): Unit = latch.countDown()
104-
def succeeded: Boolean = latch.getCount == 0
102+
val latch = new CountDownLatch(count)
103+
def countDown(): Unit = latch.countDown()
104+
def succeeded: Boolean = latch.getCount == 0
105105
def whenFinished[T](fn: => T): T = {
106106
latch.await(2, TimeUnit.SECONDS)
107107
fn

modules/api/src/test/scala/com/github/andyglow/websocket/TestPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TestPlatform extends Platform {
99

1010
trait Msg
1111
object Msg {
12-
case class Text(value: String) extends Msg
12+
case class Text(value: String) extends Msg
1313
case class Binary(value: Array[Byte]) extends Msg {
1414
override def equals(obj: Any): Boolean = obj match {
1515
case Binary(other) => java.util.Arrays.equals(value, other)

modules/backend-akka/src/main/scala/com/github/andyglow/websocket/AkkaImplicits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait AkkaImplicits { this: AkkaPlatform =>
1616
fromString: String => T
1717
) extends MessageAdapter[T] {
1818
override type F = Text
19-
override def toMessage(msg: T)(implicit ic: InternalContext): F = ws.TextMessage(toString(msg))
19+
override def toMessage(msg: T)(implicit ic: InternalContext): F = ws.TextMessage(toString(msg))
2020
override def fromMessage(msg: F)(implicit ic: InternalContext): T = {
2121
import ic._
2222
import mat.executionContext
@@ -33,7 +33,7 @@ trait AkkaImplicits { this: AkkaPlatform =>
3333
fromByteString: ByteString => T
3434
) extends MessageAdapter[T] {
3535
override type F = Binary
36-
override def toMessage(msg: T)(implicit ic: InternalContext): F = ws.BinaryMessage(toByteString(msg))
36+
override def toMessage(msg: T)(implicit ic: InternalContext): F = ws.BinaryMessage(toByteString(msg))
3737
override def fromMessage(msg: F)(implicit ic: InternalContext): T = {
3838
import ic._
3939
import mat.executionContext

modules/backend-jdk-http-client/src/test/scala/com/github/andyglow/websocket/JdkPlatformSslSpec.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import org.scalatest.DoNotDiscover
99

1010
@DoNotDiscover
1111
final class JdkPlatformSslSpec extends IntegrationSpecBase {
12-
override val platform: JdkPlatform = JdkPlatform
13-
override val ssl = true
14-
override val isPingSupported = true
12+
override val platform: JdkPlatform = JdkPlatform
13+
override val ssl = true
14+
override val isPingSupported = true
1515
override val options: platform.JdkOptions = {
1616

1717
val trustAny = Array[TrustManager](new X509TrustManager() {

modules/backend-netty/src/main/scala/com/github/andyglow/websocket/AdaptNettyFuture.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private[websocket] object AdaptNettyFuture {
1111
if (f.isDone) {
1212
if (f.isSuccess) Future.successful(f.getNow) else Future.failed(f.cause())
1313
} else {
14-
val promise = Promise[T]()
14+
val promise = Promise[T]()
1515
val futureListener = new GenericFutureListener[NFuture[T]]() {
1616
override def operationComplete(future: NFuture[T]): Unit = {
1717
if (future.isSuccess) promise.success(future.getNow) else promise.failure(future.cause())

modules/backend-netty/src/main/scala/com/github/andyglow/websocket/NettyClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ trait NettyClient { this: NettyPlatform =>
6868
}
6969

7070
override def channelRead0(ctx: ChannelHandlerContext, msg: ByteBufHolder): Unit = {
71-
val ch = ctx.channel()
71+
val ch = ctx.channel()
7272
val handleControlMessages: PartialFunction[ByteBufHolder, Unit] = {
7373
// handle Close initiated by Server
7474
case _: CloseWebSocketFrame =>
@@ -219,7 +219,7 @@ trait NettyClient { this: NettyPlatform =>
219219
) extends Websocket
220220
with Websocket.AsyncImpl {
221221
override protected implicit val executionContext: ExecutionContext = ec
222-
override protected def sendAsync(x: MessageType): Future[Unit] = {
222+
override protected def sendAsync(x: MessageType): Future[Unit] = {
223223
AdaptNettyFuture(ch.writeAndFlush(x)).map { _ => () }
224224
}
225225
override protected def pingAsync(): Future[Unit] = {

0 commit comments

Comments
 (0)