blob: 502ea7ac209a91509337054d7a01d933b8bb7a5c [file] [log] [blame]
econwara723c892019-04-26 14:57:47 +00001<?xml version="1.0"?>
2<!--
3 ============LICENSE_START=======================================================
4 Copyright (C) 2019 Nordix Foundation.
5 ================================================================================
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 SPDX-License-Identifier: Apache-2.0
19 ============LICENSE_END=========================================================
20-->
21<!DOCTYPE module PUBLIC
22 "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
23 "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
24
25<!--
26
27 Checkstyle configuration that checks the Google coding conventions from:
28
29 - Google Java Style
30 https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html
31
32 Checkstyle is very configurable. Be sure to read the documentation at
33 http://checkstyle.sf.net (or in your downloaded distribution).
34
35 Most Checks are configurable, be sure to consult the documentation.
36
37 To completely disable a check, just comment it out or delete it from the file.
38
39 Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
40
41 -->
42
43<module name = "Checker">
44 <property name="charset" value="UTF-8"/>
45
46 <property name="severity" value="warning"/>
47
48 <property name="fileExtensions" value="java, properties, xml"/>
49 <!-- Checks for whitespace -->
50 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
51 <module name="FileTabCharacter">
52 <property name="eachLine" value="true"/>
53 </module>
54 <module name="SuppressionFilter">
econwar0a440fd2019-05-29 13:19:49 +000055 <property name="file" value="ci_scripts/suppressedFilesForStyleCheck.xml" />
econwara723c892019-04-26 14:57:47 +000056 </module>
57 <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>
69 <module name="LineLength">
70 <property name="max" value="120"/>
71 <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
72 </module>
73 <module name="AvoidStarImport"/>
74 <module name="OneTopLevelClass"/>
75 <module name="NoLineWrap"/>
76 <module name="EmptyBlock">
77 <property name="option" value="TEXT"/>
78 <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
79 </module>
80 <module name="NeedBraces"/>
81 <module name="LeftCurly">
82 </module>
83 <module name="RightCurly">
84 <property name="option" value="alone"/>
85 <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
86 </module>
87 <module name="WhitespaceAround">
88 <property name="allowEmptyConstructors" value="true"/>
89 <property name="allowEmptyMethods" value="true"/>
90 <property name="allowEmptyTypes" value="true"/>
91 <property name="allowEmptyLoops" value="true"/>
92 <message key="ws.notFollowed"
93 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)"/>
94 <message key="ws.notPreceded"
95 value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
96 </module>
97 <module name="OneStatementPerLine"/>
98 <module name="MultipleVariableDeclarations"/>
99 <module name="ArrayTypeStyle"/>
100 <module name="MissingSwitchDefault"/>
101 <module name="FallThrough"/>
102 <module name="UpperEll"/>
103 <module name="ModifierOrder"/>
104 <module name="EmptyLineSeparator">
105 <property name="allowNoEmptyLineBetweenFields" value="true"/>
106 </module>
107 <module name="SeparatorWrap">
108 <property name="tokens" value="DOT"/>
109 <property name="option" value="nl"/>
110 </module>
111 <module name="SeparatorWrap">
112 <property name="tokens" value="COMMA"/>
113 <property name="option" value="EOL"/>
114 </module>
115 <module name="PackageName">
116 <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
117 <message key="name.invalidPattern"
118 value="Package name ''{0}'' must match pattern ''{1}''."/>
119 </module>
120 <module name="TypeName">
121 <message key="name.invalidPattern"
122 value="Type name ''{0}'' must match pattern ''{1}''."/>
123 </module>
124 <module name="MemberName">
125 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
126 <message key="name.invalidPattern"
127 value="Member name ''{0}'' must match pattern ''{1}''."/>
128 </module>
129 <module name="ParameterName">
130 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
131 <message key="name.invalidPattern"
132 value="Parameter name ''{0}'' must match pattern ''{1}''."/>
133 </module>
134 <module name="LocalVariableName">
135 <property name="tokens" value="VARIABLE_DEF"/>
136 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
137 <property name="allowOneCharVarInForLoop" value="true"/>
138 <message key="name.invalidPattern"
139 value="Local variable name ''{0}'' must match pattern ''{1}''."/>
140 </module>
141 <module name="ClassTypeParameterName">
142 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
143 <message key="name.invalidPattern"
144 value="Class type name ''{0}'' must match pattern ''{1}''."/>
145 </module>
146 <module name="MethodTypeParameterName">
147 <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
148 <message key="name.invalidPattern"
149 value="Method type name ''{0}'' must match pattern ''{1}''."/>
150 </module>
151 <module name="NoFinalizer"/>
152 <module name="GenericWhitespace">
153 <message key="ws.followed"
154 value="GenericWhitespace ''{0}'' is followed by whitespace."/>
155 <message key="ws.preceded"
156 value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
157 <message key="ws.illegalFollow"
158 value="GenericWhitespace ''{0}'' should followed by whitespace."/>
159 <message key="ws.notPreceded"
160 value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
161 </module>
162 <module name="Indentation">
163 <property name="basicOffset" value="4"/>
164 <property name="braceAdjustment" value="0"/>
165 <property name="caseIndent" value="4"/>
166 <property name="throwsIndent" value="4"/>
167 <property name="lineWrappingIndentation" value="4"/>
168 <property name="arrayInitIndent" value="4"/>
169 </module>
170 <module name="AbbreviationAsWordInName">
171 <property name="ignoreFinal" value="false"/>
econwarcf554562019-06-24 20:13:36 +0000172 <property name="allowedAbbreviationLength" value="20"/>
econwara723c892019-04-26 14:57:47 +0000173 </module>
174 <module name="OverloadMethodsDeclarationOrder"/>
175 <module name="VariableDeclarationUsageDistance"/>
176 <module name="CustomImportOrder">
177 <property name="sortImportsInGroupAlphabetically" value="true"/>
178 <property name="separateLineBetweenGroups" value="true"/>
179 <property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
180 </module>
181 <module name="MethodParamPad"/>
182 <module name="OperatorWrap">
183 <property name="option" value="NL"/>
184 <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 "/>
185 </module>
186 <module name="AnnotationLocation">
187 <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
188 </module>
189 <module name="AnnotationLocation">
190 <property name="tokens" value="VARIABLE_DEF"/>
191 <property name="allowSamelineMultipleAnnotations" value="true"/>
192 </module>
193 <module name="NonEmptyAtclauseDescription"/>
194 <module name="JavadocTagContinuationIndentation"/>
195 <module name="SummaryJavadocCheck">
196 <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
197 </module>
198 <module name="JavadocParagraph"/>
199 <module name="AtclauseOrder">
200 <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
201 <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
202 </module>
203 <module name="JavadocMethod">
204 <property name="scope" value="public"/>
205 <property name="allowMissingParamTags" value="true"/>
206 <property name="allowMissingThrowsTags" value="true"/>
207 <property name="allowMissingReturnTag" value="true"/>
208 <property name="minLineCount" value="2"/>
209 <property name="allowedAnnotations" value="Override, Test"/>
210 <property name="allowThrowsTagsForSubclasses" value="true"/>
211 </module>
212 <module name="MethodName">
213 <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
214 <message key="name.invalidPattern"
215 value="Method name ''{0}'' must match pattern ''{1}''."/>
216 </module>
217 <module name="SingleLineJavadoc">
218 <property name="ignoreInlineTags" value="false"/>
219 </module>
220 <module name="EmptyCatchBlock">
221 <property name="exceptionVariableName" value="expected"/>
222 </module>
223 <module name="CommentsIndentation"/>
224 </module>
225</module>