Checkstyle - Exclude folder

Philipp Sander picture Philipp Sander · Aug 2, 2013 · Viewed 18.7k times · Source

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 violations.

i added a suppressionfilter to my xml:

<module name="SuppressionFilter">
    <property name="file" value=".\suppressions.xml"/>
</module>

my suppressions.xml looks like this:

<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">

<suppressions>
    <suppress files="\*generated-sources\*\*\.\*" checks="[a-zA-Z0-9]*"/>
</suppressions>

but it is not working. any ideas?

Answer

Philipp Sander picture Philipp Sander · Aug 2, 2013
<suppress files="[\\/]generated-sources[\\/]" checks="[a-zA-Z0-9]*"/>

this works :)