forked from phoedos/pmd
Fixed XML schema usage in examples
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4384 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -48,11 +48,12 @@
|
||||
</subsection>
|
||||
<subsection name="Contributors">
|
||||
<ul>
|
||||
<li>Mohammad Farooq - Reported new JavaNCSS URL</li>
|
||||
<li>Jeff Jensen - Reported missing XML schema references in documentation, wrote new XML schema, 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>Christopher Stach - bug report for VariableNamingConventions, bug report for CallSuperInConstructor, many bug reports for rules that didn't handle JDK 1.5 constructs</li>
|
||||
<li>Matthew Harrah - noticed missing element in UseCorrectExceptionLogging definition, script bug report</li>
|
||||
<li>Mike Kaufman - Reported a bug in UnnecessaryCaseChange</li>
|
||||
<li><a href="http://www.cafeaulait.org/">Elliotte Rusty Harold</a> - reported bug in UseAssertSameInsteadOfAssertTrue, suggested creating a new ruleset containing rules in each release, UncommentedEmptyConstructor suggestions, noted missed case for UnusedFormalParameter, documentation suggestions, reported mistake in UnnecessaryLocalBeforeReturn message, bug report 1371757 for misleading AvoidSynchronizedAtMethodLevel example, bug report 1293277 for duplicated rule messages, bug report for ConstructorCallsOverridableMethod, suggestion for improving command line interface, mispeling report, suggestion for improving Designer startup script, "how to make a ruleset" documentation suggestions, noticed outdated Xerces jars, script renaming suggestions, UseLocaleWithCaseConversions rule suggestion</li>
|
||||
<li>Jeff Jensen - Wrote new XML schema, 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>David Karr - reported stale XPath documentation</li>
|
||||
<li>Jarkko Hietaniemin - rewrote most of cpd.sh, tweaked C/CPP grammar to allow $ in identifiers, several CPD documentation suggestions, noted missing CPD scripts in binary release</li>
|
||||
<li>Dawid Weiss - Reported bug in UnusedPrivateMethod</li>
|
||||
|
@ -13,10 +13,13 @@ Say you want to pick specific rules from various rule sets and customize them.
|
||||
<p>Use one of the current rulesets as an example. Copy and paste
|
||||
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"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<source><![CDATA[
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="Custom ruleset"
|
||||
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>
|
||||
This ruleset checks my code for bad stuff
|
||||
</description>
|
||||
@ -24,10 +27,13 @@ Say you want to pick specific rules from various rule sets and customize them.
|
||||
</subsection>
|
||||
<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"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<source><![CDATA[
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="Custom ruleset"
|
||||
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>
|
||||
This ruleset checks my code for bad stuff
|
||||
@ -66,10 +72,13 @@ Say you want to pick specific rules from various rule sets and customize them.
|
||||
</subsection>
|
||||
<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"?>
|
||||
<source><![CDATA[
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="mybraces"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
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>Just the braces rules I like</description>
|
||||
<rule ref="rulesets/braces.xml">
|
||||
<exclude name="WhileLoopsMustUseBracesRule"/>
|
||||
|
@ -190,9 +190,11 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule {
|
||||
<source>
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="customruleset"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<ruleset name="My custom 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">
|
||||
<rule name="WhileLoopsMustUseBracesRule"
|
||||
message="Avoid using 'while' statements without curly braces"
|
||||
class="WhileLoopsMustUseBracesRule">
|
||||
|
Reference in New Issue
Block a user