1<?xml version="1.0"?> 2<!-- 3Licensed to the Apache Software Foundation (ASF) under one or more 4contributor license agreements. See the NOTICE file distributed with 5this work for additional information regarding copyright ownership. 6The ASF licenses this file to You under the Apache License, Version 2.0 7(the "License"); you may not use this file except in compliance with 8the License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12Unless required by applicable law or agreed to in writing, software 13distributed under the License is distributed on an "AS IS" BASIS, 14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15See the License for the specific language governing permissions and 16limitations under the License. 17--> 18 19<!DOCTYPE module PUBLIC 20 "-//Puppy Crawl//DTD Check Configuration 1.1//EN" 21 "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> 22 23<!-- commons codec customization of default Checkstyle behavior --> 24<module name="Checker"> 25 <property name="localeLanguage" value="en" /> 26 27 <!-- Checks whether files end with a new line. --> 28 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> 29 <module name="NewlineAtEndOfFile" /> 30 31 <!-- Checks for Tab characters --> 32 <!-- See http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter --> 33 <module name="FileTabCharacter"> 34 <property name="fileExtensions" value="java" /> 35 </module> 36 37 <!-- Checks for white space at the end of the line --> 38 <!-- See http://checkstyle.sourceforge.net/config_regexp.html --> 39 <!-- 706 40 <module name="RegexpSingleline"> 41 <property name="format" value="\s+$" /> 42 <property name="message" value="Line has trailing spaces." /> 43 <property name="fileExtensions" value="java" /> 44 </module> 45 --> 46 47 <!-- @author tags are deprecated --> 48 <module name="RegexpSingleline"> 49 <property name="format" value="^\s+\*\s+@author\s" /> 50 <property name="message" value="Deprecated @author tag" /> 51 <property name="fileExtensions" value="java" /> 52 <property name="severity" value="warning" /> 53 </module> 54 55 <module name="TreeWalker"> 56 <property name="cacheFile" value="target/cachefile" /> 57 <!-- 58 --> 59 <module name="LineLength"> 60 <property name="max" value="160"/> 61 </module> 62 63 <!-- Checks for Naming Conventions. --> 64 <!-- See http://checkstyle.sf.net/config_naming.html --> 65 <!-- allow CONSTANT_Long etc --> 66 <!-- 67 <module name="ConstantName"> 68 <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Za-z0-9]+)*$"/> 69 </module> 70 <module name="LocalFinalVariableName"/> 71 <module name="LocalVariableName"/> 72 <module name="MemberName"> 73 <property name="format" value="^[a-z][a-zA-Z0-9_]*(_[a-zA-Z0-9]+)*$"/> 74 </module> 75 <module name="MethodName"/> 76 <module name="PackageName"/> 77 <module name="ParameterName"/> 78 <module name="StaticVariableName"/> 79 --> 80 <module name="TypeName"> 81 <!-- Allow underscore in class names --> 82 <property name="format" value="^[A-Z][A-Za-z0-9]*(_[A-Za-z0-9]+)*$"/> 83 </module> 84 85 <!-- Checks for imports --> 86 <!-- See http://checkstyle.sf.net/config_imports.html --> 87 <module name="AvoidStarImport"> 88 <property name="excludes" value="org.junit.Assert"/> 89 </module> 90 <module name="IllegalImport"/> <!-- defaults to sun.* packages --> 91 <module name="RedundantImport"/> 92 <module name="UnusedImports"/> 93 94 <!-- Checks for whitespace --> 95 <!-- See http://checkstyle.sf.net/config_whitespace.html --> 96 <module name="EmptyForIteratorPad"/> 97 <!-- Too many to fix at present 98 <module name="NoWhitespaceAfter"/> 99 <module name="NoWhitespaceBefore"/> 100 <module name="OperatorWrap"> 101 <property name="option" value="nl" /> 102 </module> 103 --> 104 <!-- Too many to fix at present 105 <module name="ParenPad"/> 106 <module name="WhitespaceAfter"/> 107 <module name="WhitespaceAround"/> 108 --> 109 110 <!-- Modifier Checks --> 111 <!-- See http://checkstyle.sf.net/config_modifiers.html --> 112 <module name="ModifierOrder"/> 113 114 <!--module name="RedundantModifier"/--> 115 116 <!-- Checks for blocks. You know, those {}'s --> 117 <!-- See http://checkstyle.sf.net/config_blocks.html --> 118 <!--module name="AvoidNestedBlocks"/--> 119 <module name="EmptyBlock"> 120 <property name="option" value="text"/> 121 </module> 122 <!-- 123 <module name="LeftCurly"> 124 <property name="option" value="nl"/> 125 </module> 126 --> 127 <module name="NeedBraces"/> 128 <!-- 129 <module name="RightCurly"> 130 <property name="option" value="alone"/> 131 </module> 132 --> 133 134 <!-- Checks for common coding problems --> 135 <!-- See http://checkstyle.sf.net/config_coding.html --> 136 <module name="CovariantEquals"/> 137 <module name="EqualsHashCode"/> 138 <module name="IllegalInstantiation"/> 139 <!--module name="InnerAssignment"/--><!-- Inner assignments are OK --> 140 <!-- module name="MagicNumber"> 141 <property name="ignoreNumbers" value="-1,0,1,2,3"/> 142 </module--> 143 <module name="SimplifyBooleanExpression"/> 144 <module name="SimplifyBooleanReturn"/> 145 <module name="StringLiteralEquality"/> 146 <!--module name="SuperClone"/--> 147 <module name="SuperFinalize"/> 148 <!--module name="DeclarationOrder"/--> 149 <!--module name="ExplicitInitialization"/--> 150 <module name="DefaultComesLast"/> 151 <module name="FallThrough"> 152 <property name="reliefPattern" value="\$FALL-THROUGH\$"/><!-- to agree with Eclipse --> 153 </module> 154 <module name="MultipleVariableDeclarations"/> 155 <module name="UnnecessaryParentheses"/> 156 157 <!-- Checks for class design --> 158 <!-- See http://checkstyle.sf.net/config_design.html --> 159 <!--module name="FinalClass"/--> 160 <!--module name="HideUtilityClassConstructor"/--> 161 <!--module name="InterfaceIsType"/--> 162 163 <module name="VisibilityModifier"> 164 <property name="ignoreAnnotationCanonicalNames" value="java.lang.Deprecated"/> 165 <property name="protectedAllowed" value="false"/> 166 <property name="packageAllowed" value="true"/> 167 </module> 168 169 <!-- Miscellaneous other checks. --> 170 <!-- See http://checkstyle.sf.net/config_misc.html --> 171 <module name="ArrayTypeStyle"/> 172 <!--module name="TodoComment"/--> 173 <module name="UpperEll"/> 174 175 <!-- Required for SuppressionCommentFilter below --> 176 <module name="FileContentsHolder"/> 177 178 </module> 179 180 <module name="SuppressionCommentFilter"/> 181 182 <module name="SuppressionFilter"> 183 <!-- config_loc is used by Eclipse plugin --> 184 <property name="file" value="${config_loc}/src/conf/checkstyle-suppressions.xml"/> 185 </module> 186 187 <!-- 188 Allow comment to suppress checkstyle for a single line 189 e.g. // CHECKSTYLE IGNORE MagicNumber 190 --> 191 <module name="SuppressWithNearbyCommentFilter"> 192 <property name="commentFormat" value="CHECKSTYLE IGNORE (\w+)"/> 193 <property name="checkFormat" value="$1"/> 194 </module> 195 196</module> 197 198