Skip to content

Commit

Permalink
Merge pull request #2425 from scala-steward-org/topic/scalafmt-rm-quiet
Browse files Browse the repository at this point in the history
Do not run scalafmt with `--quiet`
  • Loading branch information
fthomas authored Dec 23, 2021
2 parents f58817c + 850132e commit b864c78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class ScalafmtAlg[F[_]](config: Config)(implicit
.value

def reformatChanged(repo: Repo): F[Unit] = {
val cmd = Nel.of(scalafmtBinary, opts.nonInteractive, opts.quiet) ++ opts.modeChanged
val cmd = Nel.of(scalafmtBinary, opts.nonInteractive) ++ opts.modeChanged
workspaceAlg.repoDir(repo).flatMap(processAlg.exec(cmd, _)).void
}

Expand All @@ -66,12 +66,11 @@ object ScalafmtAlg {
object opts {
val modeChanged = List("--mode", "changed")
val nonInteractive = "--non-interactive"
val quiet = "--quiet"
val version = "--version"
}

val postUpdateHookCommand: Nel[String] =
Nel.of(scalafmtBinary, opts.nonInteractive, opts.quiet)
Nel.of(scalafmtBinary, opts.nonInteractive)

private[scalafmt] def parseScalafmtConf(s: String): Either[ParsingFailure, Option[Version]] =
io.circe.config.parser.parse(s).map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ class EditAlgTest extends FunSuite {
Cmd("read", scalafmtConf.pathAsString),
Cmd("write", scalafmtConf.pathAsString),
Cmd(
"VAR1=val1" :: "VAR2=val2" :: repoDir.toString ::
scalafmtBinary :: opts.nonInteractive :: opts.quiet :: opts.modeChanged
"VAR1=val1" :: "VAR2=val2" :: repoDir.toString :: scalafmtBinary :: opts.nonInteractive :: opts.modeChanged
),
Cmd(gitStatus(repoDir)),
Log("Executing post-update hook for org.scalameta:scalafmt-core"),
Cmd(
"VAR1=val1" :: "VAR2=val2" :: repoDir.toString ::
scalafmtBinary :: opts.nonInteractive :: opts.quiet :: Nil
"VAR1=val1" :: "VAR2=val2" :: repoDir.toString :: scalafmtBinary :: opts.nonInteractive :: Nil
),
Cmd(gitStatus(repoDir))
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class HookExecutorTest extends CatsEffectSuite {
trace = Vector(
Log("Executing post-update hook for org.scalameta:scalafmt-core"),
Cmd(
"VAR1=val1" :: "VAR2=val2" :: repoDir.toString ::
scalafmtBinary :: opts.nonInteractive :: opts.quiet :: Nil
"VAR1=val1" :: "VAR2=val2" :: repoDir.toString :: scalafmtBinary :: opts.nonInteractive :: Nil
),
Cmd(
gitCmd(repoDir),
Expand Down

0 comments on commit b864c78

Please sign in to comment.