Checkstyle – enforce Java coding standards

Checkstyle is a static analysis tool that helps Java developers enforce consistent coding standards. It examines source files for violations of configurable rules covering formatting, naming conventions, documentation, class structure and common coding practices.

The software is particularly useful for teams working on large Java projects, where consistent coding standards improve readability and make code reviews easier. Rather than enforcing a single preferred style, Checkstyle lets developers choose which rules apply and adjust their settings.

Checkstyle can use established conventions such as Google Java Style, Sun Code Conventions and OpenJDK style, or a completely customised configuration. Its checks operate on Java source code and complement tools that perform more extensive semantic or whole-program analysis.

This is free and open source software.

Key Features

  • Checks Java source code against configurable coding standards and best practices.
  • Validates naming conventions for classes, methods, fields, parameters and constants.
  • Enforces formatting rules covering indentation, whitespace, braces and line lengths.
  • Detects unused, duplicate, illegal and incorrectly ordered import statements.
  • Checks Javadoc comments for required documentation, formatting and structural problems.
  • Identifies class and method design issues, including visibility, inheritance and declaration rules.
  • Provides checks for coding practices involving control flow, modifiers and unnecessary constructs.
  • Supports code complexity and size measurements.
  • Includes configurations based on Google, Sun and OpenJDK Java coding standards.
  • XML configuration allows individual checks and their properties to be customised.
  • Supports suppression filters for excluding selected files, warnings or code sections.
  • Provides extensibility through custom checks, filters and reporting listeners.
  • Integrates with Maven, Gradle, Ant and popular Java development environments.
  • Cross-platform support – runs on Linux and Windows.

Website: github.com/checkstyle/checkstyle
Support:
Developer: Checkstyle
License: GNU Lesser General Public License v2.1

Checkstyle is written in Java. Learn Java with our recommended free books and free tutorials.


Related Software

Java Linter Tools
SpotBugsFind bugs in Java code
PMDExtensible cross-language static code analyzer
Error ProneCatch common Java mistakes
NullAwayEliminate NPEs in Java code
InferStatic analysis tool for Java, C++, Objective-C, and C
CheckstyleWrite Java code that adheres to a coding standard
Checker FrameworkPluggable type-checking for Java

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted