Skip to content

Commit

Permalink
RedundantBraces: keep braces if splice is $
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 5, 2024
1 parent 1a73b75 commit a88e8d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class RedundantBraces(implicit val ftoks: FormatTokens)
* https://github.com/scalameta/scalafmt/issues/1420)
*/
def canRemoveAroundName(name: String): Boolean = name.headOption.forall {
case '_' => false
case '_' | '$' => false
case '`' => name.length <= 1 || name.last != '`'
case _ => true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ val content = {
<<< #4456
println(s"${$}")
>>>
println(s"$$")
println(s"${$}")
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, 1497767, "total explored")
assertEquals(explored, 1497775, "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 a88e8d6

Please sign in to comment.