GithubHelp home page GithubHelp logo

isabella232 / spotify-checkstyle-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spotify/spotify-checkstyle-config

0.0 0.0 0.0 75 KB

The Spotify checkstyle configuration

License: GNU Lesser General Public License v2.1

spotify-checkstyle-config's Introduction

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.

spotify-checkstyle-config's People

Contributors

pettermahlen avatar davidxia avatar mattnworb avatar rculbertson avatar caipre avatar mishako avatar backuitist avatar dflemstr avatar gilles avatar rydenius avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.