Move violation comments out of Javadoc for all input files
Follow-up of #19756
Background
Putting violation comments (i.e. // violation xxx) inside Javadoc is considered a bad practice as they visually mix with target code. For example,
Bad
/**
* The following is a bad tag.
* @mytag Hello // violation 'Unknown tag 'mytag'.'
* // violation below 'Unknown tag 'mytag'.'
* @mytag
*/
public class InputJavadocTypeBadTag {}
Good
// violation 4 lines below 'Unknown tag 'mytag'.'
// violation 4 lines below 'Unknown tag 'mytag'.'
/**
* The following is a bad tag.
* @mytag Hello
* @mytag
*/
public class InputJavadocTypeBadTag {}
Task
Ensure no violation comments inside Javadoc for all existing input files.
Here is a list of existing input files to be fixed: https://github.com/checkstyle/checkstyle/blob/229c44f8a17b8ec892469a4ff7eeb46300794d89/config/checkstyle-input-suppressions.xml#L94-L105
How to contribute
- Choose a package from the list;
- Move all violation comments out of Javadoc;
- Remove all related suppressions;
- Update violation line numbers inside unit test methods, if any changed.
- Send PR.
Notes
- Moving violating comments around requires adding
(X lines) above/belowto make sure they still reference the same line. You can refer to guide to specify violations for syntax. - Make sure no input files exceed the limit of 120 lines.
Example of expected update https://github.com/checkstyle/checkstyle/pull/19766
hi , i like to work on this issues , assign me it please
No assignments, just share what Check you will cover in comments, and start working on it
Hi! I will cover the files in rule711generalform (InputCorrectJavadocLeadingAsteriskAlignment.java and InputFormattedCorrectJavadocLeadingAsteriskAlignment.java). Starting to work on it now!
Hi! I'll cover src/test/resources/com/puppycrawl/tools/checkstyle/checks/imports/unusedimports/InputUnusedImportsJavadocSetters.java. Starting now.
Hi! I'll cover 3 files in rule713atclauses they are
InputIncorrectAtClauseOrderCheck1.java, InputIncorrectAtClauseOrderCheck2.java, InputIncorrectAtClauseOrderCheck3.java
Starting now.
Hi @romani, I am a new contributor and I would like to help with this! I am currently searching the repository for an input file that still has a violation comment inside the Javadoc. Once I find one, I will reply here to claim it and submit a PR.
Hi again! I will cover the file in coding/illegaltoken (InputIllegalTokensCheckCommentsContent.java).
Hi @romani I would like to contribute to this issue. I will cover : - src/test/resources/com/puppycrawl/tools/checkstyle/checks/trailingcomment/InputTrailingComment3.java
I am on it.
Hi, I would like to work on this issue. I will cover InputCorrectJavadocLeadingAsteriskAlignment.java.
I will cover checks/annotation/suppresswarnings/InputSuppressWarningsCompact1.java.
I am on it.
I will work on javadocmissingwhitespaceafterasterisk
I will work on coding/illegaltoken next
Hi! I'll cover:
src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/javadoctagcontinuationindentation/InputJavadocTagContinuationIndentation.java
Starting now.
Hi,
Following the feedback on my previous PR (#20719), I'll work on the remaining files in the javadoctagcontinuationindentation package for this issue.
I will cover checks/javadoc/javadocleadingasteriskalign (InputJavadocLeadingAsteriskAlignIncorrect.java and InputJavadocLeadingAsteriskAlignTabs.java).
Hi!!
I'll take the files in checks/javadoc/javadocstyle : ( InputIncorrectAtClauseOrderCheck1.java, InputIncorrectAtClauseOrderCheck2.java, and InputIncorrectAtClauseOrderCheck3.java )
I will cover checks/javadoc/summaryjavadoc: InputSummaryJavadocInlineReturn.java, InputSummaryJavadocInlineReturn2.java, and InputSummaryJavadocInlineReturnForbidden.java.
Hi, I'd like to work on the checks/whitespace/emptylineseparator package. I'll move the violation comments out of Javadoc, remove the related suppression, and update any affected violation line references.