scala - make sbt build fail on scalastyle warnings -


i'm enforcing scalastyle check code space, referring http://www.scalastyle.org/sbt.html.

in 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 

in project/plugins.sbt:

addsbtplugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") 

when run sbt compile, scalastyle generating [warning] ***./utils/configmanager.scala: file must end newline character, compile still succeeded.

is there way make sbt compile fail on scalastyle warnings?

i change <check level="warning" ...> <check level="error" ...> in scalastylegenerateconfig, i'm not sure right way it.

thanks lot

there 2 simple options can think of.

the obvious 1 change scalastyle config warnings want cause build failure errors. that's scalastyle config for. if want treated error, call one! <check level="error" ...> give least amount of headache.

otherwise, simple way promote warning error in sbt use -xfatal-warnings flag:

scalacoptions ++= seq("-xfatal-warnings") 

but convert all warnings in project errors, scalastyle or not.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -