Spotify Checkstyle Config

Checkstyle configuration corresponding to Spotify's coding conventions.

License

License

Categories

Categories

Checkstyle Application Testing & Monitoring Code Analysis config Application Layer Libs Configuration
GroupId

GroupId

com.spotify.checkstyle
ArtifactId

ArtifactId

spotify-checkstyle-config
Last Version

Last Version

1.0.11
Release Date

Release Date

Type

Type

jar
Description

Description

Spotify Checkstyle Config
Checkstyle configuration corresponding to Spotify's coding conventions.
Project URL

Project URL

https://github.com/spotify/spotify-checkstyle-config
Source Code Management

Source Code Management

https://github.com/spotify/spotify-checkstyle-config

Download spotify-checkstyle-config

How to add to project

<!-- https://jarcasting.com/artifacts/com.spotify.checkstyle/spotify-checkstyle-config/ -->
<dependency>
    <groupId>com.spotify.checkstyle</groupId>
    <artifactId>spotify-checkstyle-config</artifactId>
    <version>1.0.11</version>
</dependency>
// https://jarcasting.com/artifacts/com.spotify.checkstyle/spotify-checkstyle-config/
implementation 'com.spotify.checkstyle:spotify-checkstyle-config:1.0.11'
// https://jarcasting.com/artifacts/com.spotify.checkstyle/spotify-checkstyle-config/
implementation ("com.spotify.checkstyle:spotify-checkstyle-config:1.0.11")
'com.spotify.checkstyle:spotify-checkstyle-config:jar:1.0.11'
<dependency org="com.spotify.checkstyle" name="spotify-checkstyle-config" rev="1.0.11">
  <artifact name="spotify-checkstyle-config" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.spotify.checkstyle', module='spotify-checkstyle-config', version='1.0.11')
)
libraryDependencies += "com.spotify.checkstyle" % "spotify-checkstyle-config" % "1.0.11"
[com.spotify.checkstyle/spotify-checkstyle-config "1.0.11"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Spotify Checkstyle Configuration

Maven Central License

This project provides a default configuration for checkstyle at Spotify.

To use it, configure your maven-checkstyle-plugin like so:

   <plugin>
     <artifactId>maven-checkstyle-plugin</artifactId>
     <version>2.17</version>
     <dependencies>
       <dependency>
         <groupId>com.spotify.checkstyle</groupId>
         <artifactId>spotify-checkstyle-config</artifactId>
         <version>LATEST-VERSION</version>
       </dependency>
       <dependency>
         <groupId>com.puppycrawl.tools</groupId>
         <artifactId>checkstyle</artifactId>
         <version>8.24</version>
       </dependency>
     </dependencies>
     <configuration>
       <configLocation>spotify_checks.xml</configLocation>
       
       <!-- The following parameters are optional: -->
       <consoleOutput>true</consoleOutput>
       <failOnViolation>true</failOnViolation>
       <logViolationsToConsole>true</logViolationsToConsole>
       <violationSeverity>error</violationSeverity>
     </configuration>
     <executions>
       <execution>
         <id>validate</id>
         <phase>validate</phase>
         <goals>
           <goal>check</goal>
         </goals>
       </execution>
     </executions>
   </plugin>

See the maven-checkstyle-plugin docs for more information about what the configuration parameters mean.

Internally, we have the above configuration in the <pluginManagement/> section of a company-wide parent pom, meaning that projects only need to specify the below in their <build><plugins> section:

   <plugin>
      <artifactId>maven-checkstyle-plugin</artifactId>
   </plugin>

Configuration

Suppressions

The configuration of the checkstyle plugin you get from spotify_checks.xml tells it to optionally look for a file named suppressions.xml as per the SuppressionFilter docs. This means you can configure suppressions by providing such a file on your project's classpath or in the current directory where you build it - note that for multi-module projects, it's probably a good idea to use something like this solution to share the configuration among each sub-module.

IDEA support

There is a configuration file for IntelliJ IDEA that you can import into your project.

Code of conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

com.spotify.checkstyle

Spotify

Versions

Version
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0