Author: Xiao Pu
CheckStyle is a static analyser for Java. It can be used to assist developers in static analysis process.
CheckStyle will examine code based on different rules(or checks).
According to the checks list provided by CheckStyle, the checks(rules) can be divided into 14 sections.
As described here, there are several limitations in CheckStyle.
CheckStyle uses a configuration file to know all the rules that it is supposed to check.
CheckStyle supports suppressing warnings in four ways:
There are several ways to run CheckStyle.
Build Automation Tools:
CheckStyle will use ANTLR to parse your code into a AST(Abstract Syntax Tree) and visit it in a DFS(Depth First Search) pattern to check violations. Thus, it is necessary to make the code compilable in order for the ANTLR to work. You can view the syntax tree using CheckStyle Grammar Tree Viewer