checkstyle / checkstyle/checkstyle
Cannot exclude public scope with JavadocMethod module
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 4.2k
- Avg merge
- 22h 23m
- Merged PRs (30d)
- 232
Description
checkstyle.xml
```
```
CheckstyleTest.java
```
package test;
public class CheckstyleTest {
public void publicMethod() {
System.out.println("public method");
}
protected void protectedMethod() {
System.out.println("protected method");
}
void packageMethod() {
System.out.println("package method");
}
private void privateMethod() {
System.out.println("private method");
}
}
```
Console
```
java -jar checkstyle-8.19-all.jar CheckstyleTest.java -c=checkstyle.xml
Starting audit...
Audit done.
```
---------------
Expected output:
```
Starting audit...
[WARN] TestProject\test\CheckstyleTest.java:9:9: Missing a Javadoc comment. [JavadocMethod]
[WARN] TestProject\test\CheckstyleTest.java:13:9: Missing a Javadoc comment. [JavadocMethod]
[WARN] TestProject\test\CheckstyleTest.java:17:9: Missing a Javadoc comment. [JavadocMethod]
Audit done.
```
--------------
Checkstyle seems to ignore the complete check if scope is set to public. Is this a bug?
Contributor guide
Research direction
Start by reproducing the configuration from checkstyle.xml against CheckstyleTest.java with the documented Checkstyle command. Trace how JavadocMethod handles excludeScope=public, then add a regression test covering public, protected, package, and private methods; done means the non-public methods produce the expected warnings while public methods remain excluded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100