JavadocMethod: require on protected and package

Also:
* warn about unused @throws tags
* skip basic setters and getters
This commit is contained in:
Paul Campbell 2016-09-05 07:22:33 +01:00
parent ee9753c9bb
commit d82ef2337e
2 changed files with 4 additions and 8 deletions

View file

@ -1229,13 +1229,7 @@ interface Foo {
#### [JavadocMethod](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocMethod) #### [JavadocMethod](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocMethod)
Checks that all public methods have a Javadoc block. Checks that all public, protected and package methods have a Javadoc block, that all `@throws` tags are used. Basic setters and getters do not require javadoc.
> TODO: scope = private (reset to default) - will require lots of new javadoc blocks
> TODO: validateThrows = true
> TODO: allowMissingPropertyJavadoc = true
#### [JavadocPackage](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage) #### [JavadocPackage](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage)

View file

@ -98,7 +98,9 @@
<module name="InterfaceIsType"/> <!-- interface must define method not just constants --> <module name="InterfaceIsType"/> <!-- interface must define method not just constants -->
<module name="JavadocMethod"> <!-- methods should have javadoc block --> <module name="JavadocMethod"> <!-- methods should have javadoc block -->
<property name="scope" value="public"/> <!-- if they are public --> <property name="scope" value="package"/> <!-- if they are public, protected or package -->
<property name="validateThrows" value="true"/> <!-- warn about unused @throws tags -->
<property name="allowMissingPropertyJavadoc" value="true"/> <!-- skip basic setters and getters -->
</module> </module>
<module name="JavadocParagraph"/> <!-- javadoc paragraphs have opening <p> elements --> <module name="JavadocParagraph"/> <!-- javadoc paragraphs have opening <p> elements -->
<module name="JavadocStyle"/> <!-- javadoc comments are well formed --> <module name="JavadocStyle"/> <!-- javadoc comments are well formed -->