Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm doing an override for a third party class and I want to suppress all checks for it (since I'm only keeping it around until the patch is accepted).

Is there a way to suppress all checks for a file?

I tried using "*" but that fails.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
407 views
Welcome To Ask or Share your Answers For Others

1 Answer

Don't know whether you're using command line or in an IDE, but you'll basically need a suppresions file. If you're manually editing the Checkstyle config file, add a new module to it:

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

Your mysuppression.xml can be something like:

<?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="TheClassToIgnore.java" checks="[a-zA-Z0-9]*"/>
</suppressions>

The value for "files" attribute is basically a regex for your source files, and the value for the "checks" attribute is regex for what checks to skip ("[a-zA-Z0-9]*" basically means skip everything). This is the pattern you're looking for I guess?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...