#520 suppressions without separate file

open
nobody
None
5
2012-10-10
2009-05-28
Stephen Bloch
No

Another vote for #1383132. I've been able to distribute checks to my students using an absolute pathname for the location of the standard suppressions file, but if it's a Windows pathname, my Mac chokes on it, and vice versa.

If you don't want to mess up the DTD, it could look like:
<module name="SuppressionFilter">
<property literal="&lt;suppress files=\\" Test.*.java\\"="" checks="\\"MagicNumber\\"/"><suppress other-rules-go-here=""/>"/>
</module>
This is a little more error-prone and harder to use than the more user-obvious
<module name="SuppressionFilter">
<suppress files="Test.*.java" checks="MagicNumber"/>
<suppress other-rules-go-here=""/>
</module>

In fact, it would be neat if SuppressionFilter allowed BOTH a "file" property and an arbitrary number of <suppress> tags; that way a whole site could have a baseline suppression filter file, and individual users or projects could add other suppression filters to it. Even better would be to allow multiple files as well, of course...

Discussion

  • Stephen Bloch
    Stephen Bloch
    2009-05-28

    Sorry, I typed that example wrong. I meant
    <module name="SuppressionFilter">
    <property name="literal" value="&lt;suppress files=\\" Test.*.java\\"="" checks="\\"MagicNumber\\"/"><suppress other-rules-go-here=""/>"/>
    </module>