blob: 32439e26d3dee780f0136e43f7cd959903bb8a2a [file] [log] [blame]
Gary Wu7f1c1522017-06-21 15:03:17 -07001<?xml version="1.0"?>
2<!--
3 Copyright (c) 2016 Huawei Technologies Co., Ltd.
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<!DOCTYPE module PUBLIC
18 "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
19 "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
20
21<!--
22
23 Checkstyle configuration that checks the Google coding conventions from:
24
25 - Google Java Style
26 https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html
27
28 Checkstyle is very configurable. Be sure to read the documentation at
29 http://checkstyle.sf.net (or in your downloaded distribution).
30
31 Most Checks are configurable, be sure to consult the documentation.
32
33 To completely disable a check, just comment it out or delete it from the file.
34
35 Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
36
37 -->
38
39<module name = "Checker">
40 <property name="charset" value="UTF-8"/>
41
42 <property name="severity" value="warning"/>
43
44 <property name="fileExtensions" value="java, properties, xml"/>
45 <!-- Checks for whitespace -->
46 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
47 <module name="FileTabCharacter">
48 <property name="eachLine" value="true"/>
49 </module>
50
51 <module name="TreeWalker">
52 <module name="OuterTypeFilename"/>
53 <module name="IllegalTokenText">
54 <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
55 <property name="format" 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)"/>
56 <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
57 </module>
58 <module name="AvoidEscapedUnicodeCharacters">
59 <property name="allowEscapesForControlCharacters" value="true"/>
60 <property name="allowByTailComment" value="true"/>
61 <property name="allowNonPrintableEscapes" value="true"/>
62 </module>
63 <module name="LineLength">
64 <property name="max" value="120"/>
65 <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
66 </module>
67 <module name="AvoidStarImport"/>
68 <module name="OneTopLevelClass"/>
69 <module name="NoLineWrap"/>
70 <module name="EmptyBlock">
71 <property name="option" value="TEXT"/>
72 <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
73 </module>
74 <module name="NeedBraces"/>
75 <module name="LeftCurly">
76 <property name="maxLineLength" value="120"/>
77 </module>
78 <module name="RightCurly">
79 <property name="option" value="alone"/>
80 <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
81 </module>
82 <module name="WhitespaceAround">
83 <property name="allowEmptyConstructors" value="true"/>
84 <property name="allowEmptyMethods" value="true"/>
85 <property name="allowEmptyTypes" value="true"/>
86 <property name="allowEmptyLoops" value="true"/>
87 <message key="ws.notFollowed"
88 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)"/>
89 <message key="ws.notPreceded"
90 value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
91 </module>
92 <module name="OneStatementPerLine"/>
93 <module name="MultipleVariableDeclarations"/>
94 <module name="ArrayTypeStyle"/>
95 <module name="MissingSwitchDefault"/>
96 <module name="FallThrough"/>
97 <module name="UpperEll"/>
98 <module name="ModifierOrder"/>
99 <module name="EmptyLineSeparator">
100 <property name="allowNoEmptyLineBetweenFields" value="true"/>
101 </module>
102 <module name="SeparatorWrap">
103 <property name="tokens" value="DOT"/>
104 <property name="option" value="nl"/>
105 </module>
106 <module name="SeparatorWrap">
107 <property name="tokens" value="COMMA"/>
108 <property name="option" value="EOL"/>
109 </module>
110 <module name="PackageName">
111 <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
112 <message key="name.invalidPattern"
113 value="Package name ''{0}'' must match pattern ''{1}''."/>
114 </module>
115 <module name="TypeName">
116 <message key="name.invalidPattern"
117 value="Type name ''{0}'' must match pattern ''{1}''."/>
118 </module>
119 <module name="MemberName">
120 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
121 <message key="name.invalidPattern"
122 value="Member name ''{0}'' must match pattern ''{1}''."/>
123 </module>
124 <module name="ParameterName">
125 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
126 <message key="name.invalidPattern"
127 value="Parameter name ''{0}'' must match pattern ''{1}''."/>
128 </module>
129 <module name="LocalVariableName">
130 <property name="tokens" value="VARIABLE_DEF"/>
131 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
132 <property name="allowOneCharVarInForLoop" value="true"/>
133 <message key="name.invalidPattern"
134 value="Local variable name ''{0}'' must match pattern ''{1}''."/>
135 </module>
136 <module name="ClassTypeParameterName">
137 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
138 <message key="name.invalidPattern"
139 value="Class type name ''{0}'' must match pattern ''{1}''."/>
140 </module>
141 <module name="MethodTypeParameterName">
142 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
143 <message key="name.invalidPattern"
144 value="Method type name ''{0}'' must match pattern ''{1}''."/>
145 </module>
146 <module name="NoFinalizer"/>
147 <module name="GenericWhitespace">
148 <message key="ws.followed"
149 value="GenericWhitespace ''{0}'' is followed by whitespace."/>
150 <message key="ws.preceded"
151 value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
152 <message key="ws.illegalFollow"
153 value="GenericWhitespace ''{0}'' should followed by whitespace."/>
154 <message key="ws.notPreceded"
155 value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
156 </module>
157 <module name="Indentation">
158 <property name="basicOffset" value="4"/>
159 <property name="braceAdjustment" value="0"/>
160 <property name="caseIndent" value="4"/>
161 <property name="throwsIndent" value="4"/>
162 <property name="lineWrappingIndentation" value="4"/>
163 <property name="arrayInitIndent" value="4"/>
164 </module>
165 <module name="AbbreviationAsWordInName">
166 <property name="ignoreFinal" value="false"/>
167 <property name="allowedAbbreviationLength" value="1"/>
168 </module>
169 <module name="OverloadMethodsDeclarationOrder"/>
170 <module name="VariableDeclarationUsageDistance"/>
171 <module name="CustomImportOrder">
172 <property name="sortImportsInGroupAlphabetically" value="true"/>
173 <property name="separateLineBetweenGroups" value="true"/>
174 <property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
175 </module>
176 <module name="MethodParamPad"/>
177 <module name="OperatorWrap">
178 <property name="option" value="NL"/>
179 <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
180 </module>
181 <module name="AnnotationLocation">
182 <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
183 </module>
184 <module name="AnnotationLocation">
185 <property name="tokens" value="VARIABLE_DEF"/>
186 <property name="allowSamelineMultipleAnnotations" value="true"/>
187 </module>
188 <module name="NonEmptyAtclauseDescription"/>
189 <module name="JavadocTagContinuationIndentation"/>
190 <module name="SummaryJavadocCheck">
191 <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
192 </module>
193 <module name="JavadocParagraph"/>
194 <module name="AtclauseOrder">
195 <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
196 <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
197 </module>
198 <module name="JavadocMethod">
199 <property name="scope" value="public"/>
200 <property name="allowMissingParamTags" value="true"/>
201 <property name="allowMissingThrowsTags" value="true"/>
202 <property name="allowMissingReturnTag" value="true"/>
203 <property name="minLineCount" value="2"/>
204 <property name="allowedAnnotations" value="Override, Test"/>
205 <property name="allowThrowsTagsForSubclasses" value="true"/>
206 </module>
207 <module name="MethodName">
208 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
209 <message key="name.invalidPattern"
210 value="Method name ''{0}'' must match pattern ''{1}''."/>
211 </module>
212 <module name="SingleLineJavadoc">
213 <property name="ignoreInlineTags" value="false"/>
214 </module>
215 <module name="EmptyCatchBlock">
216 <property name="exceptionVariableName" value="expected"/>
217 </module>
218 <module name="CommentsIndentation"/>
219 </module>
220</module>