git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@193 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-07-03 13:54:09 +00:00
parent f5693f2850
commit d4ca53cbce
5 changed files with 38 additions and 48 deletions

View File

@ -29,9 +29,9 @@
<target name="pmd">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
<pmd reportFile="c:\foo.html" verbose="true" rulesetfiles="rulesets/basic.xml,rulesets/cougaar.xml" format="html">
<fileset dir="c:\data\pmd\pmd\src">
<!--<fileset dir="c:\j2sdk1.4.0\src">-->
<pmd reportFile="c:\jdk14.HTML" verbose="false" rulesetfiles="rulesets/unusedcode.xml" format="html">
<!--<fileset dir="c:\data\pmd\pmd\src">-->
<fileset dir="c:\j2sdk1.4.0\src">
<include name="**/*.java"/>
</fileset>
</pmd>

View File

@ -1,10 +1,9 @@
??? - 0.3:
July 03 2002 - 0.3:
Added new rules: UseSingletonRule, ShortVariableRule, LongVariableRule, ShortMethodNameRule
Removed the 'text' report format.
Moved rules into rulesets which are defined in XML files.
Added a 'failonerror' attribute to the Ant task.
June 27 2002 - 0.2:
Added new rules: IfElseStmtsMustUseBracesRule, EmptyWhileStmtRule
Modified command line interface to accept a rule set

View File

@ -162,27 +162,6 @@ public class ShortMethod {
</example>
</rule>
<rule name="UseSingletonRule"
message="All methods are static. Consider using Singleton instead."
class="net.sourceforge.pmd.rules.design.UseSingletonRule">
<description>
If you have a class that has nothing but static methods, consider making it a Singleton
</description>
<example>
<![CDATA[
public class MaybeASingleton {
public static void foo() {
// etc
}
public static void bar() {
// etc
}
}
]]>
</example>
</rule>
</ruleset>

33
pmd/rulesets/design.xml Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<ruleset name="design">
<description>
The Design Ruleset contains a collection of rules that find questionable designs.
</description>
<rule name="UseSingletonRule"
message="All methods are static. Consider using Singleton instead."
class="net.sourceforge.pmd.rules.design.UseSingletonRule">
<description>
If you have a class that has nothing but static methods, consider making it a Singleton
</description>
<example>
<![CDATA[
public class MaybeASingleton {
public static void foo() {
// etc
}
public static void bar() {
// etc
}
}
]]>
</example>
</rule>
</ruleset>

View File

@ -2,7 +2,7 @@
<ruleset name="ticbuild">
<description>
These are rules which apply to the build at https://cvs.ultralog.net
These are rules which apply to the build at https://cvs.ultralog.net. Actually, that build contains this ruleset as well as unusedcode.xml, design.xml, and cougaar.xml
</description>
<rule name="EmptyCatchBlock"
@ -94,27 +94,6 @@ while (a == b) {
</example>
</rule>
<rule name="UseSingletonRule"
message="All methods are static. Consider using Singleton instead."
class="net.sourceforge.pmd.rules.design.UseSingletonRule">
<description>
If you have a class that has nothing but static methods, consider making it a Singleton
</description>
<example>
<![CDATA[
public class MaybeASingleton {
public static void foo() {
// etc
}
public static void bar() {
// etc
}
}
]]>
</example>
</rule>
</ruleset>