Skip to content

xerial/sbt-jcheckstyle

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
sbt
 
 
 
 
 
 

sbt-jcheckstyle

A sbt plugin for checking Java code styles with checkstyle.

Usage

Maven Central

Add sbt-jcheckstyle plugin to your project/plugins.sbt, then run jcheckStyle task: project/plugins.sbt

// For sbt-0.13.x and 1.0.x
addSbtPlugin("org.xerial.sbt" % "sbt-jcheckstyle" % "(version)")
# Check code style of java codes
$ sbt jcheckStyle

# Check code style of java test codes
$ sbt test:jcheckStyle

Run style check before compilation

Add the following sbt settings:

compile in Compile <<= (compile in Compile) dependsOn (jcheckStyle in Compile)
compile in Test <<= (compile in Test) dependsOn (jcheckStyle in Test)

Style configuration

To configure Java code style, edit jcheckStyleConfig setting. In default, it uses Google's Java style:

jcheckStyleConfig := "google" // or "facebook", "sun" or path to your checkstyle.xml

Here is the list of the available styles:

Or you can specify your own configuration:

jcheckStyleConfig := "checkstyle.xml"

About

A sbt plugin for checking Java code styles

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •