Skip to content

Commit

Permalink
Router: increase NL penalty within interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Jun 19, 2024
1 parent 1fbac8f commit db27def
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object Constants {
val BracketPenalty = 20
val ExceedColumnPenalty = 1000
// Breaking a line like s"aaaaaaa${111111 + 22222}" should be last resort.
val BreakSingleLineInterpolatedString = 10 * ExceedColumnPenalty
val BreakSingleLineInterpolatedString = 1000 * ExceedColumnPenalty
}

/** Assigns splits to format tokens.
Expand Down
9 changes: 3 additions & 6 deletions scalafmt-tests/src/test/resources/default/String.stat
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,7 @@ object a {
>>>
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x
.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
<<< #4067 avoid fold
Expand All @@ -684,8 +683,7 @@ object a {
>>>
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x
.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
<<< #4067 avoid unfold
Expand All @@ -704,7 +702,6 @@ object a {
>>>
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x
.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}

0 comments on commit db27def

Please sign in to comment.