forked from phoedos/pmd
tweak
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@193 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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
33
pmd/rulesets/design.xml
Normal 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>
|
||||
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user