Added schema ref to ruleset examples

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4269 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2006-02-27 14:32:13 +00:00
parent 5cb6237b68
commit 74162a9857
4 changed files with 19 additions and 4 deletions

View File

@ -48,9 +48,9 @@
</subsection>
<subsection name="Contributors">
<ul>
<li>Jeff Jensen - Reported missing schema refs in example rulesets, suggested posting XML schema on PMD site, discussion of 'comments in catch block' feature, suggested description attribute in property element</li>
<li>Chris Erskine - found bad link, documentation suggestions</li>
<li>Wouter Zelle - Rewrote PositionLiteralsFirstInComparisons in XPath, Renderer improvement suggestions, wrote NonThreadSafeSingleton rule, wrote DefaultPackage rule, worked thru ASTMethodDeclaration.isSyntacticallyX design, reported docs bug 1292689 for UnnecessaryLocalBeforeReturn, reported leftover ExceptionTypeChecking source file, rewrote UselessOverridingMethod in Java, UselessOverridingMethod rule, ProperLogger rule, nifty code to allow variables in XPath rules, externalInfoUrl data for all rules in basic and unusedcode rulesets, some very nifty XSLT, improvements to UseCorrectExceptionLogging, designed and implemented the "externalInfoUrl" feature in the rule definitions, fixed a devious bug in RuleSetFactory, AvoidPrintStackTrace, initial implementation of SimplifyConditional</li>
<li>Jeff Jensen - Suggested posting XML schema on PMD site, discussion of 'comments in catch block' feature, suggested description attribute in property element</li>
<li>mhilpert - Reported bugs in UseIndexOfChar and LoggerIsNotStaticFinal</li>
<li>David Corley - Priority filtering XSLT, reported release packaging problem, implemented nifty Javascript folding for XML report, <a href="http://tomcopeland.blogs.com/juniordeveloper/2005/12/demo_of_some_ni.html">demo is here</a></li>
<li>Jon Doh - Reported parser bug</li>

View File

@ -14,7 +14,9 @@ Say you want to pick specific rules from various rule sets and customize them.
it into your new file, delete all the old rules from it, and change
the name and description. Like this:</p>
<source><![CDATA[<?xml version="1.0"?>
<ruleset name="customruleset">
<ruleset name="customruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
This ruleset checks my code for bad stuff
</description>
@ -23,7 +25,9 @@ Say you want to pick specific rules from various rule sets and customize them.
<subsection name="Add some rule references to it">
<p>After you add these references it'll look something like this:</p>
<source><![CDATA[<?xml version="1.0"?>
<ruleset name="customruleset">
<ruleset name="customruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
This ruleset checks my code for bad stuff
@ -63,7 +67,9 @@ Say you want to pick specific rules from various rule sets and customize them.
<subsection name="Excluding rules from a ruleset">
<p>You can also make a custom ruleset that excludes rules, like this:</p>
<source><![CDATA[<?xml version="1.0"?>
<ruleset name="mybraces">
<ruleset name="mybraces"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Just the braces rules I like</description>
<rule ref="rulesets/braces.xml">
<exclude name="WhileLoopsMustUseBracesRule"/>
@ -90,6 +96,7 @@ Say you want to pick specific rules from various rule sets and customize them.
them to
<a href="http://sourceforge.net/forum/forum.php?forum_id=188192">the forum</a>. Thanks!
</p>
<p>Finally, for many more details on building custom rulesets, pick up <a href="http://pmdapplied.com/">PMD Applied</a>!</p>
</subsection>
</section>
</body>

View File

@ -190,6 +190,9 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule {
<source>
&lt;?xml version="1.0"?>
&lt;ruleset name="customruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
&lt;rule name="WhileLoopsMustUseBracesRule"
message="Avoid using 'while' statements without curly braces"
class="WhileLoopsMustUseBracesRule">
@ -298,6 +301,7 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule {
moved into one of the core rulesets.</p>
<p>Or, if you can improve one of the existing rules, that'd be great too! Thanks!
</p>
<p>Finally, for many more details on writing rules, pick up <a href="http://pmdapplied.com/">PMD Applied</a>!</p>
</subsection>
</section>
</body>

View File

@ -145,7 +145,11 @@ Writing PMD rules with XPath can be a bit easier than writing rules with Java co
<p>I must recommend at this point that you experiment with Designer putting
the final modifier to the Factory and verifying that the results produced
are those expected.</p>
<p>Finally, for many more details on writing XPath rules, pick up <a href="http://pmdapplied.com/">PMD Applied</a>!</p>
</subsection>
</section>
</body>