Closed
Description
JavadocVariable - https://checkstyle.org/config_javadoc.html#JavadocVariable
does not report missing comments on member variables in a standard class, irrespective of scope, when excludeScope="anoninner".
config.xml:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="ASCII" />
<property name="severity" value="error" />
<property name="fileExtensions" value="java"
5D1A
/>
<module name="TreeWalker">
<module name="JavadocVariable">
<property name="excludeScope" value="anoninner" />
</module>
</module>
</module>
TestClass.java:
package test;
/** Class for testing checkstyle. */
public class TestClass {
private String key;
public TestClass() {
}
}
$ java -jar checkstyle-6.18-all.jar -c config.xml TestClass.java
Actual output:
Starting audit...
Audit done.
Expected output:
Starting audit...
[ERROR] C:\checkstyle\TestClass.java:6:9: Missing a Javadoc comment [JavadocVariable]
Audit done.
Checkstyle ends with 1 errors.