PMD seems to only support exception files in the RuleSet level
.
We have the same requirement that exclude files in the Rule level
..
Finally, we write the wrapper lab
client and the bypass logic of the controller file ourselves to solve this problem.
But for a common PMD task. We can make the same rule together as a rule Set and exclude it at the ruleSet level.
UPDATE: we found that extends net.sourceforge.pmd.lang.rule.XPathRule
, and adding an exclude file is simple. For the Java Code Rule
we can use the same method to exclude the file in the rule definition.
source share