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
JavaLGPL-2.1Created 2013-08-31checkstyle.org
下载:checkstyle-14.4.0checkstyle-14.4.0 ↓14.4.02026-10-31
+9
日增长
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 Ch

Top issues

Discussions

Latest release

checkstyle-14.4.0 checkstyle-14.4.0 2026-10-31
Checkstyle 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

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON