Closed RishatShamsutdinov closed 11 years ago
This is great. For the documentation could you give me a use case?
Yep. We have a strong rules for code style and before pushing to the git repo we have to run something likes this: sbt compile && sbt scalastyle && git push
Cool. Thanks.
Sorry basic question - How do I use this key in my build.sbt
?
Currently I just have one line: org.scalastyle.sbt.ScalastylePlugin.Settings
Also is it possible to make the compile
task depend on scalstyle
? That way I can just always use compile
and know that compilation will fail if I violated our style guide?
Build.scala
example:
val scalaStyleSettings = org.scalastyle.sbt.ScalastylePlugin.Settings
val sCompile = InputKey[Unit]("scompile") in Compile
val buildSettings = Defaults.defaultSettings ++ scalaStyleSettings ++ ... ++ Seq(
sCompile <<= org.scalastyle.sbt.PluginKeys.scalastyle dependsOn (compile in Compile)
)
scompile
will fail if you violated your style guide.
fail on error logic (need for
compile && scalastyle
tasks)