Is it possible to run an sbt build and disable Scalastyle for just this run, using a command line argument?
I'm thinking of something similar to Checkstyle's (with Maven) -Dcheckstyle.skip=true
, but cannot seem to find anything similar in the Scalastyle documentation.
Update - sbt & scalastyle config:
Scalastyle config in build.sbt:
// add scalastyle to compile task
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := scalastyle.in(Compile).toTask("").value
(compile in Compile) := ((compile in Compile) dependsOn compileScalastyle).value
// add scalastyle to test task
lazy val testScalastyle = taskKey[Unit]("testScalastyle")
testScalastyle := scalastyle.in(Test).toTask("").value
(test in Test) := ((test in Test) dependsOn testScalastyle).value
(scalastyleConfig in Test) := baseDirectory.value / "scalastyle-test-config.xml"
scalastyle-config.xml (and scalastyle-test-config.xml):
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE scalastyle [
<!ENTITY baseRules SYSTEM "scalastyle-base-rules.xml">
]>
<scalastyle>
<name>Scalastyle standard configuration</name>
<!-- <check> elements, omitted for brevity -->
</scalastyle>