Class SuppressWithPlainTextCommentFilter

java.lang.Object
com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
com.puppycrawl.tools.checkstyle.filters.SuppressWithPlainTextCommentFilter
All Implemented Interfaces:
Configurable, Contextualizable, Filter

Filter SuppressWithPlainTextCommentFilter uses plain text to suppress audit events. The filter knows nothing about AST, it treats only plain text comments and extracts the information required for suppression from the plain text comments. Currently, the filter supports only single-line comments.

Please, be aware of the fact that, it is not recommended to use the filter for Java code anymore.

Rationale: Sometimes there are legitimate reasons for violating a check. When this is a matter of the code in question and not personal preference, the best place to override the policy is in the code itself. Semi-structured comments can be associated with the check. This is sometimes superior to a separate suppressions file, which must be kept up-to-date as the source file is edited.

Note that the suppression comment should be put before the violation. You can use more than one suppression comment each on separate line.

Notes: Properties offCommentFormat and onCommentFormat must have equal paren counts.

SuppressWithPlainTextCommentFilter can suppress Checks that have Treewalker or Checker as parent module.

Since:
8.6