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

Issue #14573: fix javadoc type check for empty tags #14882

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

strkkk
Copy link
Member

@strkkk strkkk commented May 17, 2024

@strkkk strkkk force-pushed the javadoc_tag_false_positive branch from 7d0b256 to 04b714c Compare May 17, 2024 19:29
@strkkk strkkk force-pushed the javadoc_tag_false_positive branch from 04b714c to e5f329e Compare May 17, 2024 19:49
@strkkk
Copy link
Member Author

strkkk commented May 17, 2024

Github, generate report

@strkkk
Copy link
Member Author

strkkk commented May 18, 2024

There are cases like this https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/e5f329e_2024235419/reports/diff/spotbugs/index.html#A1, when annotation is considered as tag. In theory, we can analyse context and ignore text inside <code> or <pre> tags

@strkkk
Copy link
Member Author

strkkk commented May 18, 2024

Problem is in BlockTagUtil#extractBlockTags, it does not take context into consideration. There are 2 possible solutions:

  1. Consider tags
     and  and ignore its content
  2. Adjust regex to make it parse tag only if it starts with lowercase letter. I couldn't find some article / spec to back it up, but it seems reasonable

@romani
Copy link
Member

romani commented May 19, 2024

This Check is not AST based, so amount of problems in this Check is uncountable and we will never fix them. We need to migrate to AST.

Without migration, we just need to make sure that diff report is decently ok or better then before in behavior

@strkkk
Copy link
Member Author

strkkk commented May 23, 2024

Without migration, we just need to make sure that diff report is decently ok or better then before in behavior

it seems ok to me if we ignore cases with code snippets with annotations in javadocs

@romani
Copy link
Member

romani commented Jun 2, 2024

openjdk17 ( ±1954, +1954 )

this is too much, we can NOT implSpec, apiNote to known tags in this Check in config.
Please add filter to you config_single.xml to skip such violations, and get cleaner report.
We will need to post this filter in migration notes, as such tags become more and more popular, we already have issue somewhere to add them to support.

Consider tags and and ignore its content

How complicated to add this ? User do not heavily like false positives, and "ok" with false-negatives, especially in javadoc.

@romani
Copy link
Member

romani commented Jun 2, 2024

This is where extra property is requested #14724 (comment) it will ease a problem, but it is separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JavadocType: False negative for unknown tag with no description
2 participants