An open API service indexing awesome lists of open source software.

https://github.com/ksprojects/java-code-style

Checkstyle rules for Java projects
https://github.com/ksprojects/java-code-style

checkstyle java

Last synced: 8 months ago
JSON representation

Checkstyle rules for Java projects

Awesome Lists containing this project

README

          

# Checkstyle rules for Java projects

## Usage

When you add checkstyle plugin to your project, build should fail
if at lease one rule is violated.

### Gradle

```groovy
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ksprojects:java-code-style:1.2'
}
}

apply plugin: 'checkstyle'
checkstyle {
config = resources.text.fromString(getClass().getResource("checkstyle.xml").text)
toolVersion = '7.6.1'
// Exclude generated code from Checkstyle checks
checkstyleMain.source = "src/main/java"
checkstyleTest.source = "src/test/java"
}
```

### Maven

```xml



org.apache.maven.plugins
maven-checkstyle-plugin
2.17


validate
validate

checkstyle.xml
UTF-8
true
true


${project.basedir}/src/main/java


${project.basedir}/src/test/java



check





com.puppycrawl.tools
checkstyle
7.6.1


org.ksprojects
java-code-style
1.2



```

### Usage Examples

1. [Protobuf Plugin for JetBrains IDEs](https://github.com/protostuff/protobuf-jetbrains-plugin) - gradle.
2. [Java code and documentation generator for Protobuf](https://github.com/protostuff/protostuff-compiler)- maven.
3. [ZooKeeper copy utility](https://github.com/ksprojects/zkcopy) - maven.