I want to have multiple suppression files for Checkstyle. Which means, that I'll have 2 separate files with separate suppression rules:
The way to add 1 file is this is to add this in the rules:
<module name="SuppressionFilter">
<property name="file" value="docs/suppressions.xml"/>
</module>
What I want to achieve is: (This isn't legal syntax)
<module name="SuppressionFilter">
<property name="file" value="docs/suppressions-1.xml"/>
<property name="file" value="docs/suppressions-2.xml"/>
</module>
I tried using 2 separate SuppressionFilters, but this seems to overwrite the first with the second.
What I mean is:
<module name="SuppressionFilter">
<property name="file" value="docs/suppressions-1.xml"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="docs/suppressions-2.xml"/>
</module>
If done as above, it will only use suppressions-2.xml
Is there a way to do this?
Your option 2 is good, just add the module twice:
<module name="SuppressionFilter">
<property name="file" value="docs/suppressions-1.xml"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="docs/suppressions-2.xml"/>
</module>
Both suppressions will be active, so anything that is suppressed in either file will be suppressed.
If your suppressions-1.xml is not working, it would be a problem in that file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With