Eclipse – Checkstyle – Exclude folder

checkstyleeclipse

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?

Best Answer

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

this works :)