You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ra...@apache.org on 2005/08/27 02:43:37 UTC

svn commit: r240367 - in /jakarta/commons/sandbox/scxml/trunk: project.properties scxml-asl-header.txt scxml-checks.xml

Author: rahul
Date: Fri Aug 26 17:43:33 2005
New Revision: 240367

URL: http://svn.apache.org/viewcvs?rev=240367&view=rev
Log:
Use a customized set of checkstyle rules. These are the Sun checks with three changes as discussed on the dev list:

1) Use a regexp header check for ASL
2) Disable 'hide a field' check (lot of noise from setters)
3) Disable 'method design for extension' check

Added:
    jakarta/commons/sandbox/scxml/trunk/scxml-asl-header.txt   (with props)
    jakarta/commons/sandbox/scxml/trunk/scxml-checks.xml   (with props)
Modified:
    jakarta/commons/sandbox/scxml/trunk/project.properties

Modified: jakarta/commons/sandbox/scxml/trunk/project.properties
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/project.properties?rev=240367&r1=240366&r2=240367&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/project.properties (original)
+++ jakarta/commons/sandbox/scxml/trunk/project.properties Fri Aug 26 17:43:33 2005
@@ -20,4 +20,14 @@
 maven.xdoc.includeProjectDocumentation=yes
 
 maven.javadoc.links=http://java.sun.com/j2se/1.4.2/docs/api/
+
+### dev properties ###
 maven.changelog.factory=org.apache.maven.svnlib.SvnChangeLogFactory
+
+#maven.username=
+
+#maven.clover.license.path=
+
+maven.checkstyle.properties=scxml-checks.xml
+maven.checkstyle.header.file=scxml-asl-header.txt
+

Added: jakarta/commons/sandbox/scxml/trunk/scxml-asl-header.txt
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/scxml-asl-header.txt?rev=240367&view=auto
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/scxml-asl-header.txt (added)
+++ jakarta/commons/sandbox/scxml/trunk/scxml-asl-header.txt Fri Aug 26 17:43:33 2005
@@ -0,0 +1,17 @@
+^/\*$
+^ \*$
+^ \*   Copyright (\d{4}-)?\d{4} The Apache Software Foundation.$
+^ \*$
+^ \*  Licensed under the Apache License, Version 2.0 \(the "License"\);$
+^ \*  you may not use this file except in compliance with the License.$
+^ \*  You may obtain a copy of the License at$
+^ \*$
+^ \*      http://www.apache.org/licenses/LICENSE-2.0$
+^ \*$
+^ \*  Unless required by applicable law or agreed to in writing, software$
+^ \*  distributed under the License is distributed on an "AS IS" BASIS,$
+^ \*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.$
+^ \*  See the License for the specific language governing permissions and$
+^ \*  limitations under the License.$
+^ \*$
+^ \*/$

