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
- Host: GitHub
- URL: https://github.com/ksprojects/java-code-style
- Owner: ksprojects
- License: apache-2.0
- Created: 2017-04-02T18:38:52.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-09T11:47:21.000Z (about 9 years ago)
- Last Synced: 2025-07-22T19:48:10.550Z (11 months ago)
- Topics: checkstyle, java
- Size: 64.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.