checkstyle / checkstyle/checkstyle
A false negative about the rule Indentation
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 4.2k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 233
Description
I have read check documentation: https://checkstyle.sourceforge.io/checks/misc/indentation.html#Indentation
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words
```bash
/var/tmp $ cat T.java
import util.MyAnnotation;
@MyAnnotation
public @Ann
@Ann2 class T
implements TestInterface {
}
/var/tmp $ cat config.xml
/var/tmp $ java -Duser.language=en -Duser.country=US -jar checkstyle-10.12.3-all.jar -c config.xml T.java
Starting audit...
Audit done.
```
I would expect Checkstyle to show the warning message like:
```bash
Starting audit...
[WARN] T.java:4:1: '@' has incorrect indentation level 0, expected level should be 4. [Indentation]
Audit done.
```
but no warnings, hence, I think this is an FN.
UPDATE: recommended to fix https://github.com/checkstyle/checkstyle/issues/14716 first.
PR for this issue: https://github.com/checkstyle/checkstyle/pull/14149
Contributor guide
Research direction
Reproduce the report with T.java, config.xml, and the Checkstyle CLI command shown in the issue. Read issue 14716 first, then review pull request 14149 for the work already proposed. Done means the Indentation check reports the expected warning for the annotation indentation without introducing regressions.
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
- Mostly clear
- Newbie friendliness
- 20/100