configuration - How to use PMD violationSuppressRegex with Sonar? -
pmd allows suppressing violations violationsuppressregex
property. see pmd documentation violation suppress regex.
for example loosecoupling rule.
is there way use functionality in sonar?
example
suppress loose coupling violation linkedhashset in pmd:
<rule ref="rulesets/coupling.xml/loosecoupoing"> <property name="violationsuppressregex" value=".*'linkedhashset'.*"/> </rule>
where violation message like:
you should not use 'linkedhashset' interface.
violationsuppressregex
new property in pmd 5.0. , sonar uses pmd 4.3.
looks i'll have wait until sonar upgrades pmd :-(
Comments
Post a Comment