Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.

Checkstyle is a tool that ensures adherence to a code standard or a set of best practices.
[![][circleci img]][circleci]
[![][cirrusci img]][cirrusci]
[![][snyk img]][snyk]
[![][semaphoreci img]][semaphoreci]
[![][azure img]][azure]
[![][error prone img]][error prone]
[![][qodana img]][qodana]
[![][pitest img]][pitest]
[![][checker framework img]][checker framework]
[![][dependabot img]][dependabot]
[![][release notes/version img]][release notes/version]
[![][closed issues img]][closed issues]
[![][link check img]][link check]
[![][milestone img]][milestone]
[![][buildkite img]][buildkite]
The latest release version can be found at GitHub releases or at Maven repo.
Documentation is available in HTML format, see [Checkstyle checks][checks-docs].
The latest deployed website from master is available [here][site-latest].
$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="FallThrough"/>
</module>
</module>
$ cat Test.java
class Test {
public void foo() {
int i = 0;
while (i >= 0) {
switch (i) {
case 1:
case 2:
i++;
case 3: // violation 'fall from previous branch of the switch'
i++;
}
}
}
}
$ java -jar checkstyle-10.18.1-all.jar -c config.xml Test.java
Starting audit...
[ERROR] Test.java:9:9: Fall through from previous branch of switch statement [FallThrough]
Audit done.
Checkstyle ends with 1 errors.
Thanks for your interest in contributing to CheckStyle! Please see the Contribution Guidelines for information on how to contribute to the project. This includes creating issues, submitting pull requests, and setting up your development environment.
Please see the [Build Instructions][build-instructions] for information on how to build the project.
Take a look at our javadoc to see our API documentation.
Checkstyle is an open-source project that is developed and maintained by volunteers. If you find Checkstyle useful, please consider sponsoring the project. Your support helps us to maintain and improve Checkstyle.
[![][backers.opencollective img]][backers.opencollective]
[![][sponsors.opencollective img]][sponsors.opencollective]
Checkstyle is licensed under the GNU LGPL v2.1 License. Checkstyle uses libraries:
Migrate JSR-305 annotations to JSpecify
https://github.com/checkstyle/checkstyle/issues/23278
Labels: approved
Feature request: Add validation for orphaned violation comments in test input files
https://github.com/checkstyle/checkstyle/issues/23277
Labels: 없음
Remove warning 'No SLF4J providers were found' from output
https://github.com/checkstyle/checkstyle/issues/23275
Labels: approved
MissingNullCaseInSwitch: false negative when case label is a text block
https://github.com/checkstyle/checkstyle/issues/23274
Labels: 없음
Remove warning 'sun.misc.Signal is internal proprietary API and may be removed in a future release'
https://github.com/checkstyle/checkstyle/issues/23268
Labels: approved
ArchUnit: Enforce state-reset validation for AbstractJavadocCheck subclasses
https://github.com/checkstyle/checkstyle/issues/23258
Labels: 없음

This guide serves to set clear expectations for everyone involved with the project so that we can improve it together while also creating a welcoming space for everyone to participate. Following these guidelines will help ensure a positive experience for contributors and maintainers alike.
:octocat: Thanks for your interest in contributing to CheckStyle! :octocat:
This project and everyone participating in it is governed by the CheckStyle Code of Conduct.
mvn clean verify should pass on your local before
submitting a pull request.Every commit message is a single line of text, no longer than 200 characters, and
it must not end with a period, a space, or a tab. The commit must not have a body
or trailers (like Co-Authored-By:), as the message is validated by
CommitValidationTest. Start the message with one of the accepted prefixes,
followed by a space and a brief description of the change. Write the description
in the imperative form ("Add", "Fix", "Remove", "Update") and keep it specific,
so a reader understands the change without opening the pull request.
A change that fixes a defect or changes behaviour must reference its issue, so
the change is picked up by the release notes. Never use minor: for a defect.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult the [GitHub Help][github-help-pr-reviews] for more information on pull request reviews.
Here are some general guidelines to follow when submitting a pull request:
A great way to contribute to the project is to create a detailed issue when you encounter a problem or would like to suggest a feature. We always appreciate a well-written, thorough issue description. :brain:
Some points to consider when opening an issue: