[Plexus-svn] SF.net SVN: plexus:[876] trunk/plexus-graph/src/main/config/checkstyle/ checkstyle.xml
Status: Alpha
Brought to you by:
rconner
From: <rc...@us...> - 2010-09-13 22:38:51
|
Revision: 876 http://plexus.svn.sourceforge.net/plexus/?rev=876&view=rev Author: rconner Date: 2010-09-13 22:38:45 +0000 (Mon, 13 Sep 2010) Log Message: ----------- customizing checkstyle Modified Paths: -------------- trunk/plexus-graph/src/main/config/checkstyle/checkstyle.xml Modified: trunk/plexus-graph/src/main/config/checkstyle/checkstyle.xml =================================================================== --- trunk/plexus-graph/src/main/config/checkstyle/checkstyle.xml 2010-09-13 20:39:32 UTC (rev 875) +++ trunk/plexus-graph/src/main/config/checkstyle/checkstyle.xml 2010-09-13 22:38:45 UTC (rev 876) @@ -5,8 +5,11 @@ <!-- - Checkstyle configuration that checks the sun coding conventions from: + Checkstyle configuration patterned after sun_checks.xml, which is included + in the maven-checkstyle-plugin jar. + The original checkstyle config checks the sun coding conventions from: + - the Java Language Specification at http://java.sun.com/docs/books/jls/second_edition/html/index.html @@ -19,33 +22,16 @@ - 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"> - <!-- - If you set the basedir property below, then all reported file - names will be relative to the specified directory. See - http://checkstyle.sourceforge.net/5.x/config.html#Checker - <property name="basedir" value="${basedir}"/> - --> - - <!-- Following interprets the header file as regular expressions. --> + <!-- Checks for Headers --> + <!-- See http://checkstyle.sf.net/config_header.html --> <module name="RegexpHeader"> <property name="headerFile" value="${checkstyle.header.file}" /> </module> -<!-- The rest of this is from sun_checks.xml --> - <!-- Checks that each Java package has a Javadoc file used for commenting. --> <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> <module name="JavadocPackage"> @@ -76,14 +62,24 @@ <property name="cacheFile" value="${checkstyle.cache.file}"/> + <property name="tabWidth" value="4"/> + + <!-- Checks for Javadoc comments. --> <!-- See http://checkstyle.sf.net/config_javadoc.html --> - <module name="JavadocMethod"/> - <module name="JavadocType"/> - <module name="JavadocVariable"/> + <!-- FIXME: temporary + <module name="JavadocMethod"> + <property name="scope" value="protected"/> + </module> + <module name="JavadocType"> + <property name="scope" value="protected"/> + </module> + <module name="JavadocVariable"> + <property name="scope" value="protected"/> + </module> <module name="JavadocStyle"/> + --> - <!-- Checks for Naming Conventions. --> <!-- See http://checkstyle.sf.net/config_naming.html --> <module name="ConstantName"/> @@ -97,21 +93,6 @@ <module name="TypeName"/> - <!-- Checks for Headers --> - <!-- See http://checkstyle.sf.net/config_header.html --> - <!-- <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. See property --> - <!-- expansion, --> - <!-- http://checkstyle.sf.net/config.html#properties --> - <!-- <property --> - <!-- name="headerFile" --> - <!-- value="${basedir}/java.header"/> --> - <!-- </module> --> - - <!-- Checks for imports --> <!-- See http://checkstyle.sf.net/config_import.html --> <module name="AvoidStarImport"/> @@ -122,49 +103,81 @@ <!-- Checks for Size Violations. --> <!-- See http://checkstyle.sf.net/config_sizes.html --> - <module name="LineLength"/> + <module name="LineLength"> + <property name="max" value="120" /> + </module> <module name="MethodLength"/> <module name="ParameterNumber"/> <!-- Checks for whitespace --> <!-- See http://checkstyle.sf.net/config_whitespace.html --> - <module name="EmptyForIteratorPad"/> + <module name="EmptyForIteratorPad"> + <property name="option" value="space"/> + </module> <module name="MethodParamPad"/> - <module name="NoWhitespaceAfter"/> + <module name="NoWhitespaceAfter"> + <!-- Omitting: ARRAY_INIT, TYPECAST --> + <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/> + </module> <module name="NoWhitespaceBefore"/> <module name="OperatorWrap"/> - <module name="ParenPad"/> + <module name="ParenPad"> + <property name="option" value="space" /> + <!-- FIXME: temporary Omitting: LPAREN, RPAREN --> + <property name="tokens" value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL" /> + </module> <module name="TypecastParenPad"/> <module name="WhitespaceAfter"/> - <module name="WhitespaceAround"/> + <module name="WhitespaceAround"> + <!-- Omitting: LITERAL_CATCH, LITERAL_FOR, LITERAL_IF, LITERAL_SYNCHRONIZED, LITERAL_WHILE --> + <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_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_RETURN, LITERAL_TRY, 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" /> + </module> - <!-- Modifier Checks --> <!-- See http://checkstyle.sf.net/config_modifiers.html --> <module name="ModifierOrder"/> + <!-- Omitting, perhaps permanently <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="EmptyBlock"> + <property name="option" value="text"/> + </module> + <module name="LeftCurly"> + <property name="option" value="eol" /> + <property name="tokens" value="LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE" /> + </module> + <module name="LeftCurly"> + <property name="option" value="nl" /> + <property name="tokens" value="CLASS_DEF, CTOR_DEF, INTERFACE_DEF, METHOD_DEF" /> + </module> <module name="NeedBraces"/> <module name="RightCurly"/> <!-- Checks for common coding problems --> <!-- See http://checkstyle.sf.net/config_coding.html --> + <!-- Omitting, perhaps permanently <module name="AvoidInlineConditionals"/> - <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> + --> + <module name="DoubleCheckedLocking"/> <module name="EmptyStatement"/> <module name="EqualsHashCode"/> - <module name="HiddenField"/> + <module name="HiddenField"> + <property name="ignoreSetter" value="true"/> + <property name="ignoreConstructorParameter" value="true"/> + </module> <module name="IllegalInstantiation"/> <module name="InnerAssignment"/> - <module name="MagicNumber"/> + <module name="MagicNumber"> + <!-- FIXME: temporary. Excluding the magic numbers I'm using for hash codes --> + <property name="ignoreNumbers" value="-1, 0, 1, 2, 17, 37"/> + </module> <module name="MissingSwitchDefault"/> <module name="RedundantThrows"/> <module name="SimplifyBooleanExpression"/> @@ -172,17 +185,23 @@ <!-- Checks for class design --> <!-- See http://checkstyle.sf.net/config_design.html --> + <!-- FIXME: temporary <module name="DesignForExtension"/> + --> <module name="FinalClass"/> <module name="HideUtilityClassConstructor"/> <module name="InterfaceIsType"/> - <module name="VisibilityModifier"/> + <module name="VisibilityModifier"> + <property name="packageAllowed" value="true"/> + </module> <!-- Miscellaneous other checks. --> <!-- See http://checkstyle.sf.net/config_misc.html --> <module name="ArrayTypeStyle"/> + <!-- FIXME: temporary <module name="FinalParameters"/> + --> <module name="TodoComment"/> <module name="UpperEll"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |