PMD Custom Ruleset
Is there a way to import custom or PMD rules that I have created with this plugin?
-
Dave commented
I have tried importing a custom set of rules.
I tried importing it while creating a new coding profile and it resulted in no rules whatsoever enabled. Both PMD and FindBugs had all their rules disabled. (I think I understand why FindBugs was disabled: I was importing a pmd configuration.)
I then tried it after creating a profile by right-clicking and choosing import, as shown in the tutorial. This resulted in all the PMD rules being disabled, although FindBugs rules remained unaffected.
I am working on Mac OS X 10.9.4, with IntelliJ 13.1.4 Build #IU-135.1230. I have QAPlug 1.3.7 with - PMD 1.3.6 and - FindBugs 1.3.5.
Following is the pmd.xml file I am trying to import. While running through maven this achieves exactly what I expect, but QAPlug sees it as having no rules enabled.
Any thoughts?
<?xml version="1.0"?>
<ruleset name="myrules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"><rule ref="rulesets/java/android.xml"/>
<rule ref="rulesets/java/basic.xml"/>
<rule ref="rulesets/java/braces.xml"/>
<rule ref="rulesets/java/codesize.xml">
<exclude name="TooManyMethods"/>
</rule>
<rule ref="rulesets/java/design.xml">
<exclude name="TooFewBranchesForASwitchStatement"/>
</rule>
<rule ref="rulesets/java/empty.xml"/>
<rule ref="rulesets/java/strictexception.xml"/>
<rule ref="rulesets/java/strings.xml"/>
<rule ref="rulesets/java/typeresolution.xml"/>
<rule ref="rulesets/java/unnecessary.xml">
<exclude name="UselessParentheses"/>
</rule>
<rule ref="rulesets/java/unusedcode.xml"/>
<rule ref="rulesets/java/optimizations.xml">
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="MethodArgumentCouldBeFinal"/>
</rule></ruleset>
-
AdminQAPlug (QAPlug support, qaplug) commented
Yes, QAPlug supports both importing and exporting of the rules. You can find more information in the following tutorial: http://qaplug.com/about/tutorials/#tutorial3