Created
July 21, 2015 13:23
-
-
Save attatrol/699fd9863de8730dfc30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section name="SuppressionAnnotationFilter"> | |
<subsection name="Description"> | |
<p> | |
Suppress all reports from elements annotated by user defined annotations. | |
It is possible to define checks that will bypass the filter. | |
</p> | |
<p> | |
Example: | |
</p> | |
<code> | |
@UserAnnotation | |
public void foo(){ | |
//here bad code | |
//that should be suppressed | |
} | |
</code> | |
</subsection> | |
<subsection name="Properties"> | |
<table> | |
<tr> | |
<th>name</th> | |
<th>description</th> | |
<th>type</th> | |
<th>default value</th> | |
</tr> | |
<tr> | |
<td>annotationName</td> | |
<td>Names of suppressive annotations. | |
Can be either simple or fully-qualified. | |
Simple name will affect all fully-qualified annotations that match it. | |
AT symbol is facultative.</td> | |
<td><a href="property_types.html#stringSet">String Set</a></td> | |
<td><code>{ }</code></td> | |
</tr> | |
<tr> | |
<td>permittedChecks</td> | |
<td>Regular expressions that matches checks, which should bypass the filter.</td> | |
<td><a href="property_types.html#stringSet">String Set</a></td> | |
<td><code>{ }</code></td> | |
</tr> | |
<tr> | |
<td>modifiersExcluded</td> | |
<td>Excludes modifiers of an annotated element from filtered area. | |
Javadocs are included in modifiers.</td> | |
<td><a href="property_types.html#boolean">boolean</a></td> | |
<td><code>true</code></td> | |
</tr> | |
</table> | |
</subsection> | |
<subsection name="Dependencies"> | |
<p> | |
You have to add DetailAstRootHolder check into TreeWalker section of your configuration for correct work of this filter. Without this addition filter won't suppress anything. | |
</p> | |
<code> | |
<module name="Checker"> | |
... | |
<module name="TreeWalker"> | |
... | |
<module name="DetailAstRootHolder"/> | |
... | |
</module> | |
... | |
<module name="SuppressionAnnotationFilter"> | |
<property name="annotationName" value="UserAnnotation"/> | |
</module> | |
</module> | |
</code> | |
</subsection> | |
<subsection name="Examples"> | |
<p> | |
Suppose you have non-formatted class generated by some automatic tool. | |
</p> | |
<code> | |
@Generated | |
class GeneratedClass{ | |
/** loads of messy code */ | |
} | |
</code> | |
<p> | |
With this configuration there will be no warnings or errors from this class exept for UserAllowedCheck. | |
</p> | |
<code> | |
<module name="Checker"> | |
... | |
<module name="TreeWalker"> | |
... | |
<module name="DetailAstRootHolder"/> | |
... | |
</module> | |
... | |
<module name="SuppressionAnnotationFilter"> | |
<property name="annotationName" value="Generated"/> | |
<property name="permittedChecks" value="^(?!UserAllowedCheck$).*"/> | |
</module> | |
</module> | |
</code> | |
</subsection> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment