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 SuppressWithNearbyCommentFilter #6884

Closed
esilkensen opened this issue Jul 9, 2019 · 3 comments

Comments

@esilkensen
Copy link
Contributor

commented Jul 9, 2019

From #6876 (comment):

SuppressWithNearbyCommentFilter 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, possibly named idFormat, as either a plain string or 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 could 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 issue for SuppressionCommentFilter: #6883

@romani

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

I am ok with such update, but it will breaking compatibility, as after update some suppressions stop working.

@rnveach , please review and put approval label if you are ok with such update.

@rnveach

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

I am ok.

@rnveach rnveach added the approved label Jul 10, 2019

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

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

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

@romani

This comment has been minimized.

Copy link
Member

commented Aug 11, 2019

Fix is merged

@romani romani closed this Aug 11, 2019

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