diff --git a/src/main/resources/google_checks.xml b/src/main/resources/google_checks.xml index ff9b5523e64..3a593ad3746 100644 --- a/src/main/resources/google_checks.xml +++ b/src/main/resources/google_checks.xml @@ -16,7 +16,10 @@ Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov. --> - + + + + @@ -47,6 +50,19 @@ + + + + + + + + + + + + + diff --git a/src/xdocs/google_style.xml b/src/xdocs/google_style.xml index abb72772284..a49f40740c1 100644 --- a/src/xdocs/google_style.xml +++ b/src/xdocs/google_style.xml @@ -2302,10 +2302,19 @@

It is possible to suppress some violations by embeded filters - SuppressionFilter - and + SuppressionFilter, - SuppressionXpathFilter. + SuppressionXpathFilter, + + SuppressWithNearbyCommentFilter, + + SuppressionCommentFilter + and + + SuppressWarningsFilter + in conjunction with + + SuppressWarningsHolder. Location of config file for SuppressionFilter can be defined by system property org.checkstyle.google.suppressionfilter.config (default value is checkstyle-suppressions.xml). @@ -2313,13 +2322,30 @@ can be defined by system property org.checkstyle.google.suppressionxpathfilter.config (default value is checkstyle-xpath-suppressions.xml). + To suppress a check on a block of code using SuppressWithNearbyCommentFilter + surround the code block with // CHECKSTYLE.OFF: NameOfTheCheck and + // CHECKSTYLE.ON: NameOfTheCheck (replace NameOfTheCheck with the actual + check to be suppressed). + To suppress a check in the next line of code using SuppressionCommentFilter + precede the line of code with // CHECKSTYLE.OFF: NameOfTheCheck (replace + NameOfTheCheck with the actual check to be suppressed). + To suppress a check using SuppressWarningsFilter use Java's @SuppressWarnings + annotation. Each value passed in the array parameter must meet the format + checkstyle:maneofthecheck where the checkstyle: is optional and + maneofthecheck if the actual name of check to be suppressed in lowercase format.

For more details please review exact configuration of Filters in google_checks.xml: SuppressionFilter, - SuppressionXpathFilter. + SuppressionXpathFilter + + SuppressWithNearbyCommentFilter, + + SuppressionCommentFilter, + + SuppressWarningsFilter.