I want to ignore a specific folder (named generated-sources) from my checkstyle reports, because they are generated.
I\'m using eclipse-cs for displaying my violatio
<suppress files="[\\/]generated-sources[\\/]" checks="[a-zA-Z0-9]*"/>
this works :)
Additionally to the answer from Philipp, I had to use an absolute pathname ( :-( ) for the suppression file:
<module name="SuppressionFilter">
<property name="file" value="/Users/xxx/workspace/suppressions.xml"/>
</module>
Looks like the Checkstyle plugin is not using the project home directory.
(at least under eclipse luna / Mac OS X)
As pointed by Thomas Welsch in his answer, there appears to be a problem with using relative pathname for the suppression xml file.
For gradle builds, This gist suggests a workaround:
in build.gradle
:
checkstyle {
// use one common config file for all subprojects
configFile = project(':').file('config/checkstyle/checkstyle.xml')
configProperties = [ "suppressionFile" : project(':').file('config/checkstyle/suppressions.xml')]
}
in checkstyle.xml
:
<module name="SuppressionFilter">
<property name="file" value="${suppressionFile}" default="suppressions.xml"/>
</module>
(the default value allows IDE plugins, that do not have the gradle variable sorted out, to work correctly)