Skip to content

Commit

Permalink
Router: use single non-NL default split before }
Browse files Browse the repository at this point in the history
The usual NL split is forced through NB policy used with `{`.
  • Loading branch information
kitbellew committed Nov 2, 2024
1 parent 6148c42 commit 2f3830a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,9 @@ class Router(formatOps: FormatOps) {
)
}

case FormatToken(_, T.RightBrace(), _) =>
Seq(Split(xmlSpace(rightOwner), 0), Split(Newline2x(ft), 0))
case FormatToken(_, _: T.RightBrace, _) =>
Seq(Split(if (ft.hasBlankLine) Newline2x else xmlSpace(rightOwner), 0))

case FormatToken(_: T.KwPackage, _, _) if leftOwner.is[Pkg] =>
Seq(Split(Space, 0))
// Opening [ with no leading space.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ val bindingFuture = Http().bindAndHandleSync({
{
val bindingFuture = Http().bindAndHandleSync(
{ case HttpRequest(_, _, headers, _, _) ⇒
val upgrade = headers.collectFirst { case u: UpgradeToWebSocket ⇒
u
}.get
val upgrade =
headers.collectFirst { case u: UpgradeToWebSocket ⇒ u }.get
upgrade.handleMessages(
Flow.fromSinkAndSource(Sink.ignore,
Source.fromPublisher(source)),
Expand Down
5 changes: 2 additions & 3 deletions scalafmt-tests/shared/src/test/resources/unit/Apply.stat
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ new DenseMatrix(
isTranspose = !from.isTranspose)
>>>
new DenseMatrix(
data = from.data map {
_.conjugate
},
data =
from.data map { _.conjugate },
offset = from.offset,
cols = from.rows,
rows = from.cols,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions {
val explored = Debug.explored.get()
logger.debug(s"Total explored: $explored")
if (!onlyUnit && !onlyManual)
assertEquals(explored, 1487221, "total explored")
assertEquals(explored, 1486615, "total explored")
val results = debugResults.result()
// TODO(olafur) don't block printing out test results.
// I don't want to deal with scalaz's Tasks :'(
Expand Down

0 comments on commit 2f3830a

Please sign in to comment.