Skip to content

[java] Fix #2996 - CommentSize/CommentContent suppression#4939

Merged
adangel merged 14 commits intopmd:mainfrom
oowekyala:issue2996-commentsize-suppression
Dec 17, 2024
Merged

[java] Fix #2996 - CommentSize/CommentContent suppression#4939
adangel merged 14 commits intopmd:mainfrom
oowekyala:issue2996-commentsize-suppression

Conversation

@oowekyala
Copy link
Copy Markdown
Member

@oowekyala oowekyala commented Apr 6, 2024

Describe the PR

Suppressing violations of comment related rules doesn't work well right now, because they are reported against the compilation unit node. This adds some utilities to be able to report violations on a specific token. The RuleContext finds the closest node to the token and uses that to look for suppression annotations.

See also #2996 (comment)

Draft because probably other comment rules have the same problem.

Java documentation rules have been updated, but there are two other PLSQL rules that still use the broken overload addViolationWithPosition. I think we can land this without necessarily updating those.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@ghost
Copy link
Copy Markdown

ghost commented Apr 9, 2024

1 Message
📖 Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact

Generated by 🚫 Danger

@adangel adangel changed the base branch from master to main September 26, 2024 14:33
@oowekyala oowekyala marked this pull request as ready for review December 11, 2024 14:39
@adangel adangel changed the title [java] Fix #2996 - CommentSize suppression [java] Fix #2996 - CommentSize/CommentContent suppression Dec 17, 2024
Copy link
Copy Markdown
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I'll update the small fixes myself and merge it aftwards.

@adangel adangel added this to the 7.9.0 milestone Dec 17, 2024
adangel added a commit that referenced this pull request Dec 17, 2024
adangel added a commit that referenced this pull request Dec 17, 2024
@adangel adangel merged commit c631f51 into pmd:main Dec 17, 2024
adangel added a commit that referenced this pull request Dec 17, 2024
Merge pull request #4939 from oowekyala:issue2996-commentsize-suppression
@oowekyala oowekyala deleted the issue2996-commentsize-suppression branch December 17, 2024 13:40
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.

[java] CommentSize rule violation is not suppressed at method level

3 participants