Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <!DOCTYPE module PUBLIC |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 3 | "-//Puppy Crawl//DTD Check Configuration 1.3//EN" |
| 4 | "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 5 | |
| 6 | |
| 7 | <!-- |
| 8 | |
| 9 | Checkstyle configuration that checks the sun coding conventions from: |
| 10 | |
| 11 | - the Java Language Specification at |
| 12 | http://java.sun.com/docs/books/jls/second_edition/html/index.html |
| 13 | |
| 14 | - the Sun Code Conventions at http://java.sun.com/docs/codeconv/ |
| 15 | |
| 16 | - the Javadoc guidelines at |
| 17 | http://java.sun.com/j2se/javadoc/writingdoccomments/index.html |
| 18 | |
| 19 | - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html |
| 20 | |
| 21 | - some best practices |
| 22 | |
| 23 | Checkstyle is very configurable. Be sure to read the documentation at |
| 24 | http://checkstyle.sf.net (or in your downloaded distribution). |
| 25 | |
| 26 | Most Checks are configurable, be sure to consult the documentation. |
| 27 | |
| 28 | To completely disable a check, just comment it out or delete it from the file. |
| 29 | |
| 30 | Finally, it is worth reading the documentation. |
| 31 | |
| 32 | --> |
| 33 | |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 34 | |
| 35 | <!-- |
| 36 | The default severity setting in checkstyle is 'error', so some |
| 37 | of the rules below are configured to change the severity to |
| 38 | 'warning'. Over time, these 'warning' settings should be |
| 39 | removed as more of the ONOS source code is modified to |
| 40 | follow the recommended rules. |
| 41 | --> |
| 42 | |
| 43 | |
| 44 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 45 | <module name="Checker"> |
| 46 | <!-- |
| 47 | If you set the basedir property below, then all reported file |
| 48 | names will be relative to the specified directory. See |
| 49 | http://checkstyle.sourceforge.net/5.x/config.html#Checker |
| 50 | |
| 51 | <property name="basedir" value="${basedir}"/> |
| 52 | --> |
| 53 | <!-- Checks that a package-info.java file exists for each package. --> |
| 54 | <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> |
| 55 | <!-- ONOS does not currently supply package level Javadoc information |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 56 | in package-info files --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 57 | <!-- <module name="JavadocPackage"/> --> |
| 58 | |
| 59 | <!-- Checks whether files end with a new line. --> |
| 60 | <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> |
Ray Milkey | 0f913a0 | 2014-04-07 20:58:17 -0700 | [diff] [blame] | 61 | <module name="NewlineAtEndOfFile"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 62 | |
| 63 | <!-- Checks that property files contain the same keys. --> |
| 64 | <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> |
| 65 | <module name="Translation"/> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 66 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 67 | <!-- Checks for Size Violations. --> |
| 68 | <!-- See http://checkstyle.sf.net/config_sizes.html --> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 69 | <module name="FileLength"> |
| 70 | <property name="severity" value="warning"/> |
| 71 | </module> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 72 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 73 | <!-- Checks for whitespace --> |
| 74 | <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 75 | <module name="FileTabCharacter"/> |
| 76 | |
| 77 | <!-- Miscellaneous other checks. --> |
| 78 | <!-- See http://checkstyle.sf.net/config_misc.html --> |
| 79 | <module name="RegexpSingleline"> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 80 | <property name="format" value="\s+$"/> |
| 81 | <property name="minimum" value="0"/> |
| 82 | <property name="maximum" value="0"/> |
| 83 | <property name="message" value="Line has trailing spaces."/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 84 | </module> |
| 85 | |
| 86 | <!-- Checks for Headers --> |
| 87 | <!-- See http://checkstyle.sf.net/config_header.html --> |
| 88 | <!-- <module name="Header"> --> |
| 89 | <!-- <property name="headerFile" value="${checkstyle.header.file}"/> --> |
| 90 | <!-- <property name="fileExtensions" value="java"/> --> |
| 91 | <!-- </module> --> |
| 92 | |
| 93 | <module name="TreeWalker"> |
| 94 | |
| 95 | <!-- Checks for Javadoc comments. --> |
| 96 | <!-- See http://checkstyle.sf.net/config_javadoc.html --> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 97 | <module name="JavadocMethod"> |
| 98 | <property name="severity" value="warning"/> |
| 99 | </module> |
| 100 | <module name="JavadocType"> |
| 101 | <property name="severity" value="warning"/> |
| 102 | </module> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 103 | <module name="JavadocVariable"> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 104 | <!-- Suppress check for private member Javadocs. |
| 105 | Possibly revist fixing these. --> |
| 106 | <property name="scope" value="public"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 107 | <property name="severity" value="warning"/> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 108 | </module> |
Ray Milkey | b41100a | 2014-04-10 10:42:15 -0700 | [diff] [blame] | 109 | <module name="JavadocStyle"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 110 | |
| 111 | |
| 112 | <!-- Checks for Naming Conventions. --> |
| 113 | <!-- See http://checkstyle.sf.net/config_naming.html --> |
Ray Milkey | ec49771 | 2014-03-20 17:51:22 -0700 | [diff] [blame] | 114 | <module name="ConstantName"> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 115 | <!-- ONOS allows the name "log" for static final Loggers --> |
| 116 | <property name="format" |
| 117 | value="^log$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/> |
| 118 | </module> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 119 | <module name="LocalFinalVariableName"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 120 | |
Ray Milkey | 2476cac | 2014-04-08 11:03:21 -0700 | [diff] [blame] | 121 | <module name="LocalVariableName"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 122 | |
Ray Milkey | 2476cac | 2014-04-08 11:03:21 -0700 | [diff] [blame] | 123 | <module name="MemberName"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 124 | |
| 125 | <module name="MethodName"> |
| 126 | <property name="severity" value="warning"/> |
| 127 | </module> |
| 128 | |
| 129 | <module name="PackageName"/> |
Ray Milkey | 9526d6f | 2014-04-10 14:54:15 -0700 | [diff] [blame] | 130 | <module name="ParameterName"/> |
Ray Milkey | 94b41b5 | 2014-04-10 11:13:06 -0700 | [diff] [blame] | 131 | <module name="StaticVariableName"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 132 | <module name="TypeName"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 133 | |
| 134 | <!-- Checks for imports --> |
| 135 | <!-- See http://checkstyle.sf.net/config_import.html --> |
| 136 | <module name="AvoidStarImport"/> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 137 | <module name="IllegalImport"/> |
| 138 | <!-- defaults to sun.* packages --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 139 | <module name="RedundantImport"/> |
| 140 | <module name="UnusedImports"/> |
| 141 | |
| 142 | |
| 143 | <!-- Checks for Size Violations. --> |
| 144 | <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 145 | <module name="LineLength"> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 146 | <!-- ONOS standard usage is 80 columns, but we allow up |
| 147 | to 120 to not break the build. --> |
| 148 | <property name="max" value="120"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 149 | <property name="severity" value="warning"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 150 | </module> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 151 | <module name="MethodLength"> |
| 152 | <property name="severity" value="warning"/> |
| 153 | </module> |
| 154 | |
| 155 | <module name="ParameterNumber"> |
| 156 | <property name="severity" value="warning"/> |
| 157 | </module> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 158 | |
| 159 | |
| 160 | <!-- Checks for whitespace --> |
| 161 | <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
Ray Milkey | 7f1567c | 2014-04-08 13:53:32 -0700 | [diff] [blame] | 162 | <module name="EmptyForIteratorPad"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 163 | <module name="GenericWhitespace"/> |
| 164 | <module name="MethodParamPad"/> |
Ray Milkey | 7f1567c | 2014-04-08 13:53:32 -0700 | [diff] [blame] | 165 | <module name="NoWhitespaceAfter"/> |
| 166 | <module name="NoWhitespaceBefore"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 167 | |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 168 | <!-- Disabled for ONOS. Default rules specify undesired behavior for the '?' operator --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 169 | <!-- <module name="OperatorWrap"/> --> |
| 170 | <module name="ParenPad"/> |
| 171 | <module name="TypecastParenPad"/> |
Ray Milkey | 7f1567c | 2014-04-08 13:53:32 -0700 | [diff] [blame] | 172 | <module name="WhitespaceAfter"/> |
| 173 | <module name="WhitespaceAround"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 174 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 175 | |
| 176 | |
| 177 | <!-- Modifier Checks --> |
| 178 | <!-- See http://checkstyle.sf.net/config_modifiers.html --> |
Ray Milkey | ec83894 | 2014-04-09 11:28:43 -0700 | [diff] [blame] | 179 | <module name="ModifierOrder"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 180 | |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 181 | <!-- Disabled for ONOS to allow use of public --> |
| 182 | <!-- modifiers in interfaces. --> |
| 183 | <!-- <module name="RedundantModifier"/> --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 184 | |
| 185 | |
| 186 | <!-- Checks for blocks. You know, those {}'s --> |
| 187 | <!-- See http://checkstyle.sf.net/config_blocks.html --> |
| 188 | <module name="AvoidNestedBlocks"> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 189 | <!-- ONOS alows declarations inside of switch case blocks --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 190 | <property name="allowInSwitchCase" value="true"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 191 | </module> |
Ray Milkey | 1aa71f8 | 2014-04-08 16:23:24 -0700 | [diff] [blame] | 192 | <module name="EmptyBlock"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 193 | <module name="LeftCurly"/> |
Ray Milkey | b29e626 | 2014-04-09 16:02:14 -0700 | [diff] [blame] | 194 | <module name="NeedBraces"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 195 | <module name="RightCurly"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 196 | |
| 197 | <!-- Checks for common coding problems --> |
| 198 | <!-- See http://checkstyle.sf.net/config_coding.html --> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 199 | <!-- ONOS allows conditional operators --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 200 | <!-- <module name="AvoidInlineConditionals"/> --> |
Ray Milkey | 043daa2 | 2014-04-08 14:13:16 -0700 | [diff] [blame] | 201 | <module name="EmptyStatement"/> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 202 | <module name="EqualsHashCode"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 203 | |
| 204 | <module name="HiddenField"> |
| 205 | <property name="severity" value="warning"/> |
| 206 | </module> |
| 207 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 208 | <module name="IllegalInstantiation"/> |
Ray Milkey | b6e0ac8 | 2014-04-09 13:21:42 -0700 | [diff] [blame] | 209 | <module name="InnerAssignment"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 210 | |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 211 | <!-- Many violations of this rule present, revist in a |
| 212 | subsequent round of cleanups --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 213 | <!-- <module name="MagicNumber"/> --> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 214 | <module name="MissingSwitchDefault"> |
| 215 | <property name="severity" value="warning"/> |
| 216 | </module> |
| 217 | |
| 218 | <module name="RedundantThrows"> |
| 219 | <property name="severity" value="warning"/> |
| 220 | </module> |
| 221 | |
| 222 | <module name="SimplifyBooleanExpression"> |
| 223 | <property name="severity" value="warning"/> |
| 224 | </module> |
| 225 | |
| 226 | <module name="SimplifyBooleanReturn"> |
| 227 | <property name="severity" value="warning"/> |
| 228 | </module> |
| 229 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 230 | |
| 231 | <!-- Checks for class design --> |
| 232 | <!-- See http://checkstyle.sf.net/config_design.html --> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 233 | <!-- ONOS produces many warnings of this type. |
| 234 | Fixing all of these is outside the scope of the current cleanup. --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 235 | <!-- <module name="DesignForExtension"/> --> |
Ray Milkey | 1584ec8 | 2014-04-10 11:58:30 -0700 | [diff] [blame] | 236 | <module name="FinalClass"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 237 | |
Ray Milkey | a2e2146 | 2014-04-10 13:21:44 -0700 | [diff] [blame] | 238 | <module name="HideUtilityClassConstructor"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 239 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 240 | <module name="InterfaceIsType"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 241 | |
| 242 | <module name="VisibilityModifier"> |
| 243 | <property name="severity" value="warning"/> |
| 244 | </module> |
| 245 | |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 246 | |
| 247 | |
| 248 | <!-- Miscellaneous other checks. --> |
| 249 | <!-- See http://checkstyle.sf.net/config_misc.html --> |
Ray Milkey | 45614c5 | 2014-04-07 16:30:54 -0700 | [diff] [blame] | 250 | <module name="ArrayTypeStyle"/> |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 251 | |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 252 | <!-- Many violations of this rule currently, too many to fix |
| 253 | in the current cleanup. --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 254 | <!-- <module name="FinalParameters"/> --> |
Ray Milkey | 3f5ef56 | 2014-03-25 17:11:19 -0700 | [diff] [blame] | 255 | <!-- ONOS allows TODO markers in checked in source code --> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 256 | <!-- <module name="TodoComment"/> --> |
| 257 | <module name="UpperEll"/> |
| 258 | |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 259 | </module> |
Yuta HIGUCHI | f980844 | 2014-03-20 15:56:50 -0700 | [diff] [blame] | 260 | |
Ray Milkey | b5716c5 | 2014-04-07 11:38:27 -0700 | [diff] [blame] | 261 | </module> |