What actuallly does severity level set as "inherit" mean in a checkstyle rule?
tried googling a lot couldn't find an actual definition for this-
To view to violation report, go to Window -> Show View -> Other, and search for Checkstyle. Options for Violations and Violations Chart should be displayed.
Checkstyle is a development tool to help programmers to write Java code that sticks to a coding standard. It automates the process of checking Java code. It is an open-source tool that checks code against a configurable set of rules. It allows you to define your own set of rules and check your code against it.
Right click on the java file in Package Explorer or whatever, and select 'Apply Checkstyle Corrections'. Click on the error in the problems view, and select 'Quick fix'. This corrects the problem.
The Checkstyle rules are configured in a small, but important hierarchy. Checker
is at the top, one of its "children" is Treewalker
, and so on. Properties can be defined for individual checks, but also for these "parent checks". Thus, your run-of-the-mill Checkstyle configuration file looks like this:
<module name="Checker">
<property name="severity" value="warning"/> <!-- NOTE THIS -->
<module name="TreeWalker">
<property name="tabWidth" value="4"/>
<module name="JavadocMethod">
<property name="scope" value="public"/>
</module>
<!-- and so on -->
</module>
<!-- and so on -->
</module>
As you can see, there is the severity
property of Checker
, the topmost module. If a check somewhere lower in the hierarchy has its severity set to inherit
(which is the same as not setting anything), then its severity will be, in this example, warning
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With