Is there a way for the checkstyle rule MethodLength
to set a pattern for methods to be ignored? I want to suppress the checkstyle rule for all methods named getMetaInformation()
.
Other checkstyle rules like LineLength
have the property
<property name="ignorePattern" value=""/>
but this seems not to be available for the MethodLength
rule (see http://checkstyle.sourceforge.net/apidocs/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheck.html).
Then to disable Checkstyle, you use //CHECKSTYLE:OFF and //CHECKSTYLE:ON (default values) in your code.
It is possible to suppress all the checkstyle warnings with the argument "all" . You can also use a checkstyle: prefix to prevent compiler from processing these annotations. You can also define aliases for check names that need to be suppressed.
Currently, there is no way to do this by Check config http://checkstyle.sourceforge.net/config_sizes.html#MethodLength , you need to use suppressions/filters to do this.
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