|
| 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 | +<!-- |
| 7 | +
|
| 8 | + Checkstyle configuration that checks the coding conventions from: |
| 9 | +
|
| 10 | + - the Java Language Specification at |
| 11 | + http://java.sun.com/docs/books/jls/second_edition/html/index.html |
| 12 | +
|
| 13 | + - the Sun Code Conventions at http://java.sun.com/docs/codeconv/ |
| 14 | +
|
| 15 | + - the Javadoc guidelines at |
| 16 | + http://java.sun.com/j2se/javadoc/writingdoccomments/index.html |
| 17 | +
|
| 18 | + - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html |
| 19 | +
|
| 20 | + - some best practices |
| 21 | +
|
| 22 | + - changes for cs32 are marked CS32 |
| 23 | +
|
| 24 | + Checkstyle is very configurable. Be sure to read the documentation at |
| 25 | + http://checkstyle.sf.net (or in your downloaded distribution). |
| 26 | +
|
| 27 | + Most Checks are configurable, be sure to consult the documentation. |
| 28 | +
|
| 29 | + To completely disable a check, just comment it out or delete it from the file. |
| 30 | +
|
| 31 | + Finally, it is worth reading the documentation. |
| 32 | +
|
| 33 | +--> |
| 34 | + |
| 35 | +<module name="Checker"> |
| 36 | + <!-- |
| 37 | + If you set the basedir property below, then all reported file |
| 38 | + names will be relative to the specified directory. See |
| 39 | + http://checkstyle.sourceforge.net/5.x/config.html#Checker |
| 40 | +
|
| 41 | + <property name="basedir" value="${basedir}"/> |
| 42 | + --> |
| 43 | + |
| 44 | + <!-- Checks that a package-info.java file exists for each package. --> |
| 45 | + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> |
| 46 | + <!-- <module name="JavadocPackage"/> --> |
| 47 | + |
| 48 | + <!-- Checks whether files end with a new line. --> |
| 49 | + <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> |
| 50 | + <module name="NewlineAtEndOfFile"/> |
| 51 | + |
| 52 | + <!-- Checks that property files contain the same keys. --> |
| 53 | + <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> |
| 54 | + <module name="Translation"/> |
| 55 | + |
| 56 | + <!-- Checks for Size Violations. --> |
| 57 | + <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 58 | + <module name="FileLength"/> |
| 59 | + |
| 60 | + <!-- Checks for whitespace --> |
| 61 | + <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 62 | + <module name="FileTabCharacter"/> |
| 63 | + |
| 64 | + <!-- Miscellaneous other checks. --> |
| 65 | + <!-- See http://checkstyle.sf.net/config_misc.html --> |
| 66 | + <module name="RegexpSingleline"> |
| 67 | + <property name="format" value="\s+$"/> |
| 68 | + <property name="minimum" value="0"/> |
| 69 | + <property name="maximum" value="0"/> |
| 70 | + <property name="message" value="Line has trailing spaces."/> |
| 71 | + </module> |
| 72 | + |
| 73 | + <!-- Checks for Headers --> |
| 74 | + <!-- See http://checkstyle.sf.net/config_header.html --> |
| 75 | + <!-- <module name="Header"> --> |
| 76 | + <!-- <property name="headerFile" value="${checkstyle.header.file}"/> --> |
| 77 | + <!-- <property name="fileExtensions" value="java"/> --> |
| 78 | + <!-- </module> --> |
| 79 | + |
| 80 | + <module name="TreeWalker"> |
| 81 | + |
| 82 | + <!-- Checks for Javadoc comments. --> |
| 83 | + <!-- See http://checkstyle.sf.net/config_javadoc.html --> |
| 84 | + <module name="JavadocMethod"> |
| 85 | + <property name="scope" value="public"/> |
| 86 | + </module> |
| 87 | + <module name="JavadocType"/> |
| 88 | + <!-- <module name="JavadocVariable"/> --> |
| 89 | + <module name="JavadocStyle"/> |
| 90 | + |
| 91 | + |
| 92 | + <!-- Checks for Naming Conventions. --> |
| 93 | + <!-- See http://checkstyle.sf.net/config_naming.html --> |
| 94 | + <module name="ConstantName"/> |
| 95 | + <module name="LocalFinalVariableName"/> |
| 96 | + <module name="LocalVariableName"/> |
| 97 | + <module name="MemberName"/> |
| 98 | + <module name="MethodName"/> |
| 99 | + <module name="PackageName"/> |
| 100 | + <module name="ParameterName"/> |
| 101 | + <module name="StaticVariableName"/> |
| 102 | + <module name="TypeName"/> |
| 103 | + |
| 104 | + |
| 105 | + <!-- Checks for imports --> |
| 106 | + <!-- See http://checkstyle.sf.net/config_import.html --> |
| 107 | + <module name="AvoidStarImport"/> |
| 108 | + <module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
| 109 | + <module name="RedundantImport"/> |
| 110 | + <module name="UnusedImports"/> |
| 111 | + <!-- <module name="ImportOrder"> |
| 112 | + <property name="groups" value="/^javax?\./,org,com"/> |
| 113 | + <property name="separated" value="true"/> |
| 114 | + <property name="option" value="bottom"/> |
| 115 | + </module> --> |
| 116 | + |
| 117 | + |
| 118 | + <!-- Checks for Size Violations. --> |
| 119 | + <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 120 | + <module name="LineLength"/> |
| 121 | + <module name="MethodLength"/> |
| 122 | + <module name="ParameterNumber"/> |
| 123 | + |
| 124 | + |
| 125 | + <!-- Checks for whitespace --> |
| 126 | + <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 127 | + <module name="EmptyForIteratorPad"/> |
| 128 | + <module name="GenericWhitespace"/> |
| 129 | + <module name="MethodParamPad"/> |
| 130 | + <module name="NoWhitespaceAfter"/> |
| 131 | + <module name="NoWhitespaceBefore"/> |
| 132 | + <module name="OperatorWrap"/> |
| 133 | + <module name="ParenPad"/> |
| 134 | + <module name="TypecastParenPad"/> |
| 135 | + <module name="WhitespaceAfter"/> |
| 136 | + <module name="WhitespaceAround"/> |
| 137 | + |
| 138 | + <!-- not available? <module name="SeparatorWrap"/> --> |
| 139 | + |
| 140 | + |
| 141 | + <!-- Modifier Checks --> |
| 142 | + <!-- See http://checkstyle.sf.net/config_modifiers.html --> |
| 143 | + <module name="ModifierOrder"/> |
| 144 | + <module name="RedundantModifier"/> |
| 145 | + |
| 146 | + |
| 147 | + <!-- Checks for blocks. You know, those {}'s --> |
| 148 | + <!-- See http://checkstyle.sf.net/config_blocks.html --> |
| 149 | + <module name="AvoidNestedBlocks"/> |
| 150 | + <module name="EmptyBlock"/> |
| 151 | + <module name="LeftCurly"/> |
| 152 | + <module name="NeedBraces"/> |
| 153 | + <module name="RightCurly"/> |
| 154 | + |
| 155 | + |
| 156 | + <!-- Checks for common coding problems --> |
| 157 | + <!-- See http://checkstyle.sf.net/config_coding.html --> |
| 158 | + <!-- CS32 <module name="AvoidInlineConditionals"/> --> |
| 159 | + <module name="EmptyStatement"/> |
| 160 | + <module name="EqualsHashCode"/> |
| 161 | + <module name="HiddenField"> |
| 162 | + <property name="ignoreConstructorParameter" value="true"/> |
| 163 | + <property name="ignoreSetter" value="true"/> |
| 164 | + </module> |
| 165 | + <module name="IllegalInstantiation"/> |
| 166 | + <module name="InnerAssignment"/> |
| 167 | + <module name="MagicNumber"> |
| 168 | + <property name="ignoreNumbers" value="-1,0,1,2,3,4,5,6,200,400,401,403,404,405,500,501"/> |
| 169 | + </module> |
| 170 | + <module name="MissingSwitchDefault"/> |
| 171 | + <module name="SimplifyBooleanExpression"/> |
| 172 | + <module name="SimplifyBooleanReturn"/> |
| 173 | + |
| 174 | + <!-- Checks for class design --> |
| 175 | + <!-- See http://checkstyle.sf.net/config_design.html --> |
| 176 | + <!-- CS32 <module name="DesignForExtension"/> --> |
| 177 | + <module name="FinalClass"/> |
| 178 | + <module name="HideUtilityClassConstructor"/> |
| 179 | + <module name="InterfaceIsType"/> |
| 180 | + <module name="VisibilityModifier"/> |
| 181 | + |
| 182 | + |
| 183 | + <!-- Miscellaneous other checks. --> |
| 184 | + <!-- See http://checkstyle.sf.net/config_misc.html --> |
| 185 | + <module name="ArrayTypeStyle"/> |
| 186 | + <!-- <module name="FinalParameters"/> --> |
| 187 | + <module name="TodoComment"/> |
| 188 | + <module name="UpperEll"/> |
| 189 | + <module name="Indentation"> |
| 190 | + <property name="basicOffset" value="2"/> |
| 191 | + <property name="caseIndent" value="2"/> |
| 192 | + <property name="throwsIndent" value="2"/> |
| 193 | + </module> |
| 194 | + |
| 195 | + </module> |
| 196 | + |
| 197 | +</module> |
0 commit comments