Skip to content

Commit

Permalink
Merge pull request etsy#9 from JosephEarl/update-checkstyle-6.13
Browse files Browse the repository at this point in the history
Updates Checkstyle to 6.13
  • Loading branch information
ajsquared committed Nov 30, 2015
2 parents d981f37 + 5512edb commit cdc115f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a fork of the sbt-code-quality project found

## Setup

Add the following lines to `project/plugins.sbt`
Add the following lines to `project/plugins.sbt`:

```scala
addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % "0.5.2")
Expand Down Expand Up @@ -47,11 +47,22 @@ com.etsy.sbt.Checkstyle.CheckstyleTasks.checkstyleConfig := file("checkstyle-con
```

### XSLT Transformations

The `xsltTransformations` setting allows applying XSLT transformations to the XML report generated by Checkstyle. For instance, this could be used to generate a more readable HTML report. This setting takes values of `Option[Set[XSLTSettings]]`, so multiple transformations can be applied.

You can set `xsltTransformations` like so in `build.sbt`:
```scala
xsltTransformations := {
Some(Set(XSLTSettings(baseDirectory(_ / "checkstyle-noframes.xml").value, target(_ / "checkstyle-report.html").value)))
}
```
```

### Upgrading Checkstyle version

SBT Checkstyle plugin comes with a default Checkstyle version: for sbt-checkstyle-plugin 0.5.2, Checkstyle 6.13 is used by default.

Provided the new Checkstyle version is compatible, you can override the version used at runtime in your `project/plugins.sbt`:

```scala
dependencyOverrides += "com.puppycrawl.tools" % "checkstyle" % "6.13"
```
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ organization := "com.etsy"

version := "0.5.2-SNAPSHOT"

scalaVersion := "2.10.4"

libraryDependencies ++= Seq(
"com.puppycrawl.tools" % "checkstyle" % "6.5",
"com.puppycrawl.tools" % "checkstyle" % "6.13",
"net.sf.saxon" % "Saxon-HE" % "9.6.0-5",
"org.scalatest" %% "scalatest" % "2.2.1" % "test",
"org.scalatest" % "scalatest_2.10" % "2.2.1" % "test",
"junit" % "junit" % "4.11" % "test",
"com.github.stefanbirkner" % "system-rules" % "1.6.0" % "test"
)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/etsy/sbt/Checkstyle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object Checkstyle extends Plugin {
// Thus we wrap the call to it with a special security policy
// that forbids exiting the JVM
noExit {
CheckstyleMain(checkstyleArgs)
CheckstyleMain(checkstyleArgs:_*)
}

xsltTransformations.value match {
Expand Down

0 comments on commit cdc115f

Please sign in to comment.