- Install giter8.
- Download & run this template.
$ cd
$ g8 ymasory/sbt-code-quality
$ cd <app name>
$ chmod u+x sbt
$ ./sbt
> checkstyle
> pmd
- Check out
target/checkstyle-report.xml
. - Check out
target/pmd-report.html
.
- Change the CLI args (
val args
) inCheckStyleSettings
andPmdSettings
inproject/build.scala
in the generated projects. See the CheckStyle CLI documentation and the PMD CLI documentation. - Tweak or replace
project/checkstyle-config.xml
andproject/pmd-ruleset.xml
in the generated project with something appropriate for your requirements. See the CheckStyle and PMD XML configuration docs.
- Why should I? Most code quality toold have a fully functional CLI interface. An sbt plugin would amount to a ton of boilerplate that replicates the CLI functionality.
- sbt is not binary compatible between versions. It hasn't even been source compatible to date. This way is easier.
- This same strategy can be used to quickly spit out new CLI-based tasks.