This project provides an SBT 0.13+ plugin for running Checkstyle over Java source files. For more information about Checkstyle, see http://checkstyle.sourceforge.net/
This plugin uses version 5.5 of Checkstyle.
This is a fork of the sbt-code-quality project found here.
Add the following lines to project/plugins.sbt
addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % "0.4.0")
Then add the following line to build.sbt
:
com.etsy.sbt.Checkstyle.checkstyleSettings
You can run Checkstyle over your Java source files with the
checkstyle
task. You can run Checkstyle over your Java tests with
the test:checkstyle
task.
The Checkstyle configuration file is ./checkstyle-config.xml
by
default. This can be changed by setting the value of
checkstyleConfig
. By default test:checkstyle
uses the same
configuration file, but this can be changed by setting the value of
checkstyleConfig in Test
.
The Checkstyle report is output to target/checkstyle-report.xml
by
default. This can be changed by setting the value of
checkstyleTarget
. test:checkstyle
outputs to
target/checkstyle-test-report.xml
, but this can be changed by
setting the value of checkstyleTarget in Test
.