Changed configuration XML element "config" to "module".

Dropped suffix "Check" in Check configurations.
This commit is contained in:
Rick Giles 2002-12-16 00:22:14 +00:00
parent 04483a77e8
commit 4564aecb5c
10 changed files with 115 additions and 115 deletions

View File

@ -1,99 +1,99 @@
<?xml version="1.0"?>
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">
<config name="configuration">
<module name="Checker">
<property name="tabWidth" value="4" />
<config name="PackageHtmlCheck"/>
<module name="PackageHtml"/>
<config name="TranslationCheck"/>
<module name="Translation"/>
<config name="TreeWalker">
<config name="AvoidStarImport"/>
<config name="ConstantNameCheck"/>
<config name="EmptyBlockCheck"/>
<config name="EqualsHashCodeCheck"/>
<config name="FileLengthCheck"/>
<config name="HeaderCheck">
<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="ConstantName"/>
<module name="EmptyBlock"/>
<module name="EqualsHashCode"/>
<module name="FileLength"/>
<module name="Header">
<property name="headerFile" value="${checkstyle.header.file}"/>
</config>
</module>
<config name="IllegalImportCheck"/>
<config name="IllegalInstantiationCheck"/>
<config name="InnerAssignmentCheck"/>
<config name="JavadocTypeCheck">
<property name="authorFormat" value="\S"/>
</config>
<config name="JavadocMethodCheck">
<module name="IllegalImport"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="JavadocType">
<property name="authorFormat" value="\S"/>
</module>
<module name="JavadocMethod">
<property name="checkUnusedThrows" value="true"/>
</config>
<config name="JavadocVariableCheck"/>
</module>
<module name="JavadocVariable"/>
<config name="LineLengthCheck">
<module name="LineLength">
<property name="ignorePattern" value="^ *\* *[^ ]+$"/>
</config>
</module>
<config name="LocalFinalVariableNameCheck"/>
<config name="LocalVariableNameCheck"/>
<config name="MemberNameCheck">
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName">
<property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/>
</config>
<config name="MethodLeftCurlyCheck">
</module>
<module name="MethodLeftCurly">
<property name="option" value="nl"/>
</config>
<config name="MethodLengthCheck"/>
<config name="MethodNameCheck"/>
<config name="ModifierCheck"/>
<config name="NeedBracesCheck"/>
<config name="NoWhitespaceAfterCheck"/>
<config name="NoWhitespaceBeforeCheck"/>
<config name="NoWhitespaceAfterCheck">
</module>
<module name="MethodLength"/>
<module name="MethodName"/>
<module name="Modifier"/>
<module name="NeedBraces"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="true"/>
</config>
<config name="NoWhitespaceBeforeCheck">
</module>
<module name="NoWhitespaceBefore">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="true"/>
</config>
<config name="OperatorWrapCheck"/>
</module>
<module name="OperatorWrap"/>
<config name="OperatorWrapCheck">
<module name="OperatorWrap">
<property name="tokens" value="ASSIGN, DIV_ASSIGN, PLUS_ASSIGN, MINUS_ASSIGN, STAR_ASSIGN, MOD_ASSIGN, SR_ASSIGN, BSR_ASSIGN, SL_ASSIGN, BXOR_ASSIGN, BOR_ASSIGN, BAND_ASSIGN"/>
<property name="option" value="eol"/>
</config>
</module>
<config name="OtherLeftCurlyCheck">
<module name="OtherLeftCurly">
<property name="option" value="nlow"/>
</config>
<config name="PackageNameCheck"/>
<config name="ParameterNameCheck">
</module>
<module name="PackageName"/>
<module name="ParameterName">
<property name="format" value="^a[A-Z][a-zA-Z0-9]*$"/>
</config>
<config name="ParameterNumberCheck"/>
<config name="ParenPadCheck"/>
<config name="PublicMemberNameCheck"/>
<config name="RedundantImportCheck"/>
<config name="RedundantModifierCheck"/>
<config name="RightCurlyCheck">
</module>
<module name="ParameterNumber"/>
<module name="ParenPad"/>
<module name="PublicMemberName"/>
<module name="RedundantImport"/>
<module name="RedundantModifier"/>
<module name="RightCurly">
<property name="option" value="alone"/>
</config>
<config name="SimplifyBooleanExpressionCheck"/>
<config name="SimplifyBooleanReturnCheck"/>
<config name="StaticVariableNameCheck">
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StaticVariableName">
<property name="format" value="^s[A-Z][a-zA-Z0-9]*$"/>
</config>
<config name="TabCharacterCheck"/>
<config name="TypeLeftCurlyCheck">
</module>
<module name="TabCharacter"/>
<module name="TypeLeftCurly">
<property name="option" value="nl"/>
</config>
<config name="TypeNameCheck"/>
<config name="UnusedImportsCheck"/>
<config name="UpperEllCheck"/>
<config name="VisibilityModifierCheck"/>
<config name="WhitespaceAfterCheck"/>
<config name="WhitespaceAroundCheck"/>
</config>
</config>
</module>
<module name="TypeName"/>
<module name="UnusedImports"/>
<module name="UpperEll"/>
<module name="VisibilityModifier"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
</module>
</module>

View File

@ -93,7 +93,7 @@ class ConfigurationLoader
throws SAXException
{
// TODO: debug logging for support puposes
if (aQName.equals("config")) {
if (aQName.equals("module")) {
//create configuration
final String name = aAtts.getValue("name");
final DefaultConfiguration conf = new DefaultConfiguration(name);
@ -134,7 +134,7 @@ class ConfigurationLoader
String aLocalName,
String aQName)
{
if (aQName.equals("config")) {
if (aQName.equals("module")) {
mConfigStack.pop();
}
}

View File

@ -2,14 +2,14 @@
<!-- Add the following to any file that is to be validated against this DTD:
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">
-->
<!ELEMENT config (config|property)*>
<!ATTLIST config name NMTOKEN #REQUIRED>
<!ELEMENT module (module|property)*>
<!ATTLIST module name NMTOKEN #REQUIRED>
<!ELEMENT property EMPTY>
<!ATTLIST property

View File

@ -1,30 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">
<config name="configuration">
<module name="Checker">
<property name="tabWidth" value="4" />
<property name="basedir" value="${checkstyle.basedir}" />
<config name="TreeWalker">
<config name="AvoidStarImport"/>
<config name="MemberNameCheck">
<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="MemberName">
<property name="format" value="^m_[a-zA-Z0-9]*$"/>
</config>
</module>
<property name="testName" value="testValue" />
<config name="ConstantNameCheck"/>
<config name="EmptyBlockCheck"/>
<config name="EqualsHashCodeCheck"/>
<config name="FileLengthCheck"/>
<config name="NoWhitespaceAfterCheck">
<module name="ConstantName"/>
<module name="EmptyBlock"/>
<module name="EqualsHashCode"/>
<module name="FileLength"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="DOT"/>
<property name="allowLineBreaks" value="true"/>
</config>
<config name="GenericIllegalRegexpCheck">
</module>
<module name="GenericIllegalRegexp">
<property name="format" value="System.out.println"/>
</config>
</config>
<config name="PackageHtmlCheck"/>
<config name="TranslationCheck"/>
</config>
</module>
</module>
<module name="PackageHtml"/>
<module name="Translation"/>
</module>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">
<config name="configuration">
</config>
<module name="Checker">
</module>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">
<config nam="configuration">
<module nam="Checker">
<property name="tabWidth" value="4"/>
</config>
</module>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">
<config name="configuration">
<module name="Checker">
<property nam="tabWidth" value="4"/>
</config>
</module>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config PUBLIC
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.0//EN"
"http://www.puppycrawl.com/dtds/configuration_1_0.dtd">
<config name="configuration">
<module name="Checker">
<property name="tabWidth" valu="4"/>
</config>
</module>

View File

@ -33,7 +33,7 @@ public class ConfigurationLoaderTest extends TestCase
{
final DefaultConfiguration config =
(DefaultConfiguration) loadConfiguration("empty_configuration.xml");
verifyConfigNode(config, "configuration", 0, new Properties());
verifyConfigNode(config, "Checker", 0, new Properties());
}
public void testMissingPropertyName()
@ -68,13 +68,13 @@ public class ConfigurationLoaderTest extends TestCase
{
try {
loadConfiguration("missing_config_name.xml");
fail("missing config name");
fail("missing module name");
}
catch (CheckstyleException ex) {
assertTrue(
ex.getMessage().endsWith(
"Attribute \"name\" is required and must be specified "
+ "for element type \"config\"."));
+ "for element type \"module\"."));
}
}
@ -82,13 +82,13 @@ public class ConfigurationLoaderTest extends TestCase
{
try {
loadConfiguration("missing_config_parent.xml");
fail("missing config parent");
fail("missing module parent");
}
catch (CheckstyleException ex) {
assertTrue(
ex.getMessage().endsWith(
"Document root element \"property\", must match DOCTYPE "
+ "root \"config\"."));
+ "root \"module\"."));
}
}
@ -105,15 +105,15 @@ public class ConfigurationLoaderTest extends TestCase
final Properties atts = new Properties();
atts.put("tabWidth", "4");
atts.put("basedir", "basedir");
verifyConfigNode(config, "configuration", 3, atts);
verifyConfigNode(config, "Checker", 3, atts);
//verify children
final Configuration[] children = config.getChildren();
atts.clear();
verifyConfigNode(
(DefaultConfiguration) children[1], "PackageHtmlCheck", 0, atts);
(DefaultConfiguration) children[1], "PackageHtml", 0, atts);
verifyConfigNode(
(DefaultConfiguration) children[2], "TranslationCheck", 0, atts);
(DefaultConfiguration) children[2], "Translation", 0, atts);
atts.put("testName", "testValue");
verifyConfigNode(
(DefaultConfiguration) children[0],
@ -132,7 +132,7 @@ public class ConfigurationLoaderTest extends TestCase
atts.put("format", "System.out.println");
verifyConfigNode(
(DefaultConfiguration) grandchildren[grandchildren.length - 1],
"GenericIllegalRegexpCheck",
"GenericIllegalRegexp",
0,
atts);
atts.clear();
@ -140,7 +140,7 @@ public class ConfigurationLoaderTest extends TestCase
atts.put("allowLineBreaks", "true");
verifyConfigNode(
(DefaultConfiguration) grandchildren[6],
"NoWhitespaceAfterCheck",
"NoWhitespaceAfter",
0,
atts);
}