diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/scalafmt-example/build/build.scala | 12 | ||||
-rw-r--r-- | examples/scalariform-example/build/build.scala | 12 |
2 files changed, 8 insertions, 16 deletions
diff --git a/examples/scalafmt-example/build/build.scala b/examples/scalafmt-example/build/build.scala index 6f77108..a489616 100644 --- a/examples/scalafmt-example/build/build.scala +++ b/examples/scalafmt-example/build/build.scala @@ -15,14 +15,10 @@ class Build(val context: Context) extends BuildBuild with Scalafmt { import scala.collection.JavaConverters._ val utf8 = Charset.forName("UTF-8") sourceFiles foreach { file => - try { - val path = file.toPath - val fileLines = Files.readAllLines(path, utf8).asScala - val brokenLines = fileLines map (_.dropWhile(_ ==' ')) - Files.write(path, brokenLines.asJava, utf8) - } catch { - case e: Exception => System.err.print(s"Error happend when breaking formatting: ${e}") - } + val path = file.toPath + val fileLines = Files.readAllLines(path, utf8).asScala + val brokenLines = fileLines map (_.dropWhile(_ == ' ')) + Files.write(path, brokenLines.asJava, utf8) } System.err.println("Done breaking formatting") } diff --git a/examples/scalariform-example/build/build.scala b/examples/scalariform-example/build/build.scala index 5f7b7ff..91ff67a 100644 --- a/examples/scalariform-example/build/build.scala +++ b/examples/scalariform-example/build/build.scala @@ -19,14 +19,10 @@ class Build(val context: Context) extends BaseBuild with Scalariform { import scala.collection.JavaConverters._ val utf8 = Charset.forName("UTF-8") sourceFiles foreach { file => - try { - val path = file.toPath - val fileLines = Files.readAllLines(path, utf8).asScala - val brokenLines = fileLines map (_.dropWhile(_ ==' ')) - Files.write(path, brokenLines.asJava, utf8) - } catch { - case e: Exception => System.err.print(s"Error happend when breaking formatting: ${e}") - } + val path = file.toPath + val fileLines = Files.readAllLines(path, utf8).asScala + val brokenLines = fileLines map (_.dropWhile(_ == ' ')) + Files.write(path, brokenLines.asJava, utf8) } System.err.println("Done breaking formatting") } |