-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
JavadocStyle doesn't work with inline @return
#12600
Comments
attention checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java Lines 300 to 301 in 887aab9
this module is old and does not use grammar and AST to deal with, I hope fix can be applied to Check, but it might be more challenging as parsing is done by regexp or other custom techniques. |
We might be on to to extend this Check to support this for a bit. We already have validation for summary at https://checkstyle.org/config_javadoc.html#SummaryJavadoc there a lot of nuances of this validation, so better to not have super check that does all validations on javadoc. |
The check shouldn't be removed, but the common functionality between it and other checks should be removed like we have done in other areas. JavadocStyle has scope and java token support while SummaryJavadoc does not. It is not clear how |
I'm not sure if the refactoring of the Javadoc checks already covers this: Besides the mentioned checks, also the JavadocMethod check has the same issue. |
Fix is merged |
I have read check documentation: https://checkstyle.org/config_javadoc.html#JavadocStyle
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
JavadocStyle
requires a period after the first sentence, but it doesn't consider inline{@return}
tags which insert a period after the contents.For the example file with
{@return a string}
, this is whatjavadoc -package Test.java
(JDK 19) generates:This seems to be related to #10776, which is a similar issue with a different check.
Note: A workaround is to add a
.
after the{@return}
tag.The text was updated successfully, but these errors were encountered: