Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteTag reports violation with confusing message when there is no javadoc #11584

Closed
strkkk opened this issue Apr 30, 2022 · 2 comments · Fixed by #15844
Closed

WriteTag reports violation with confusing message when there is no javadoc #11584

strkkk opened this issue Apr 30, 2022 · 2 comments · Fixed by #15844

Comments

@strkkk
Copy link
Member

strkkk commented Apr 30, 2022

https://checkstyle.org/config_javadoc.html#WriteTag

$ cat Test.java
public class Test {}

$ cat config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
        "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
        "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
    <module name="TreeWalker">
        <module name="WriteTag"/>
    </module>
</module>

$ java -jar checkstyle-10.2-all.jar -c config.xml Test.java
Starting audit...
[ERROR] C:\workdir\Test.java:1: Type Javadoc comment is missing null tag. [WriteTag]
Audit done.
Checkstyle ends with 1 errors.

Expected: no violation, since there is no javadoc.
Also note confusing violation message ("null" tag).

For javadoc presence there are other checks. And docs mention that with default config it does nothing, but it reports weird message instead.

P.S. Checkstyle has WriteTag with default config -

<module name="WriteTag"/>


Breaking behavior compatibility migration notes:
No configuration breaking changes. Breaking compatibility is only in behavior - so it is defect/bug fix.
after fix and release (10.21.0) Check will not report violations on missed Javadocs.
To archive behavior as before, users should start using InvalidJavadocPosition, MissingJavadocMethod , MissingJavadocPackage , MissingJavadocType to let Checkstyle demand javadoc first and when WriteTag will demand required tag in existing javadoc

@strkkk
Copy link
Member Author

strkkk commented May 15, 2022

It is expected that check will not report violation if there is no javadoc

theWolf1198 added a commit to theWolf1198/checkstyle that referenced this issue Jun 6, 2022
@checkstyle checkstyle deleted a comment from theWolf1198 Dec 17, 2022
strkkk added a commit to strkkk/checkstyle that referenced this issue Mar 11, 2023
strkkk added a commit to strkkk/checkstyle that referenced this issue Mar 11, 2023
strkkk added a commit to strkkk/checkstyle that referenced this issue Mar 11, 2023
strkkk added a commit to strkkk/checkstyle that referenced this issue Mar 11, 2023
strkkk added a commit to strkkk/checkstyle that referenced this issue Apr 15, 2023
strkkk added a commit to strkkk/checkstyle that referenced this issue Apr 15, 2023
romani pushed a commit to strkkk/checkstyle that referenced this issue Apr 19, 2023
strkkk added a commit to strkkk/checkstyle that referenced this issue Apr 21, 2023
@romani
Copy link
Member

romani commented Dec 17, 2023

yes, please takes , there is almost done PR, please reuse that code. That PR is abandoned.

@checkstyle checkstyle deleted a comment from ShivamPandey00 Dec 17, 2023
@checkstyle checkstyle deleted a comment from nrmancuso Dec 17, 2023
@checkstyle checkstyle deleted a comment from theWolf1198 Dec 17, 2023
@checkstyle checkstyle deleted a comment from theWolf1198 Dec 17, 2023
@checkstyle checkstyle deleted a comment from aayushRedHat Dec 17, 2023
@checkstyle checkstyle deleted a comment from theWolf1198 Dec 17, 2023
aayushRedHat added a commit to aayushRedHat/checkstyle that referenced this issue Dec 18, 2023
MohanadKh03 added a commit to MohanadKh03/checkstyle that referenced this issue Nov 1, 2024
MohanadKh03 added a commit to MohanadKh03/checkstyle that referenced this issue Nov 9, 2024
MohanadKh03 added a commit to MohanadKh03/checkstyle that referenced this issue Nov 9, 2024
MohanadKh03 added a commit to MohanadKh03/checkstyle that referenced this issue Nov 9, 2024
romani pushed a commit that referenced this issue Nov 9, 2024
@github-actions github-actions bot added this to the 10.20.2 milestone Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment