checkstyle-extension

Additional Checkstyle checks

Check Description
LicenseComment Checks that Java source files start with a comment with a properly formatted license.
NoBlankLineAfterSymbols Checks that lines containing only specific symbols are not followed by a blank line.
NoBlankLineBeforeSymbols Checks that lines containing only specific symbols are not preceded by a blank line.
NoSubsequentBlankLines Checks that there are no occurrences of two or more blank lines in a row.
NoTrailingWhitespace Checks that lines have no trailing whitespace.

Maven integration

Add a dependency to your existing maven-checkstyle-plugin definition. For instance:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-checkstyle-plugin</artifactId>
  <version>...</version>
  <configuration>
    ...
  </configuration>
  <dependencies>
    <dependency>
      <groupId>com.puppycrawl.tools</groupId>
      <artifactId>checkstyle</artifactId>
      <version>...</version>
    </dependency>
    <dependency>
      <groupId>com.github.robtimus</groupId>
      <artifactId>checkstyle-extension</artifactId>
      <version>...</version>
    </dependency>
  </dependencies>
  <executions>
    ...
  </executions>
</plugin>

Eclipse integration

Download the latest JAR file from Maven Central or the GitHub release page, copy it to Eclipse's dropins folder, and restart Eclipse.

IntelliJ integration

First, make sure that you have the CheckStyle-IDEA plugin installed. Next, download the latest JAR file from Maven Central or the GitHub release page. Finally, configure IntelliJ to include it as part of its third-party checks:

  • Open Settings...
  • Open the Checkstyle settings
  • Add the JAR under the Third-Party Checks section