http://www.scalastyle.org/sbt.htmlを参照して、コード空間に scalastyle チェックを適用しています。
build.sbt:
// scalastyle check
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value
(compile in Compile) <<= (compile in Compile) dependsOn compileScalastyle
project/plugins.sbt:
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
実行するsbt compile
と、scalastyle は生成されます[warning] ***./utils/ConfigManager.scala: File must end with newline character
が、コンパイルは成功します。
sbt compile
scalastyle の警告で失敗する方法はありますか?
すべて<check level="warning" ...>
を に変更するだけです。これが正しい方法かどうかはわかりません<check level="error" ...>
。scalastyleGenerateConfig
どうもありがとう