checkstyle icon indicating copy to clipboard operation
checkstyle copied to clipboard

Move violation comments out of Javadoc for all input files

Open lithops-zty opened this issue 7 months ago • 31 comments

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

  1. Choose a package from the list;
  2. Move all violation comments out of Javadoc;
  3. Remove all related suppressions;
  4. Update violation line numbers inside unit test methods, if any changed.
  5. Send PR.

Notes

  1. Moving violating comments around requires adding (X lines) above/below to make sure they still reference the same line. You can refer to guide to specify violations for syntax.
  2. Make sure no input files exceed the limit of 120 lines.

Example of expected update https://github.com/checkstyle/checkstyle/pull/19766

lithops-zty avatar Apr 29 '26 02:04 lithops-zty

hi , i like to work on this issues , assign me it please

Nourhan46 avatar May 04 '26 16:05 Nourhan46

No assignments, just share what Check you will cover in comments, and start working on it

romani avatar May 05 '26 01:05 romani

Hi! I will cover the files in rule711generalform (InputCorrectJavadocLeadingAsteriskAlignment.java and InputFormattedCorrectJavadocLeadingAsteriskAlignment.java). Starting to work on it now!

fmicelii avatar May 05 '26 19:05 fmicelii

Hi! I'll cover src/test/resources/com/puppycrawl/tools/checkstyle/checks/imports/unusedimports/InputUnusedImportsJavadocSetters.java. Starting now.

lu1tr0n avatar May 10 '26 20:05 lu1tr0n

Hi! I'll cover 3 files in rule713atclauses they are InputIncorrectAtClauseOrderCheck1.java, InputIncorrectAtClauseOrderCheck2.java, InputIncorrectAtClauseOrderCheck3.java Starting now.

Mukund81 avatar May 12 '26 12:05 Mukund81

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.

veddarji avatar May 30 '26 18:05 veddarji

Hi again! I will cover the file in coding/illegaltoken (InputIllegalTokensCheckCommentsContent.java).

veddarji avatar May 30 '26 18:05 veddarji

Hi @romani I would like to contribute to this issue. I will cover : - src/test/resources/com/puppycrawl/tools/checkstyle/checks/trailingcomment/InputTrailingComment3.java

Pritesh928 avatar Jun 02 '26 09:06 Pritesh928

I am on it.

sathish256 avatar Jun 03 '26 18:06 sathish256

Hi, I would like to work on this issue. I will cover InputCorrectJavadocLeadingAsteriskAlignment.java.

Anvith433 avatar Jun 04 '26 07:06 Anvith433

I will cover checks/annotation/suppresswarnings/InputSuppressWarningsCompact1.java.

king-407 avatar Jun 06 '26 22:06 king-407

I am on it.

surajgojanur avatar Jun 18 '26 10:06 surajgojanur

I will work on javadocmissingwhitespaceafterasterisk

surajgojanur avatar Jun 28 '26 11:06 surajgojanur

I will work on coding/illegaltoken next

surajgojanur avatar Jun 28 '26 13:06 surajgojanur

Hi! I'll cover:

src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/javadoctagcontinuationindentation/InputJavadocTagContinuationIndentation.java

Starting now.

sahitya0xsingh avatar Jul 13 '26 09:07 sahitya0xsingh

Hi,

Following the feedback on my previous PR (#20719), I'll work on the remaining files in the javadoctagcontinuationindentation package for this issue.

sahitya0xsingh avatar Jul 13 '26 20:07 sahitya0xsingh

I will cover checks/javadoc/javadocleadingasteriskalign (InputJavadocLeadingAsteriskAlignIncorrect.java and InputJavadocLeadingAsteriskAlignTabs.java).

arturict avatar Jul 13 '26 22:07 arturict

Hi!!

I'll take the files in checks/javadoc/javadocstyle : ( InputIncorrectAtClauseOrderCheck1.java, InputIncorrectAtClauseOrderCheck2.java, and InputIncorrectAtClauseOrderCheck3.java )

ashen-a avatar Jul 23 '26 14:07 ashen-a

I will cover checks/javadoc/summaryjavadoc: InputSummaryJavadocInlineReturn.java, InputSummaryJavadocInlineReturn2.java, and InputSummaryJavadocInlineReturnForbidden.java.

arturict avatar Aug 04 '26 21:08 arturict

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.

mukund-ahire avatar Sep 26 '26 13:09 mukund-ahire