diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala index e1f400381c..93acd832c3 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/Router.scala @@ -1564,7 +1564,7 @@ class Router(formatOps: FormatOps) { rightIsCloseDelimToAddTrailingComma(lc, nextNonComment(nextFt)) ) Seq(Split(Space, 0), Split(Newline, 1)) else Seq(Split(Newline, 0)) - case FT(_: T.Comma, right, _) if !leftOwner.is[Template] => + case FT(_: T.Comma, _, _) if !leftOwner.is[Template] => def forBinPack(binPack: BinPack.Site, callSite: Boolean) = if (binPack eq BinPack.Site.Never) None else optimizationEntities.argument.map { nextArg => diff --git a/scalafmt-tests/shared/src/test/scala/org/scalafmt/sysops/GitOpsTest.scala b/scalafmt-tests/shared/src/test/scala/org/scalafmt/sysops/GitOpsTest.scala index cb389c57d9..db04cc8278 100644 --- a/scalafmt-tests/shared/src/test/scala/org/scalafmt/sysops/GitOpsTest.scala +++ b/scalafmt-tests/shared/src/test/scala/org/scalafmt/sysops/GitOpsTest.scala @@ -28,11 +28,11 @@ class GitOpsTest extends FunSuite { override def beforeEach(context: BeforeEach): Unit = { path = AbsoluteFile(Files.createTempDirectory(dirName)) ops = new GitOpsImpl(path) - init(ops) + init // initial commit is needed initFile = touch("initialfile") - add(initFile)(ops) - commit(ops) + add(initFile) + commit } override def afterEach(context: AfterEach): Unit = @@ -341,20 +341,28 @@ private object GitOpsTest { case Success(s) => s } - def init(implicit ops: GitOpsImpl): Unit = git("init", "-b", defaultBranch) + def init(implicit ops: GitOpsImpl, loc: munit.Location): Unit = + git("init", "-b", defaultBranch) - def add(file: AbsoluteFile*)(implicit ops: GitOpsImpl): Unit = + def add( + file: AbsoluteFile*, + )(implicit ops: GitOpsImpl, loc: munit.Location): Unit = git("add", file.map(_.toString()): _*) - def rm(file: AbsoluteFile*)(implicit ops: GitOpsImpl): Unit = + def rm( + file: AbsoluteFile*, + )(implicit ops: GitOpsImpl, loc: munit.Location): Unit = git("rm", file.map(_.toString()): _*) - def commit(implicit ops: GitOpsImpl): Unit = + def commit(implicit ops: GitOpsImpl, loc: munit.Location): Unit = git("commit", "-m", "'some-message'") - def checkout(br: String)(implicit ops: GitOpsImpl): Unit = - git("checkout", "$br") + def checkout( + br: String, + )(implicit ops: GitOpsImpl, loc: munit.Location): Unit = git("checkout", br) - def checkoutBr(newBr: String)(implicit ops: GitOpsImpl): Unit = - git("checkout", "-b", "$newBr") + def checkoutBr( + newBr: String, + )(implicit ops: GitOpsImpl, loc: munit.Location): Unit = + git("checkout", "-b", newBr) }