|
| 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 | + Checkstyle configuration that checks the Google coding conventions from Google Java Style |
| 8 | + that can be found at https://google.github.io/styleguide/javaguide.html. |
| 9 | + Checkstyle is very configurable. Be sure to read the documentation at |
| 10 | + http://checkstyle.sf.net (or in your downloaded distribution). |
| 11 | + To completely disable a check, just comment it out or delete it from the file. |
| 12 | + Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov. |
| 13 | + --> |
| 14 | + |
| 15 | +<module name="Checker"> |
| 16 | + <property name="charset" value="UTF-8"/> |
| 17 | + |
| 18 | + <property name="severity" value="warning"/> |
| 19 | + |
| 20 | + <property name="fileExtensions" value="java, properties, xml"/> |
| 21 | + <!-- Checks for whitespace --> |
| 22 | + <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 23 | + <module name="FileTabCharacter"> |
| 24 | + <property name="eachLine" value="true"/> |
| 25 | + </module> |
| 26 | + |
| 27 | + <module name="TreeWalker"> |
| 28 | + <module name="OuterTypeFilename"/> |
| 29 | + <module name="IllegalTokenText"> |
| 30 | + <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/> |
| 31 | + <property name="format" |
| 32 | + value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/> |
| 33 | + <property name="message" value="Avoid using corresponding octal or Unicode escape."/> |
| 34 | + </module> |
| 35 | + <module name="AvoidEscapedUnicodeCharacters"> |
| 36 | + <property name="allowEscapesForControlCharacters" value="true"/> |
| 37 | + <property name="allowByTailComment" value="true"/> |
| 38 | + <property name="allowNonPrintableEscapes" value="true"/> |
| 39 | + </module> |
| 40 | + <module name="LineLength"> |
| 41 | + <property name="max" value="160"/> |
| 42 | + <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/> |
| 43 | + </module> |
| 44 | + <module name="AvoidStarImport"/> |
| 45 | + <module name="OneTopLevelClass"/> |
| 46 | + <module name="NoLineWrap"/> |
| 47 | + <module name="EmptyBlock"> |
| 48 | + <property name="option" value="TEXT"/> |
| 49 | + <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/> |
| 50 | + </module> |
| 51 | + <module name="NeedBraces"/> |
| 52 | + <module name="LeftCurly"> |
| 53 | + <property name="maxLineLength" value="160"/> |
| 54 | + </module> |
| 55 | + <module name="RightCurly"/> |
| 56 | + <module name="RightCurly"> |
| 57 | + <property name="option" value="alone"/> |
| 58 | + <property name="tokens" |
| 59 | + value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/> |
| 60 | + </module> |
| 61 | + <module name="WhitespaceAround"> |
| 62 | + <property name="allowEmptyConstructors" value="true"/> |
| 63 | + <property name="allowEmptyMethods" value="true"/> |
| 64 | + <property name="allowEmptyTypes" value="true"/> |
| 65 | + <property name="allowEmptyLoops" value="true"/> |
| 66 | + <message key="ws.notFollowed" |
| 67 | + value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/> |
| 68 | + <message key="ws.notPreceded" |
| 69 | + value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/> |
| 70 | + </module> |
| 71 | + <module name="OneStatementPerLine"/> |
| 72 | + <module name="MultipleVariableDeclarations"/> |
| 73 | + <module name="ArrayTypeStyle"/> |
| 74 | + <module name="MissingSwitchDefault"/> |
| 75 | + <module name="FallThrough"/> |
| 76 | + <module name="UpperEll"/> |
| 77 | + <module name="ModifierOrder"/> |
| 78 | + <module name="EmptyLineSeparator"> |
| 79 | + <property name="allowNoEmptyLineBetweenFields" value="true"/> |
| 80 | + </module> |
| 81 | + <module name="SeparatorWrap"> |
| 82 | + <property name="tokens" value="DOT"/> |
| 83 | + <property name="option" value="nl"/> |
| 84 | + </module> |
| 85 | + <module name="SeparatorWrap"> |
| 86 | + <property name="tokens" value="COMMA"/> |
| 87 | + <property name="option" value="EOL"/> |
| 88 | + </module> |
| 89 | + <module name="PackageName"> |
| 90 | + <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> |
| 91 | + <message key="name.invalidPattern" |
| 92 | + value="Package name ''{0}'' must match pattern ''{1}''."/> |
| 93 | + </module> |
| 94 | + <module name="TypeName"> |
| 95 | + <message key="name.invalidPattern" |
| 96 | + value="Type name ''{0}'' must match pattern ''{1}''."/> |
| 97 | + </module> |
| 98 | + <module name="MemberName"> |
| 99 | + <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/> |
| 100 | + <message key="name.invalidPattern" |
| 101 | + value="Member name ''{0}'' must match pattern ''{1}''."/> |
| 102 | + </module> |
| 103 | + <module name="ParameterName"> |
| 104 | + <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/> |
| 105 | + <message key="name.invalidPattern" |
| 106 | + value="Parameter name ''{0}'' must match pattern ''{1}''."/> |
| 107 | + </module> |
| 108 | + <module name="CatchParameterName"> |
| 109 | + <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/> |
| 110 | + <message key="name.invalidPattern" |
| 111 | + value="Catch parameter name ''{0}'' must match pattern ''{1}''."/> |
| 112 | + </module> |
| 113 | + <module name="LocalVariableName"> |
| 114 | + <property name="tokens" value="VARIABLE_DEF"/> |
| 115 | + <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/> |
| 116 | + <property name="allowOneCharVarInForLoop" value="true"/> |
| 117 | + <message key="name.invalidPattern" |
| 118 | + value="Local variable name ''{0}'' must match pattern ''{1}''."/> |
| 119 | + </module> |
| 120 | + <module name="ClassTypeParameterName"> |
| 121 | + <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/> |
| 122 | + <message key="name.invalidPattern" |
| 123 | + value="Class type name ''{0}'' must match pattern ''{1}''."/> |
| 124 | + </module> |
| 125 | + <module name="MethodTypeParameterName"> |
| 126 | + <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/> |
| 127 | + <message key="name.invalidPattern" |
| 128 | + value="Method type name ''{0}'' must match pattern ''{1}''."/> |
| 129 | + </module> |
| 130 | + <module name="InterfaceTypeParameterName"> |
| 131 | + <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/> |
| 132 | + <message key="name.invalidPattern" |
| 133 | + value="Interface type name ''{0}'' must match pattern ''{1}''."/> |
| 134 | + </module> |
| 135 | + <module name="NoFinalizer"/> |
| 136 | + <module name="GenericWhitespace"> |
| 137 | + <message key="ws.followed" |
| 138 | + value="GenericWhitespace ''{0}'' is followed by whitespace."/> |
| 139 | + <message key="ws.preceded" |
| 140 | + value="GenericWhitespace ''{0}'' is preceded with whitespace."/> |
| 141 | + <message key="ws.illegalFollow" |
| 142 | + value="GenericWhitespace ''{0}'' should followed by whitespace."/> |
| 143 | + <message key="ws.notPreceded" |
| 144 | + value="GenericWhitespace ''{0}'' is not preceded with whitespace."/> |
| 145 | + </module> |
| 146 | + <module name="Indentation"> |
| 147 | + <property name="basicOffset" value="4"/> |
| 148 | + <property name="braceAdjustment" value="0"/> |
| 149 | + <property name="caseIndent" value="4"/> |
| 150 | + <property name="throwsIndent" value="8"/> |
| 151 | + <property name="lineWrappingIndentation" value="8"/> |
| 152 | + <property name="arrayInitIndent" value="4"/> |
| 153 | + </module> |
| 154 | + <module name="AbbreviationAsWordInName"> |
| 155 | + <property name="ignoreFinal" value="false"/> |
| 156 | + <property name="allowedAbbreviationLength" value="1"/> |
| 157 | + </module> |
| 158 | + <module name="OverloadMethodsDeclarationOrder"/> |
| 159 | + <module name="VariableDeclarationUsageDistance"/> |
| 160 | + <module name="CustomImportOrder"> |
| 161 | + <property name="specialImportsRegExp" value="com.google"/> |
| 162 | + <property name="sortImportsInGroupAlphabetically" value="true"/> |
| 163 | + <property name="customImportOrderRules" |
| 164 | + value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/> |
| 165 | + </module> |
| 166 | + <module name="MethodParamPad"/> |
| 167 | + <module name="OperatorWrap"> |
| 168 | + <property name="option" value="NL"/> |
| 169 | + <property name="tokens" |
| 170 | + value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/> |
| 171 | + </module> |
| 172 | + <module name="AnnotationLocation"> |
| 173 | + <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/> |
| 174 | + </module> |
| 175 | + <module name="AnnotationLocation"> |
| 176 | + <property name="tokens" value="VARIABLE_DEF"/> |
| 177 | + <property name="allowSamelineMultipleAnnotations" value="true"/> |
| 178 | + </module> |
| 179 | + <module name="NonEmptyAtclauseDescription"/> |
| 180 | + <module name="JavadocTagContinuationIndentation"/> |
| 181 | + <module name="SummaryJavadoc"> |
| 182 | + <property name="forbiddenSummaryFragments" |
| 183 | + value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/> |
| 184 | + </module> |
| 185 | + <module name="JavadocParagraph"/> |
| 186 | + <module name="AtclauseOrder"> |
| 187 | + <property name="tagOrder" value="@param, @return, @throws, @deprecated"/> |
| 188 | + <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> |
| 189 | + </module> |
| 190 | + <module name="JavadocMethod"> |
| 191 | + <property name="scope" value="public"/> |
| 192 | + <property name="allowMissingParamTags" value="true"/> |
| 193 | + <property name="allowMissingThrowsTags" value="true"/> |
| 194 | + <property name="allowMissingReturnTag" value="true"/> |
| 195 | + <property name="minLineCount" value="2"/> |
| 196 | + <property name="allowedAnnotations" value="Override, Test"/> |
| 197 | + <property name="allowThrowsTagsForSubclasses" value="true"/> |
| 198 | + <property name="tokens" value="METHOD_DEF,ANNOTATION_FIELD_DEF"/> |
| 199 | + </module> |
| 200 | + <module name="MethodName"> |
| 201 | + <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/> |
| 202 | + <message key="name.invalidPattern" |
| 203 | + value="Method name ''{0}'' must match pattern ''{1}''."/> |
| 204 | + </module> |
| 205 | + <module name="SingleLineJavadoc"> |
| 206 | + <property name="ignoreInlineTags" value="false"/> |
| 207 | + </module> |
| 208 | + <module name="EmptyCatchBlock"> |
| 209 | + <property name="exceptionVariableName" value="expected"/> |
| 210 | + </module> |
| 211 | + <module name="CommentsIndentation"/> |
| 212 | + </module> |
| 213 | +</module> |
0 commit comments