1<?xml version="1.0"?> 2<!DOCTYPE module PUBLIC 3 "-//Puppy Crawl//DTD Check Configuration 1.3//EN" 4 "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> 5 6<!-- 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 7 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 8 - 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, 9 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. --> 10 11<module name="Checker"> 12 <module name="SuppressionFilter"> 13 <property name="file" value="${checkstyle.suppressions.file}" default="src/main/checkstyle/checkstyle-suppressions.xml"/> 14 </module> 15 <!-- 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 16 <property name="basedir" value="${basedir}"/> --> 17 18 <!-- Checks whether files end with a new line. --> 19 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> 20 <module name="NewlineAtEndOfFile" /> 21 22 <!-- Checks that property files contain the same keys. --> 23 <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> 24 <module name="Translation" /> 25 26 <!-- Checks for Size Violations. --> 27 <!-- See http://checkstyle.sf.net/config_sizes.html --> 28 <module name="FileLength" /> 29 30 <!-- Checks for whitespace --> 31 <!-- See http://checkstyle.sf.net/config_whitespace.html --> 32 <module name="FileTabCharacter" /> 33 34 35 <!-- Checks for Headers --> 36 <!-- See http://checkstyle.sf.net/config_header.html --> 37 <!-- <module name="Header"> --> 38 <!-- <property name="headerFile" value="${checkstyle.header.file}"/> --> 39 <!-- <property name="fileExtensions" value="java"/> --> 40 <!-- </module> --> 41 42 <module name="TreeWalker"> 43 44 <!-- Checks for Javadoc comments. --> 45 <!-- See http://checkstyle.sf.net/config_javadoc.html --> 46 <module name="JavadocMethod" > 47 <property name="scope" value="protected" /> 48 </module> 49 <module name="JavadocType" > 50 <property name="scope" value="protected" /> 51 </module> 52 <module name="JavadocVariable" > 53 <property name="scope" value="protected" /> 54 </module> 55 <module name="JavadocStyle" > 56 <property name="scope" value="protected" /> 57 </module> 58 59 60 <!-- Checks for Naming Conventions. --> 61 <!-- See http://checkstyle.sf.net/config_naming.html --> 62 <module name="ConstantName" /> 63 <module name="LocalFinalVariableName" /> 64 <module name="LocalVariableName" /> 65 <module name="MemberName" /> 66 <module name="MethodName" /> 67 <module name="PackageName" /> 68 <module name="ParameterName" /> 69 <module name="StaticVariableName" /> 70 <module name="TypeName" /> 71 72 73 <!-- Checks for imports --> 74 <!-- See http://checkstyle.sf.net/config_import.html --> 75 <module name="AvoidStarImport" /> 76 <module name="IllegalImport" /> <!-- defaults to sun.* packages --> 77 <module name="RedundantImport" /> 78 <module name="UnusedImports" /> 79 80 81 <!-- Checks for Size Violations. --> 82 <!-- See http://checkstyle.sf.net/config_sizes.html --> 83 <module name="LineLength"> 84 <property name="max" value="180" /> 85 </module> 86 <module name="MethodLength" /> 87 <module name="ParameterNumber" /> 88 89 90 <!-- Checks for whitespace --> 91 <!-- See http://checkstyle.sf.net/config_whitespace.html --> 92 <module name="EmptyForIteratorPad" /> 93 <module name="GenericWhitespace" /> 94 <module name="MethodParamPad" /> 95 <module name="NoWhitespaceAfter" /> 96 <module name="NoWhitespaceBefore" /> 97 <module name="OperatorWrap" /> 98 <module name="ParenPad" /> 99 <module name="TypecastParenPad" /> 100 <module name="WhitespaceAfter" /> 101 <module name="WhitespaceAround" /> 102 103 104 <!-- Modifier Checks --> 105 <!-- See http://checkstyle.sf.net/config_modifiers.html --> 106 <module name="ModifierOrder" /> 107 <module name="RedundantModifier" /> 108 109 110 <!-- Checks for blocks. You know, those {}'s --> 111 <!-- See http://checkstyle.sf.net/config_blocks.html --> 112 <module name="AvoidNestedBlocks" /> 113 <module name="EmptyBlock" /> 114 <module name="LeftCurly" /> 115 <module name="NeedBraces" /> 116 <module name="RightCurly" /> 117 118 119 <!-- Checks for common coding problems --> 120 <!-- See http://checkstyle.sf.net/config_coding.html --> 121 <!-- <module name="AvoidInlineConditionals" /> i think simple cases are ok, not generally bad --> 122 <module name="EmptyStatement" /> 123 <module name="EqualsHashCode" /> 124 <module name="HiddenField"> 125 <property name="ignoreSetter" value="true" /> 126 <property name="ignoreConstructorParameter" value="true" /> 127 </module> 128 <module name="IllegalInstantiation" /> 129 <module name="InnerAssignment" /> 130 131 <module name="MissingSwitchDefault" /> 132 <module name="RedundantThrows"> 133 <property name="suppressLoadErrors" value="true" /> 134 </module> 135 <module name="SimplifyBooleanExpression" /> 136 <module name="SimplifyBooleanReturn" /> 137 138 <!-- Checks for class design --> 139 <!-- See http://checkstyle.sf.net/config_design.html --> 140 <!-- <module name="DesignForExtension" /> part of this would be good but it goes to much to the core --> 141 <module name="FinalClass" /> 142 <module name="HideUtilityClassConstructor" /> 143 <module name="InterfaceIsType" /> 144 <module name="VisibilityModifier"> 145 <property name="protectedAllowed" value="true" /> 146 </module> 147 148 149 <!-- Miscellaneous other checks. --> 150 <!-- See http://checkstyle.sf.net/config_misc.html --> 151 <module name="ArrayTypeStyle" /> 152 <!-- <module name="TodoComment" /> is better done by the taglist plugin --> 153 <module name="UpperEll" /> 154 155 </module> 156 157</module> 158