checkstyle /checkstyle
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.
★ 9,657⑂ 4,411👁 217⑃ 15,999● 6,656▤ 197
+9
Daily
9,657
stars
4,411
forks
217
watchers
15,999
prs
6,656
issues
197
releases
README
Checkstyle - Java Code Quality Tool
!
--------------------------
Checkstyle is a tool that ensures adherence to a code standard or a set of best practices.
[![][appveyor img]][appveyor]
[![][circleci img]][circleci]
[![][cirrusci img]][cirrusci]
[![][coverage img]][coverage]
[![][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]
[![][mavenbadge img]][mavenbadge]
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].
Table of Contents
- Quick Start
- Contributing
- Feedback and Support
- Javadoc
- Sponsor Checkstyle
- Licensing
Quick Start
- Download our Latest Release from GitHub
or add Checkstyle to your build from [Maven Central][maven-central].
- Read our Documentation for usage
and configuration.
bash
$ cat config.xml
$ 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.
Contributing
Thanks for your interest in contributing to CheckStyle! Please see the
[Contribution Guidelines][contributing-guidelines] for information on how to contribute to the
project. This includes creating issues, submitting pull requests, and setting up your development
environment.
[contributing-guidelines]:
https://github.com/checkstyle/checkstyle/blob/master/.github/CONTRIBUTING.md
Build Instructions
Please see the [Build Instructions][build-instructions] for
information on how to build the project.
Feedback and Support
- Visit our Discussions Page, where you
can ask questions and discuss the project with other users and contributors. This is our
preferred method of communication for topics
like usage and configuration questions, debugging, and other feedback.
- Stack Overflow is another place to
ask questions about Checkstyle usage.
- If you are interested in contributing to the project, you can join our
Discord Contributors Chat
with invite link.
- Our Google Groups Forum is a
mailing list for discussion and support; however, we may be slow to respond there.
Javadoc
Take a look at our javadoc to see
our API documentation.
Sponsor ChTop issues
#21861Migrate XpathRegression tests to verifyXpathWithInlineConfigParser and remove suppressions113 comments · 2026-10-09#11163Enforce file size on Java inputs110 comments · 2022-01-07#10924All checks that use `AbstractCheck#getLine()` should check code points instead of characters for spacing56 comments · 2021-11-04#18273Closing asterisk */ not on its own line not detected for google style32 comments · 2025-12-10#14124No nested "class" import31 comments · 2023-12-08#11087New check ChainedMethodCallWrap31 comments · 2021-12-21#16100JEP 467: Support Markdown JavaDoc comments29 comments · 2024-12-31#8884MetadataGeneratorUtilTest is modifying files in the main folder for Windows hosts28 comments · 2020-10-09
Discussions
#22697Guidance on contribution workflow for open PRs and reported issues2 comments · 2026-11-12#22438Looking for issues to work on1 comments · 2026-11-04#21807Proposal: AvoidModuleImport check to disallow `import module` declarations (JEP 511)1 comments · 2026-10-04#21302MainFrameTest causing a JVM crash on fedora linux1 comments · 2026-08-21#21214Checkstyle takes forever - Any changes in 10.22.0?1 comments · 2026-08-14#20352Some of CONTRIBUTING.MD is redundant?2 comments · 2026-06-15#20316Issue: Semaphore Checkstyle CI pipeline failures1 comments · 2026-06-11#19663Are We Using ```mvn checkstyle:check``` in Our Build Process?1 comments · 2026-04-09
Latest release
checkstyle-14.4.0 checkstyle-14.4.0 2026-10-31Checkstyle 14.4.0 - https://checkstyle.org/releasenotes.htmlRelease_14.4.0 New: 21890 - New property for JavadocUtilizingTrailingSpace validateOnlyJoinableLines to report a line only when the whole next line fits on it. 20970 - JavadocLeadingAsteriskAlign: Add indentation property. 12226 - LeftCurly: new option nl_or_singleline to allow single-line blocks in otherwise Allman-style code. 21813 - New property for JavadocUtilizingTrailingSpace ignoreTooShortPattern to allow skip utilization if line ends with punctuation symbol. 18437 - EmptyLineSeparatorCheck does not report violatio