Propchange: jakarta/commons/sandbox/scxml/trunk/scxml-asl-header.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/scxml/trunk/scxml-asl-header.txt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: jakarta/commons/sandbox/scxml/trunk/scxml-checks.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/scxml-checks.xml?rev=240367&view=auto
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/scxml-checks.xml (added)
+++ jakarta/commons/sandbox/scxml/trunk/scxml-checks.xml Fri Aug 26 17:43:33 2005
@@ -0,0 +1,207 @@
+<?xml version="1.0"?>
+<!-- 
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+
+<!--
+
+  Checkstyle configuration that checks the sun coding conventions from:
+
+    - the Java Language Specification at
+      http://java.sun.com/docs/books/jls/second_edition/html/index.html
+
+    - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
+
+    - the Javadoc guidelines at
+      http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
+
+    - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
+
+    - some best practices
+
+  Checkstyle is very configurable. Be sure to read the documentation at
+  http://checkstyle.sf.net (or in your downloaded distribution).
+
+  Most Checks are configurable, be sure to consult the documentation.
+
+  To completely disable a check, just comment it out or delete it from the file.
+
+  Finally, it is worth reading the documentation.
+
+-->
+<!--
+
+  This ruleset is customized for Apache Jakarta Commons SCXML.
+
+  For changes to the defaults sun checks, search for string "Commons SCXML"
+
+-->
+<module name="Checker">
+
+    <!-- Checks that a package.html file exists for each package.     -->
+    <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
+    <module name="PackageHtml"/>
+
+    <!-- Checks whether files end with a new line.                        -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
+    <module name="NewlineAtEndOfFile"/>
+
+    <!-- Checks that property files contain the same keys.         -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+    <module name="Translation"/>
+
+
+    <module name="TreeWalker">
+
+        <property name="cacheFile" value="${checkstyle.cache.file}"/>
+
+        <!-- Checks for Javadoc comments.                     -->
+        <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+        <module name="JavadocMethod"/>
+        <module name="JavadocType"/>
+        <module name="JavadocVariable"/>
+        <module name="JavadocStyle"/>
+
+
+        <!-- Checks for Naming Conventions.                  -->
+        <!-- See http://checkstyle.sf.net/config_naming.html -->
+        <module name="ConstantName"/>
+        <module name="LocalFinalVariableName"/>
+        <module name="LocalVariableName"/>
+        <module name="MemberName"/>
+        <module name="MethodName"/>
+        <module name="PackageName"/>
+        <module name="ParameterName"/>
+        <module name="StaticVariableName"/>
+        <module name="TypeName"/>
+
+
+        <!-- Checks for Headers                              -->
+        <!-- See http://checkstyle.sf.net/config_header.html -->
+        <!-- Commons SCXML change # 1 :
+             Use the Regexp Header -->
+        <module name="RegexpHeader">
+            <!-- The follow property value demonstrates the ability     -->
+            <!-- to have access to ANT properties. In this case it uses -->
+            <!-- the ${basedir} property to allow Checkstyle to be run  -->
+            <!-- from any directory within a project. See property      -->
+            <!-- expansion,                                             -->
+            <!-- http://checkstyle.sf.net/config.html#properties        -->
+            <!-- <property                                              -->
+            <!--     name="headerFile"                                  -->
+            <!--     value="${basedir}/java.header"/>                   -->
+            <property name="headerFile" value="${checkstyle.header.file}"/>
+        </module>
+
+        <!-- Following interprets the header file as regular expressions. -->
+        <!-- <module name="RegexpHeader"/>                                -->
+
+
+        <!-- Checks for imports                              -->
+        <!-- See http://checkstyle.sf.net/config_import.html -->
+        <module name="AvoidStarImport"/>
+        <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+
+
+        <!-- Checks for Size Violations.                    -->
+        <!-- See http://checkstyle.sf.net/config_sizes.html -->
+        <module name="FileLength"/>
+        <module name="LineLength"/>
+        <module name="MethodLength"/>
+        <module name="ParameterNumber"/>
+
+
+        <!-- Checks for whitespace                               -->
+        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+        <module name="EmptyForIteratorPad"/>
+        <module name="NoWhitespaceAfter"/>
+        <module name="NoWhitespaceBefore"/>
+        <module name="OperatorWrap"/>
+        <module name="ParenPad"/>
+        <module name="TypecastParenPad"/>
+        <module name="TabCharacter"/>
+        <module name="WhitespaceAfter"/>
+        <module name="WhitespaceAround"/>
+
+
+        <!-- Modifier Checks                                    -->
+        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+        <module name="ModifierOrder"/>
+        <module name="RedundantModifier"/>
+
+
+        <!-- Checks for blocks. You know, those {}'s         -->
+        <!-- See http://checkstyle.sf.net/config_blocks.html -->
+        <module name="AvoidNestedBlocks"/>
+        <module name="EmptyBlock"/>
+        <module name="LeftCurly"/>
+        <module name="NeedBraces"/>
+        <module name="RightCurly"/>
+
+
+        <!-- Checks for common coding problems               -->
+        <!-- See http://checkstyle.sf.net/config_coding.html -->
+        <module name="AvoidInlineConditionals"/>
+        <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->
+        <module name="EmptyStatement"/>
+        <module name="EqualsHashCode"/>
+        <!-- Commons SCXML change # 2 :
+             Turn off the hidden field check
+             based on discussion on commons-dev AT jakarta.apache.org
+             The code uses same names for arguments
+             in side-effect free setters. -->
+        <!--module name="HiddenField"/-->
+        <module name="IllegalInstantiation"/>
+        <module name="InnerAssignment"/>
+        <module name="MagicNumber"/>
+        <module name="MissingSwitchDefault"/>
+        <module name="RedundantThrows"/>
+        <module name="SimplifyBooleanExpression"/>
+        <module name="SimplifyBooleanReturn"/>
+
+        <!-- Checks for class design                         -->
+        <!-- See http://checkstyle.sf.net/config_design.html -->
+        <!-- Commons SCXML change # 3 :
+             Turn off the design for extension check 
+             based on discussion on commons-dev AT jakarta.apache.org -->
+        <!--module name="DesignForExtension"/-->
+        <module name="FinalClass"/>
+        <module name="HideUtilityClassConstructor"/>
+        <module name="InterfaceIsType"/>
+        <module name="VisibilityModifier"/>
+
+
+        <!-- Miscellaneous other checks.                   -->
+        <!-- See http://checkstyle.sf.net/config_misc.html -->
+        <module name="ArrayTypeStyle"/>
+        <module name="FinalParameters"/>
+        <module name="GenericIllegalRegexp">
+            <property name="format" value="\s+$"/>
+            <property name="message" value="Line has trailing spaces."/>
+        </module>
+        <module name="TodoComment"/>
+        <module name="UpperEll"/>
+
+    </module>
+
+</module>

Propchange: jakarta/commons/sandbox/scxml/trunk/scxml-checks.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/scxml/trunk/scxml-checks.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org