JavadocType: require @author tag in format "name (email)"

This commit is contained in:
Paul Campbell 2016-09-05 07:28:25 +01:00
parent d82ef2337e
commit 3cc5a02dd6
2 changed files with 4 additions and 4 deletions

View file

@ -1245,9 +1245,7 @@ Checks the formatting of the Javadoc blocks. See the official [Checkstyle docume
#### [JavadocType](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocType) #### [JavadocType](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocType)
Checks the format for Javadoc for classes and enums. Javadoc must be present, not have any unknown tags and not missing any `@param` tags. Checks the format for Javadoc for classes and enums. Javadoc must be present, not have any unknown tags and not missing any `@param` tags. The `@author` tag must have a name and, in brackets, an email address.
> TODO: authorFormat = "^.+ (\S+@[\S.]+)$" - name followed by email in brackets
#### [JavaNCSS](http://checkstyle.sourceforge.net/config_metrics.html#JavaNCSS) #### [JavaNCSS](http://checkstyle.sourceforge.net/config_metrics.html#JavaNCSS)

View file

@ -104,7 +104,9 @@
</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 -->
<module name="JavadocType"/> <!-- javadoc is present for classes, interfaces and enums --> <module name="JavadocType"> <!-- javadoc is present for classes, interfaces and enums -->
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/> <!-- name followed by email in brackets -->
</module>
<module name="JavaNCSS"/> <!-- Non-Commenting Source Statements complexity analysis --> <module name="JavaNCSS"/> <!-- Non-Commenting Source Statements complexity analysis -->
<module name="LeftCurly"/> <!-- placement of left curly braces ('{') for code blocks at end of line --> <module name="LeftCurly"/> <!-- placement of left curly braces ('{') for code blocks at end of line -->