summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.xml3
-rw-r--r--pmd-ruleset.xml67
2 files changed, 68 insertions, 2 deletions
diff --git a/build.xml b/build.xml
index e8c75e8..065cdef 100644
--- a/build.xml
+++ b/build.xml
@@ -144,8 +144,7 @@
</path>
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd-jar"/>
<pmd shortFilenames="true">
- <ruleset>rulesets/java/basic.xml</ruleset>
- <ruleset>java-basic</ruleset>
+ <ruleset>pmd-ruleset.xml</ruleset>
<formatter type="xml" toFile="pmd.xml" />
<fileset dir="${src}">
<include name="**/*.java"/>
diff --git a/pmd-ruleset.xml b/pmd-ruleset.xml
new file mode 100644
index 0000000..5a84d16
--- /dev/null
+++ b/pmd-ruleset.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ruleset name="Stroke rules" xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+ <description>
+ Rules we don't hate too much.
+ </description>
+ <rule ref="rulesets/java/basic.xml">
+ <exclude name="CollapsibleIfStatements"/>
+ <exclude name="EmptyCatchBlock"/>
+ <!-- <exclude name="AvoidThreadGroup"/>-->
+ </rule>
+ <rule ref="rulesets/java/braces.xml"/>
+ <rule ref="rulesets/java/clone.xml">
+ <!--<exclude name="CloneThrowsCloneNotSupportedException"/>-->
+ </rule>
+ <rule ref="rulesets/java/controversial.xml">
+ <exclude name="DataflowAnomalyAnalysis"/>
+ <exclude name="AvoidFinalLocalVariable"/>
+ <exclude name="OnlyOneReturn"/>
+ <exclude name="NullAssignment"/>
+ <exclude name="AtLeastOneConstructor"/>
+ <exclude name="AssignmentInOperand"/>
+ <!--<exclude name="AvoidUsingNativeCode"/>-->
+ <exclude name="DefaultPackage"/>
+ <exclude name="AvoidLiteralsInIfCondition"/>
+ <exclude name="UseConcurrentHashMap"/> <!-- Disabling this, because we don't have concurrency -->
+ </rule>
+ <rule ref="rulesets/java/coupling.xml">
+ <!--<exclude name="ExcessiveImports"/>-->
+ <exclude name="CouplingBetweenObjects"/>
+ </rule>
+ <rule ref="rulesets/java/design.xml">
+ <exclude name="SwitchStmtsShouldHaveDefault"/>
+ <exclude name="UncommentedEmptyMethod"/>
+ <exclude name="UncommentedEmptyConstructor"/>
+ <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
+ <exclude name="AvoidDeeplyNestedIfStmts"/>
+ <exclude name="ConfusingTernary"/>
+ <exclude name="PreserveStackTrace"/>
+ </rule>
+ <rule ref="rulesets/java/finalizers.xml"/>
+ <rule ref="rulesets/java/imports.xml"/>
+ <rule ref="rulesets/java/migrating.xml"/>
+ <rule ref="rulesets/java/naming.xml">
+ <exclude name="ShortVariable"/>
+ <exclude name="ShortMethodName"/>
+ <exclude name="LongVariable"/>
+ <exclude name="AvoidFieldNameMatchingTypeName"/>
+ <exclude name="AbstractNaming"/>
+ <!-- Excluded for the Tcl stuff -->
+ <exclude name="MethodNamingConventions"/>
+ </rule>
+ <rule ref="rulesets/java/optimizations.xml">
+ <!--<exclude name="LocalVariableCouldBeFinal"/>-->
+ <!--<exclude name="MethodArgumentCouldBeFinal"/>-->
+ <exclude name="AvoidInstantiatingObjectsInLoops"/>
+ <exclude name="UseStringBufferForStringAppends"/>
+ </rule>
+ <rule ref="rulesets/java/strictexception.xml">
+ <!--<exclude name="SignatureDeclareThrowsException"/>-->
+ <!--<exclude name="ExceptionAsFlowControl"/>-->
+ </rule>
+ <rule ref="rulesets/java/strings.xml">
+ <!--<exclude name="AvoidDuplicateLiterals"/>-->
+ <!--<exclude name="InsufficientStringBufferDeclaration"/>-->
+ </rule>
+ <rule ref="rulesets/java/unusedcode.xml"/>
+</ruleset>