From: <tri...@us...> - 2007-10-02 21:06:33
|
Revision: 24 http://staticwiki.svn.sourceforge.net/staticwiki/?rev=24&view=rev Author: triathlon98 Date: 2007-10-02 14:06:31 -0700 (Tue, 02 Oct 2007) Log Message: ----------- improve checkstyle configuration Modified Paths: -------------- trunk/config/checkstyle.xml trunk/config/staticwiki-header.txt Modified: trunk/config/checkstyle.xml =================================================================== --- trunk/config/checkstyle.xml 2007-09-26 08:17:22 UTC (rev 23) +++ trunk/config/checkstyle.xml 2007-10-02 21:06:31 UTC (rev 24) @@ -1,52 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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. - --> <module name="Checker"> @@ -61,148 +20,202 @@ <!-- Checks that property files contain the same keys. --> <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> - <module name="Translation"/> + <!--<module name="Translation"/>--> + <!-- duplicate code, see http://checkstyle.sourceforge.net/config_duplicates.html --> + <!--<module name="StrictDuplicateCode"/>--> + <module name="TreeWalker"> <property name="cacheFile" value="${checkstyle.cache.file}"/> + <property name="tabWidth" value="4"/> + <property name="charset" value="UTF-8"/> - <!-- ************************************************************** --> - <!-- Checks that are different from the sun coding conventions ones --> - <!-- ************************************************************** --> - <property name="tabWidth" value="4"/> + <!-- Block checks, see http://checkstyle.sourceforge.net/config_blocks.html --> + <module name="LeftCurly"> - <property name="option" value="nl"/> + <property name="option" value="nl"/> </module> <module name="RightCurly"> - <property name="option" value="alone"/> + <property name="option" value="alone"/> </module> - <module name="LineLength"> - <property name="ignorePattern" value="@version"/> - <property name="max" value="132"/> - </module> - <module name="MemberName"> - <property name="format" value="^[a-z]+_*[a-zA-Z0-9]*$"/> - </module> - <module name="StaticVariableName"> - <property name="format" value="^[a-z]+_*[a-zA-Z0-9]*$"/> - </module> - <module name="ConstantName"> - <property name="format" value="^(([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|log)$"/> - </module> - <module name="ParameterName"> - <property name="format" value="^[a-z]+_*[a-zA-Z0-9]*$"/> - </module> + <!--<module name="EmptyBlock"/>--> + <module name="AvoidNestedBlocks"/> + <module name="NeedBraces"/> - <!-- ************************************************************** --> - <!-- Default Sun coding conventions checks --> - <!-- ************************************************************** --> + <!-- Javadoc comments checks, see http://checkstyle.sourceforge.net/config_javadoc.html --> - <!-- Checks for Javadoc comments. --> - <!-- See http://checkstyle.sf.net/config_javadoc.html --> <module name="JavadocMethod"> - <property name="excludeScope" value="private"/> + <property name="excludeScope" value="private"/> </module> <module name="JavadocType"/> - <module name="JavadocVariable"/> + <!--<module name="JavadocVariable"/>--> + <!--<module name="JavadocStyle"/>--> + <!-- Naming conventions, see http://checkstyle.sourceforge.net/config_naming.html --> - <!-- Checks for Naming Conventions. --> - <!-- See http://checkstyle.sf.net/config_naming.html --> + <!--<module name="AbstractClassName"/>--> + <!--<module name="LocalFinalVariableName"/>--> + <module name="ConstantName"> + <property name="format" value="^(([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|log)$"/> + </module> <module name="LocalFinalVariableName"/> <module name="LocalVariableName"/> + <module name="MemberName"/> <module name="MethodName"/> <module name="PackageName"/> + <module name="ParameterName"/> + <module name="StaticVariableName"/> <module name="TypeName"/> + <!-- header, see http://checkstyle.sourceforge.net/config_header.html --> - <!-- Checks for Headers --> - <!-- See http://checkstyle.sf.net/config_header.html --> - <module name="RegexpHeader"> + <module name="Header"> <!-- 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. --> - <property name="headerFile" value="config/staticwiki-header.txt"/> + <property name="headerFile" value="config/equanda-header.txt"/> </module> - <!-- Following interprets the header file as regular expressions. --> - <!-- <module name="RegexpHeader"/> --> + <!-- imports, see http://checkstyle.sourceforge.net/config_imports.html --> - - <!-- Checks for imports --> - <!-- See http://checkstyle.sf.net/config_import.html --> - <module name="AvoidStarImport"/> - <module name="IllegalImport"/> <!-- defaults to sun.* packages --> + <!--<module name="AvoidStarImport"/>--> + <module name="IllegalImport"/> <module name="RedundantImport"/> <module name="UnusedImports"/> + <module name="ImportOrder"/> + <!--<module name="ImportControl"/>--> + <!-- size violations, see http://checkstyle.sourceforge.net/config_sizes.html --> - <!-- Checks for Size Violations. --> - <!-- See http://checkstyle.sf.net/config_sizes.html --> + <module name="LineLength"> + <property name="max" value="120"/> + </module> <module name="FileLength"/> <module name="MethodLength"/> <module name="ParameterNumber"/> + <!-- whitespace, see http://checkstyle.sourceforge.net/config_whitespace.html --> - <!-- Checks for whitespace --> - <!-- See http://checkstyle.sf.net/config_whitespace.html --> - <module name="EmptyForIteratorPad"/> - <module name="NoWhitespaceAfter"/> - <module name="NoWhitespaceBefore"/> + <module name="EmptyForInitializerPad"> + <property name="option" value="space"/> + </module> + <module name="EmptyForIteratorPad"> + <property name="option" value="space"/> + </module> + <module name="MethodParamPad"/> + <module name="NoWhitespaceAfter"> + <!-- Default tokens and additional GENERIC_START --> + <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS, GENERIC_START"/> + </module> + <module name="NoWhitespaceBefore"> + <!-- Default tokens and additional GENERIC_START and GENERIC_END --> + <property name="tokens" value="SEMI, POST_DEC, POST_INC, GENERIC_START, GENERIC_END"/> + </module> <module name="OperatorWrap"/> - <module name="ParenPad"/> + <module name="ParenPad"> + <property name="option" value="space"/> + </module> + <module name="TypecastParenPad"/> <module name="TabCharacter"/> + <module name="WhitespaceAfter"> + <!-- Default tokens and additional GENERIC_END --> + <property name="tokens" value="COMMA, SEMI, TYPECAST, GENERIC_END"/> + </module> + <module name="WhitespaceAround"> + <!-- Default tokens without GENERIC_START and GENERIC_END --> + <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND, WILDCARD_TYPE"/> + </module> + <module name="TabCharacter"/> <module name="WhitespaceAfter"/> - <module name="WhitespaceAround"/> + <module name="WhitespaceAround"> + <property name="allowEmptyConstructors" value="true"/> + <property name="allowEmptyMethods" value="true"/> + </module> + <!-- modifiers, see http://checkstyle.sourceforge.net/config_modifier.html --> - <!-- Modifier Checks --> - <!-- See http://checkstyle.sf.net/config_modifiers.html --> <module name="ModifierOrder"/> <module name="RedundantModifier"/> - <module name="EmptyBlock"/> - <module name="NeedBraces"/> + <!-- coding , see http://checkstyle.sourceforge.net/config_coding.html --> - <!-- Checks for common coding problems --> - <!-- See http://checkstyle.sf.net/config_coding.html --> - <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> + <module name="ArrayTrailingComma"/> + <!--<module name="AvoidInlineConditionals"/>--> + <module name="CovariantEquals"/> + <module name="DoubleCheckedLocking"/> <module name="EmptyStatement"/> <module name="EqualsHashCode"/> - <module name="FallThrough"/> + <module name="FinalLocalVariable"/> <module name="HiddenField"> - <property name="ignoreConstructorParameter" value="true"/> - <property name="ignoreSetter" value="true"/> + <property name="ignoreConstructorParameter" value="true"/> + <property name="ignoreSetter" value="true"/> </module> - <module name="IllegalInstantiation"/> + <module name="IllegalInstantiation"> + <property name="classes" value="java.lang.Boolean"/> + </module> + <module name="IllegalToken"> + <property name="tokens" value="LITERAL_NATIVE"/> + </module> + <module name="IllegalTokenText"/> <module name="InnerAssignment"/> <module name="MagicNumber"/> <module name="MissingSwitchDefault"/> -<!-- <module name="OneMethodPrivateField" /> --> + <module name="ModifiedControlVariable"/> <module name="RedundantThrows"/> <module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanReturn"/> + <module name="StringLiteralEquality"/> + <!--<module name="NestedIfDepth"/>--> + <!--<module name="NestedTryDepth"/>--> + <module name="SuperClone"/> + <module name="SuperFinalize"/> + <!--<module name="IllegalCatch"/>--> + <!--<module name="IllegalThrows"/>--> + <module name="PackageDeclaration"/> + <module name="JUnitTestCase"/> + <module name="ReturnCount"/> + <module name="IllegalType"/> + <module name="DeclarationOrder"/> + <module name="ParameterAssignment"/> + <module name="ExplicitInitialization"/> + <module name="DefaultComesLast"/> + <!--<module name="MissingCtor"/>--> + <module name="FallThrough"/> + <module name="MultipleStringLiterals"/> + <!--<module name="MultipleVariableDeclarations"/>--> + <!--<module name="RequireThis"/>--> + <!--<module name="UnnecessaryParentheses"/>--> - <!-- Checks for class design --> - <!-- See http://checkstyle.sf.net/config_design.html --> + <!-- class design, see http://checkstyle.sourceforge.net/config_design.html --> + + <module name="VisibilityModifier"> + <property name="protectedAllowed" value="true"/> + </module> <module name="FinalClass"/> + <module name="InterfaceIsType"/> <module name="HideUtilityClassConstructor"/> - <module name="VisibilityModifier"> - <module name="MissingSwitchDefault"/> - <property name="protectedAllowed" value="true"/> - </module> + <!--<module name="DesignForExtension"/>--> + <!--<module name="MutableException"/>--> + <!--<module name="ThrowsCount"/>--> + <!-- misc, see http://checkstyle.sourceforge.net/config_misc.html --> - <!-- 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="UncommentedMain"/>--> <module name="UpperEll"/> + <module name="ArrayTypeStyle"/> + <!--<module name="FinalParameters"/>--> + <!--<module name="DescendantToken"/>--> + <!--<module name="Indentation"/>--> + <!--<module name="TrailingComment"/>--> + <!--<module name="RequiredRegexp"/>--> + <!--<module name="Regexp"/>--> </module> Modified: trunk/config/staticwiki-header.txt =================================================================== --- trunk/config/staticwiki-header.txt 2007-09-26 08:17:22 UTC (rev 23) +++ trunk/config/staticwiki-header.txt 2007-10-02 21:06:31 UTC (rev 24) @@ -1,11 +1,11 @@ -^/\*\**\s*$ -^ \* This file is part of the staticwiki project.*\s*$ -^ \**\s*$ -^ \* The contents of this file are subject to the GNU Lesser General Public License Version 2.1 or later (the "LGPL")*\s*$ -^ \* (the "License"); you may not use this file except in compliance with the License.*\s*$ -^ \* You may obtain a copy of the License at http://www.fsf.org/licenses/lgpl.html*\s*$ -^ \**\s*$ -^ \* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF*\s*$ -^ \* ANY KIND, either express or implied. See the License for the specific language governing rights and*\s*$ -^ \* limitations under the License.*\s*$ -^ \*/*\s*$ \ No newline at end of file +/** + * This file is part of the staticwiki project. + * + * The contents of this file are subject to the GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * (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.fsf.org/licenses/lgpl.html + * + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + * ANY KIND, either express or implied. See the License for the specific language governing rights and + * limitations under the License. + */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |