How to disable checkstyle JavaDoc validation for constructors?
I see that http://checkstyle.sourceforge.net/config_javadoc.html#JavadocMethod states clearly that it "Checks the Javadoc of a method or constructor", however I need to exclude constructors and leave only methods.
In order to ignore constructors, remove the CTOR_DEF
token from the tokens
property, for example:
<module name="JavadocMethod">
<property name="tokens" value="METHOD_DEF,ANNOTATION_FIELD_DEF"/>
</module>
This is achieved by setting tokens
to all the other allowed tokens except CTOR_DEF
. Unfortunately, for this to work, you need to know which tokens to set, and this list varies by Checkstyle version and is not always accurately reflected in the docs. This above example should provide a reasonable setting.