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

Add ID format property to SuppressWithPlainTextCommentFilter #6954

Closed
esilkensen opened this issue Aug 7, 2019 · 0 comments

Comments

@esilkensen
Copy link
Contributor

commented Aug 7, 2019

From #6876 (comment):

SuppressWithPlainTextCommentFilter currently has checkFormat and messageFormat properties. When deciding if an audit event should be suppressed, it first matches the event source against the checkFormat. If that fails, it matches the event module ID against the checkFormat.

For an event to be suppressed, one of those matches has to succeed, and the event message must also be matched against the messageFormat.

This issue is a proposal to define a new property, idFormat, as a regular expression, and use it to match the event module ID rather than reusing the checkFormat. Then an audit event could be suppressed if all three matches succeed.

This new property should be consistent with SuppressionFilter where suppression XML elements can have attributes including:

  • checks - a Regular Expression matched against the name of the check associated with an audit event. Optional as long as id or message is specified.
  • message - a Regular Expression matched against the message of the check associated with an audit event. Optional as long as checks or id is specified.
  • id - a string matched against the check id associated with an audit event. Optional as long as checks or message is specified.

Related issues:

  • SuppressionCommentFilter: #6883
  • SuppressWithNearbyCommentFilter: #6884

Migration note:
Recommended migration for users is to rename any checkFormat property that matches check ID's to instead be named idFormat
OR
Make a copy of SuppressWithPlainTextCommentFilter config and use idFormat.

@romani romani added the approved label Aug 7, 2019

esilkensen added a commit to esilkensen/checkstyle that referenced this issue Aug 11, 2019
esilkensen added a commit to esilkensen/checkstyle that referenced this issue Aug 11, 2019
esilkensen added a commit to esilkensen/checkstyle that referenced this issue Aug 11, 2019
esilkensen added a commit to esilkensen/checkstyle that referenced this issue Aug 12, 2019

@romani romani added the new feature label Aug 17, 2019

romani added a commit that referenced this issue Aug 19, 2019

@romani romani added this to the 8.24 milestone Aug 19, 2019

@romani

This comment has been minimized.

Copy link
Member

commented Aug 19, 2019

Fix is merged

@romani romani closed this Aug 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.