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