Alexander Afanasyev | e36e1af | 2016-02-19 18:06:05 -0800 | [diff] [blame] | 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 sun 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 | Checkstyle is very configurable. Be sure to read the documentation at |
| 23 | http://checkstyle.sf.net (or in your downloaded distribution). |
| 24 | |
| 25 | Most Checks are configurable, be sure to consult the documentation. |
| 26 | |
| 27 | To completely disable a check, just comment it out or delete it from the file. |
| 28 | |
| 29 | Finally, it is worth reading the documentation. |
| 30 | |
| 31 | --> |
| 32 | |
| 33 | <module name="Checker"> |
| 34 | <!-- |
| 35 | If you set the basedir property below, then all reported file |
| 36 | names will be relative to the specified directory. See |
| 37 | http://checkstyle.sourceforge.net/5.x/config.html#Checker |
| 38 | |
| 39 | <property name="basedir" value="${basedir}"/> |
| 40 | --> |
| 41 | |
| 42 | <property name="fileExtensions" value="java, properties, xml"/> |
| 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="excludeScope" value="private"/>--> |
| 86 | <!--</module>--> |
| 87 | <module name="JavadocType"> |
| 88 | <property name="excludeScope" value="private"/> |
| 89 | </module> |
| 90 | <module name="JavadocVariable"> |
| 91 | <property name="excludeScope" value="private"/> |
| 92 | </module> |
| 93 | <module name="JavadocStyle"/> |
| 94 | |
| 95 | <!-- Checks for Naming Conventions. --> |
| 96 | <!-- See http://checkstyle.sf.net/config_naming.html --> |
| 97 | <module name="ConstantName"/> |
| 98 | <module name="LocalFinalVariableName"/> |
| 99 | <module name="LocalVariableName"/> |
| 100 | <module name="MemberName"/> |
| 101 | <module name="MethodName"/> |
| 102 | <module name="PackageName"/> |
| 103 | <module name="ParameterName"/> |
| 104 | <module name="StaticVariableName"/> |
| 105 | <module name="TypeName"/> |
| 106 | |
| 107 | <!-- Checks for imports --> |
| 108 | <!-- See http://checkstyle.sf.net/config_import.html --> |
| 109 | <module name="AvoidStarImport"/> |
| 110 | <module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
| 111 | <module name="RedundantImport"/> |
| 112 | <module name="UnusedImports"> |
| 113 | <property name="processJavadoc" value="false"/> |
| 114 | </module> |
| 115 | |
| 116 | <!-- Checks for Size Violations. --> |
| 117 | <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 118 | <module name="LineLength"> |
| 119 | <property name="max" value="120"/> |
| 120 | </module> |
| 121 | <module name="MethodLength"/> |
| 122 | <module name="ParameterNumber"/> |
| 123 | |
| 124 | <!-- Checks for whitespace --> |
| 125 | <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 126 | <module name="EmptyForIteratorPad"/> |
| 127 | <module name="GenericWhitespace"/> |
| 128 | <module name="MethodParamPad"/> |
| 129 | <module name="NoWhitespaceAfter"/> |
| 130 | <module name="NoWhitespaceBefore"/> |
| 131 | <module name="OperatorWrap"> |
| 132 | <property name="option" value="eol"/> |
| 133 | </module> |
| 134 | <module name="ParenPad"/> |
| 135 | <module name="TypecastParenPad"/> |
| 136 | <module name="WhitespaceAfter"/> |
| 137 | <module name="WhitespaceAround"/> |
| 138 | |
| 139 | <!-- Modifier Checks --> |
| 140 | <!-- See http://checkstyle.sf.net/config_modifiers.html --> |
| 141 | <module name="ModifierOrder"/> |
| 142 | <module name="RedundantModifier"/> |
| 143 | |
| 144 | <!-- Checks for blocks. You know, those {}'s --> |
| 145 | <!-- See http://checkstyle.sf.net/config_blocks.html --> |
| 146 | <module name="AvoidNestedBlocks"/> |
| 147 | <module name="EmptyBlock"/> |
| 148 | <module name="LeftCurly"/> |
| 149 | <module name="NeedBraces"/> |
| 150 | <module name="RightCurly"/> |
| 151 | |
| 152 | <!-- Checks for common coding problems --> |
| 153 | <!-- See http://checkstyle.sf.net/config_coding.html --> |
| 154 | <module name="AvoidInlineConditionals"/> |
| 155 | <module name="EmptyStatement"/> |
| 156 | <module name="EqualsHashCode"/> |
| 157 | <!-- <module name="HiddenField"/> --> |
| 158 | <module name="IllegalInstantiation"/> |
| 159 | <module name="InnerAssignment"/> |
| 160 | <!--<module name="MagicNumber"/>--> |
| 161 | <module name="MissingSwitchDefault"/> |
| 162 | <module name="SimplifyBooleanExpression"/> |
| 163 | <module name="SimplifyBooleanReturn"/> |
| 164 | |
| 165 | <!-- Checks for class design --> |
| 166 | <!-- See http://checkstyle.sf.net/config_design.html --> |
| 167 | <!--<module name="DesignForExtension"/>--> |
| 168 | <module name="FinalClass"/> |
| 169 | <module name="HideUtilityClassConstructor"/> |
| 170 | <module name="InterfaceIsType"/> |
| 171 | <module name="VisibilityModifier"/> |
| 172 | |
| 173 | <!-- Miscellaneous other checks. --> |
| 174 | <!-- See http://checkstyle.sf.net/config_misc.html --> |
| 175 | <module name="ArrayTypeStyle"/> |
| 176 | <module name="FinalParameters"/> |
| 177 | <!--<module name="TodoComment"/>--> |
| 178 | <module name="UpperEll"/> |
| 179 | |
| 180 | </module> |
| 181 | |
| 182 | </module> |