Repository: scala-steward-org/scala-steward
Pull request #2425 (2021-12-23 21:33:32)

Do not run scalafmt with `--quiet`
This partially reverts #2321.

The `--quiet` option also suppresses helpful error messages:
```
$ scalafmt --non-interactive --quiet

$ scalafmt --non-interactive
Invalid config: Default dialect is deprecated; use explicit: [sbt0137,sbt1,scala211,scala212,scala212source3,scala213,scala213source3,scala3]
Also see https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects"
: ~/.scalafmt.conf
```
Which means we currently get unhelpful error messages like this:
```
[info] 2021-12-23 16:34:31,733 WARN  Reformatting changed files failed
[info] java.io.IOException: 'scalafmt --non-interactive --quiet --mode changed' exited with code 8
[info] 	at org.scalasteward.core.io.process$.$anonfun$slurp$9(process.scala:54)
```

With this change, the above exception will contain the message about the
invalid config.


Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/scalafmt/ScalafmtAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/scalafmt/ScalafmtAlg.scala
index c509e3af..10d4f3d7 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/scalafmt/ScalafmtAlg.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/scalafmt/ScalafmtAlg.scala
@@ -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
   }
 
@@ -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 {
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index a013d664..7e42840c 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -29,7 +29,7 @@ object Dependencies {
   val http4sBlazeServer = "org.http4s" %% "http4s-blaze-server" % http4sCore.revision
   val http4sOkhttpClient = "org.http4s" %% "http4s-okhttp-client" % http4sCore.revision
   val log4catsSlf4j = "org.typelevel" %% "log4cats-slf4j" % "2.1.1"
-  val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.10"
+  val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.9"
   val jjwtApi = "io.jsonwebtoken" % "jjwt-api" % "0.11.2"
   val jjwtImpl = "io.jsonwebtoken" % "jjwt-impl" % jjwtApi.revision
   val jjwtJackson = "io.jsonwebtoken" % "jjwt-jackson" % jjwtApi.revision


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/edit/EditAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/edit/EditAlgTest.scala
index 792064af..6e68f87a 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/edit/EditAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/edit/EditAlgTest.scala
@@ -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))
       ),
diff --git a/modules/core/src/test/scala/org/scalasteward/core/edit/hooks/HookExecutorTest.scala b/modules/core/src/test/scala/org/scalasteward/core/edit/hooks/HookExecutorTest.scala
index f77f07a9..f0f0c707 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/edit/hooks/HookExecutorTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/edit/hooks/HookExecutorTest.scala
@@ -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),