blob: 77ef3ae9c989e5f9f0e2f81abbd5c5d742c74ebe [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">
Gary Wu7f1c1522017-06-21 15:03:17 -070076 </module>
77 <module name="RightCurly">
78 <property name="option" value="alone"/>
79 <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
80 </module>
81 <module name="WhitespaceAround">
82 <property name="allowEmptyConstructors" value="true"/>
83 <property name="allowEmptyMethods" value="true"/>
84 <property name="allowEmptyTypes" value="true"/>
85 <property name="allowEmptyLoops" value="true"/>
86 <message key="ws.notFollowed"
87 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)"/>
88 <message key="ws.notPreceded"
89 value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
90 </module>
91 <module name="OneStatementPerLine"/>
92 <module name="MultipleVariableDeclarations"/>
93 <module name="ArrayTypeStyle"/>
94 <module name="MissingSwitchDefault"/>
95 <module name="FallThrough"/>
96 <module name="UpperEll"/>
97 <module name="ModifierOrder"/>
98 <module name="EmptyLineSeparator">
99 <property name="allowNoEmptyLineBetweenFields" value="true"/>
100 </module>
101 <module name="SeparatorWrap">
102 <property name="tokens" value="DOT"/>
103 <property name="option" value="nl"/>
104 </module>
105 <module name="SeparatorWrap">
106 <property name="tokens" value="COMMA"/>
107 <property name="option" value="EOL"/>
108 </module>
109 <module name="PackageName">
110 <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
111 <message key="name.invalidPattern"
112 value="Package name ''{0}'' must match pattern ''{1}''."/>
113 </module>
114 <module name="TypeName">
115 <message key="name.invalidPattern"
116 value="Type name ''{0}'' must match pattern ''{1}''."/>
117 </module>
118 <module name="MemberName">
119 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
120 <message key="name.invalidPattern"
121 value="Member name ''{0}'' must match pattern ''{1}''."/>
122 </module>
123 <module name="ParameterName">
124 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
125 <message key="name.invalidPattern"
126 value="Parameter name ''{0}'' must match pattern ''{1}''."/>
127 </module>
128 <module name="LocalVariableName">
129 <property name="tokens" value="VARIABLE_DEF"/>
130 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
131 <property name="allowOneCharVarInForLoop" value="true"/>
132 <message key="name.invalidPattern"
133 value="Local variable name ''{0}'' must match pattern ''{1}''."/>
134 </module>
135 <module name="ClassTypeParameterName">
136 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
137 <message key="name.invalidPattern"
138 value="Class type name ''{0}'' must match pattern ''{1}''."/>
139 </module>
140 <module name="MethodTypeParameterName">
141 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
142 <message key="name.invalidPattern"
143 value="Method type name ''{0}'' must match pattern ''{1}''."/>
144 </module>
145 <module name="NoFinalizer"/>
146 <module name="GenericWhitespace">
147 <message key="ws.followed"
148 value="GenericWhitespace ''{0}'' is followed by whitespace."/>
149 <message key="ws.preceded"
150 value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
151 <message key="ws.illegalFollow"
152 value="GenericWhitespace ''{0}'' should followed by whitespace."/>
153 <message key="ws.notPreceded"
154 value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
155 </module>
156 <module name="Indentation">
157 <property name="basicOffset" value="4"/>
158 <property name="braceAdjustment" value="0"/>
159 <property name="caseIndent" value="4"/>
160 <property name="throwsIndent" value="4"/>
161 <property name="lineWrappingIndentation" value="4"/>
162 <property name="arrayInitIndent" value="4"/>
163 </module>
164 <module name="AbbreviationAsWordInName">
165 <property name="ignoreFinal" value="false"/>
166 <property name="allowedAbbreviationLength" value="1"/>
167 </module>
168 <module name="OverloadMethodsDeclarationOrder"/>
169 <module name="VariableDeclarationUsageDistance"/>
170 <module name="CustomImportOrder">
171 <property name="sortImportsInGroupAlphabetically" value="true"/>
172 <property name="separateLineBetweenGroups" value="true"/>
173 <property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
174 </module>
175 <module name="MethodParamPad"/>
176 <module name="OperatorWrap">
177 <property name="option" value="NL"/>
178 <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 "/>
179 </module>
180 <module name="AnnotationLocation">
181 <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
182 </module>
183 <module name="AnnotationLocation">
184 <property name="tokens" value="VARIABLE_DEF"/>
185 <property name="allowSamelineMultipleAnnotations" value="true"/>
186 </module>
187 <module name="NonEmptyAtclauseDescription"/>
188 <module name="JavadocTagContinuationIndentation"/>
189 <module name="SummaryJavadocCheck">
190 <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
191 </module>
192 <module name="JavadocParagraph"/>
193 <module name="AtclauseOrder">
194 <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
195 <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
196 </module>
197 <module name="JavadocMethod">
198 <property name="scope" value="public"/>
199 <property name="allowMissingParamTags" value="true"/>
200 <property name="allowMissingThrowsTags" value="true"/>
201 <property name="allowMissingReturnTag" value="true"/>
202 <property name="minLineCount" value="2"/>
203 <property name="allowedAnnotations" value="Override, Test"/>
204 <property name="allowThrowsTagsForSubclasses" value="true"/>
205 </module>
206 <module name="MethodName">
207 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
208 <message key="name.invalidPattern"
209 value="Method name ''{0}'' must match pattern ''{1}''."/>
210 </module>
211 <module name="SingleLineJavadoc">
212 <property name="ignoreInlineTags" value="false"/>
213 </module>
214 <module name="EmptyCatchBlock">
215 <property name="exceptionVariableName" value="expected"/>
216 </module>
217 <module name="CommentsIndentation"/>
218 </module>
219</module>