We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 383db25 commit f24d0d6Copy full SHA for f24d0d6
rules/scalafmt/scalafmt/ScalafmtRunner.scala
@@ -39,9 +39,14 @@ object ScalafmtRunner extends WorkerMain[Unit] {
39
format(source)
40
} catch {
41
case e @ (_: org.scalafmt.Error | _: scala.meta.parsers.ParseException) => {
42
- System.err.println(Color.Warning("Unable to format file due to bug in scalafmt"))
43
- System.err.println(Color.Warning(e.toString))
44
- source
+ if (config.runner.fatalWarnings) {
+ System.err.println(Color.Error("Exception thrown by Scalafmt and fatalWarnings is enabled"))
+ throw e
45
+ } else {
46
+ System.err.println(Color.Warning("Unable to format file due to bug in scalafmt"))
47
+ System.err.println(Color.Warning(e.toString))
48
+ source
49
+ }
50
}
51
52
0 commit comments