Checkstyle rules are configured in a small but important hierarchy. Checker is at the top, one of his “children” is Treewalker , etc. Properties can be defined for individual checks, but also for these “parent checks”. So your standard Checkstyle configuration file looks like this:
<module name="Checker"> <property name="severity" value="warning"/> <module name="TreeWalker"> <property name="tabWidth" value="4"/> <module name="JavadocMethod"> <property name="scope" value="public"/> </module> </module> </module>
As you can see, there is a severity property for Checker , the topmost module. If the check is somewhere lower in the hierarchy, its rigidity is set to inherit (which is the same as not setting anything), then in this example its severity will be warning .
source share