dcae committer updates in INFO.yaml
[dcaegen2/analytics/tca.git] / checkstyle.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4   ~ ===============================LICENSE_START======================================
5   ~  dcae-analytics
6   ~ ================================================================================
7   ~    Copyright © 2017 AT&T Intellectual Property. All rights reserved.
8   ~ ================================================================================
9   ~  Licensed under the Apache License, Version 2.0 (the "License");
10   ~  you may not use this file except in compliance with the License.
11   ~   You may obtain a copy of the License at
12   ~
13   ~          http://www.apache.org/licenses/LICENSE-2.0
14   ~
15   ~  Unless required by applicable law or agreed to in writing, software
16   ~  distributed under the License is distributed on an "AS IS" BASIS,
17   ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   ~  See the License for the specific language governing permissions and
19   ~  limitations under the License.
20   ~  ============================LICENSE_END===========================================
21   -->
22
23 <!DOCTYPE module PUBLIC
24         "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
25         "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
26
27 <!-- This is a checkstyle configuration file. For descriptions of
28 what the following rules do, please see the checkstyle configuration
29 page at http://checkstyle.sourceforge.net/config.html -->
30
31 <module name="Checker">
32
33
34     <!--
35
36      COPYRIGHT HEADER CHECKS
37
38     -->
39
40
41     <module name="FileTabCharacter">
42         <property name="severity" value="error"/>
43         <!-- Checks that there are no tab characters in the file. -->
44     </module>
45
46     <!--
47
48     LENGTH CHECKS FOR FILES
49
50     -->
51
52     <module name="FileLength">
53         <property name="max" value="3000"/>
54         <property name="severity" value="warning"/>
55     </module>
56
57
58     <module name="NewlineAtEndOfFile">
59         <property name="lineSeparator" value="lf"/>
60     </module>
61
62     <module name="RegexpSingleline">
63         <!-- Checks that FIXME is not used in comments.  TODO is preferred. -->
64         <property name="format" value="((//.*)|(\*.*))FIXME"/>
65         <property name="message"
66                   value='TODO is preferred to FIXME.  e.g. "TODO: (ENG-123) -  Refactor when v2 is released."'/>
67     </module>
68
69     <module name="RegexpSingleline">
70         <!-- Checks that TODOs are named with some basic formatting. Checks for the following pattern  TODO: (
71         -->
72         <property name="format" value="((//.*)|(\*.*))TODO[^: (]"/>
73         <property name="message"
74                   value='All TODOs should be named.  e.g. "TODO: (ENG-123) - Refactor when v2 is released."'/>
75     </module>
76
77     <module name="JavadocPackage">
78         <!-- Checks that each Java package has a Javadoc file used for commenting.
79           Only allows a package-info.java, not package.html. -->
80         <property name="severity" value="error"/>
81     </module>
82
83     <!-- All Java AST specific tests live under TreeWalker module. -->
84     <module name="TreeWalker">
85
86         <!-- required for SupressionCommentFilter and SuppressWithNearbyCommentFilter -->
87         <module name="FileContentsHolder"/>
88
89         <!--
90
91         IMPORT CHECKS
92
93         -->
94
95         <module name="AvoidStarImport">
96             <property name="allowClassImports" value="false"/>
97             <property name="severity" value="error"/>
98         </module>
99
100         <module name="RedundantImport">
101             <!-- Checks for redundant import statements. -->
102             <property name="severity" value="error"/>
103         </module>
104
105         <module name="ImportOrder">
106             <!-- Checks for out of order import statements. -->
107             <property name="severity" value="error"/>
108             <property name="ordered" value="true"/>
109             <property name="groups" value="/([^j]|.[^a]|..[^v]|...[^a])/,/^javax?\./"/>
110             <!-- This ensures that static imports go to the end. -->
111             <property name="option" value="bottom"/>
112             <property name="tokens" value="STATIC_IMPORT, IMPORT"/>
113         </module>
114
115         <module name="IllegalImport">
116             <property name="illegalPkgs" value="junit.framework"/>
117         </module>
118
119         <!--
120
121         METHOD LENGTH CHECKS
122
123         -->
124
125         <module name="MethodLength">
126             <property name="tokens" value="METHOD_DEF"/>
127             <property name="max" value="300"/>
128             <property name="countEmpty" value="false"/>
129             <property name="severity" value="warning"/>
130         </module>
131
132         <!--
133
134         JAVADOC CHECKS
135
136         -->
137
138         <!-- Checks for Javadoc comments.                     -->
139         <!-- See http://checkstyle.sf.net/config_javadoc.html -->
140         <module name="JavadocMethod">
141             <property name="scope" value="protected"/>
142             <property name="severity" value="error"/>
143             <property name="allowMissingJavadoc" value="true"/>
144             <property name="allowMissingParamTags" value="true"/>
145             <property name="allowMissingReturnTag" value="true"/>
146             <property name="allowMissingThrowsTags" value="true"/>
147             <property name="allowThrowsTagsForSubclasses" value="true"/>
148             <property name="allowUndeclaredRTE" value="true"/>
149         </module>
150
151         <module name="JavadocType">
152             <property name="scope" value="protected"/>
153             <property name="severity" value="error"/>
154         </module>
155
156         <module name="JavadocStyle">
157             <property name="severity" value="error"/>
158         </module>
159
160         <!--
161
162         NAMING CHECKS
163
164         -->
165
166         <!-- Item 38 - Adhere to generally accepted naming conventions -->
167
168         <module name="PackageName">
169             <!-- Validates identifiers for package names against the
170               supplied expression. -->
171             <!-- Here the default checkstyle rule restricts package name parts to
172               seven characters, this is not in line with common practice at Google.
173             -->
174             <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]{1,})*$"/>
175             <property name="severity" value="error"/>
176         </module>
177
178         <module name="TypeNameCheck">
179             <!-- Validates static, final fields against the
180             expression "^[A-Z][a-zA-Z0-9]*$". -->
181             <metadata name="altname" value="TypeName"/>
182             <property name="severity" value="error"/>
183         </module>
184
185         <module name="ConstantNameCheck">
186             <!-- Validates non-private, static, final fields against the supplied
187             public/package final fields "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$". -->
188             <metadata name="altname" value="ConstantName"/>
189             <property name="applyToPublic" value="true"/>
190             <property name="applyToProtected" value="true"/>
191             <property name="applyToPackage" value="true"/>
192             <property name="applyToPrivate" value="false"/>
193             <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*|FLAG_.*)$"/>
194             <message key="name.invalidPattern"
195                      value="Variable ''{0}'' should be in ALL_CAPS (if it is a constant) or be private (otherwise)."/>
196             <property name="severity" value="error"/>
197         </module>
198
199         <module name="StaticVariableNameCheck">
200             <!-- Validates static, non-final fields against the supplied
201             expression "^[a-z][a-zA-Z0-9]*_?$". -->
202             <metadata name="altname" value="StaticVariableName"/>
203             <property name="applyToPublic" value="true"/>
204             <property name="applyToProtected" value="true"/>
205             <property name="applyToPackage" value="true"/>
206             <property name="applyToPrivate" value="true"/>
207             <property name="format" value="^[a-z][a-zA-Z0-9]*_?$"/>
208             <property name="severity" value="error"/>
209         </module>
210
211         <module name="MemberNameCheck">
212             <!-- Validates non-static members against the supplied expression. -->
213             <metadata name="altname" value="MemberName"/>
214             <property name="applyToPublic" value="true"/>
215             <property name="applyToProtected" value="true"/>
216             <property name="applyToPackage" value="true"/>
217             <property name="applyToPrivate" value="true"/>
218             <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
219             <property name="severity" value="error"/>
220         </module>
221
222         <module name="MethodNameCheck">
223             <!-- Validates identifiers for method names. -->
224             <metadata name="altname" value="MethodName"/>
225             <property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$"/>
226             <property name="severity" value="error"/>
227         </module>
228
229         <module name="ParameterName">
230             <!-- Validates identifiers for method parameters against the
231               expression "^[a-z][a-zA-Z0-9]*$". -->
232             <property name="severity" value="error"/>
233         </module>
234
235         <module name="LocalFinalVariableName">
236             <!-- Validates identifiers for local final variables against the
237               expression "^[a-z][a-zA-Z0-9]*$". -->
238             <property name="severity" value="error"/>
239         </module>
240
241         <module name="LocalVariableName">
242             <!-- Validates identifiers for local variables against the
243               expression "^[a-z][a-zA-Z0-9]*$". -->
244             <property name="severity" value="error"/>
245         </module>
246
247
248         <!--
249
250         LENGTH and CODING CHECKS
251
252         -->
253
254         <module name="LineLength">
255             <!-- Checks if a line is too long. -->
256             <property name="max" value="120" default="120"/>
257             <property name="severity" value="error"/>
258
259             <!--
260               The default ignore pattern exempts the following elements:
261                 - import statements
262                 - long URLs inside comments
263             -->
264
265             <property name="ignorePattern"
266                       value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
267                       default="^(package .*;\s*)|(import .*;\s*)|( *\* *https?://.*)$"/>
268         </module>
269
270         <module name="LeftCurly">
271             <!-- Checks for placement of the left curly brace ('{'). -->
272             <property name="severity" value="error"/>
273         </module>
274
275         <module name="RightCurly">
276             <!-- Checks right curlies on CATCH, ELSE, and TRY blocks are on
277             the same line. e.g., the following example is fine:
278             <pre>
279               if {
280                 ...
281               } else
282             </pre>
283             -->
284             <!-- This next example is not fine:
285             <pre>
286               if {
287                 ...
288               }
289               else
290             </pre>
291             -->
292             <property name="option" value="same"/>
293             <property name="severity" value="error"/>
294         </module>
295
296         <!-- Checks for braces around if and else blocks -->
297         <module name="NeedBraces">
298             <property name="severity" value="error"/>
299             <property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
300         </module>
301
302         <module name="UpperEll">
303             <!-- Checks that long constants are defined with an upper ell.-->
304             <property name="severity" value="error"/>
305         </module>
306
307         <module name="FallThrough">
308             <!-- Warn about falling through to the next case statement.  Similar to
309             javac -Xlint:fallthrough, but the check is suppressed if a single-line comment
310             on the last non-blank line preceding the fallen-into case contains 'fall through' (or
311             some other variants which we don't publicized to promote consistency).
312             -->
313             <property name="reliefPattern"
314                       value="fall through|Fall through|fallthru|Fallthru|falls through|Falls through|fallthrough|Fallthrough|No break|NO break|no break|continue on"/>
315             <property name="severity" value="error"/>
316         </module>
317
318
319         <!--
320
321         MODIFIERS CHECKS
322
323         -->
324
325         <module name="ModifierOrder">
326             <!-- Warn if modifier order is inconsistent with JLS3 8.1.1, 8.3.1, and
327                  8.4.3.  The prescribed order is:
328                  public, protected, private, abstract, static, final, transient, volatile,
329                  synchronized, native, strictfp
330               -->
331         </module>
332
333         <module name="RedundantModifier">
334             <!-- Checks for redundant modifiers in:
335                  - interface and annotation definitions,
336                  - the final modifier on methods of final classes, and
337                  - inner interface declarations that are declared as static.
338               -->
339         </module>
340
341
342         <!--
343
344         WHITESPACE CHECKS
345
346         -->
347         <module name="GenericWhitespace"/>
348
349         <module name="WhitespaceAround">
350             <!-- Checks that various tokens are surrounded by whitespace.
351                  This includes most binary operators and keywords followed
352                  by regular or curly braces.
353             -->
354             <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR,
355         BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN,
356         EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
357         LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
358         LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS,
359         MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION,
360         SL, SLIST, SL_ASSIGN, SR_ASSIGN, STAR, STAR_ASSIGN"/>
361             <property name="allowEmptyConstructors" value="true"/>
362             <property name="allowEmptyMethods" value="true"/>
363             <property name="severity" value="error"/>
364         </module>
365
366         <module name="WhitespaceAfter">
367             <!-- Checks that commas, semicolons and typecasts are followed by
368                  whitespace.
369             -->
370             <property name="tokens" value="COMMA, SEMI, TYPECAST"/>
371             <property name="severity" value="error"/>
372         </module>
373
374         <module name="NoWhitespaceAfter">
375             <!-- Checks that there is no whitespace after various unary operators.
376                  Linebreaks are allowed.
377             -->
378             <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS,
379         UNARY_PLUS"/>
380             <property name="allowLineBreaks" value="true"/>
381             <property name="severity" value="error"/>
382         </module>
383
384         <module name="NoWhitespaceBefore">
385             <!-- Checks that there is no whitespace before various unary operators.
386                  Linebreaks are allowed.
387             -->
388             <property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC"/>
389             <property name="allowLineBreaks" value="true"/>
390             <property name="severity" value="error"/>
391         </module>
392
393         <module name="ParenPad">
394             <!-- Checks that there is no whitespace before close parens or after
395                  open parens.
396             -->
397             <property name="severity" value="error"/>
398         </module>
399
400     </module>
401
402     <!--
403       Optional suppression filter. It is optional because when running with Maven, it should be the
404        checkstyle plugin who provides it. It is only used when this file is used in IntelliJ.
405       -->
406     <module name="SuppressionFilter">
407         <property name="file" value="suppressions.xml"/>
408         <property name="optional" value="true"/>
409     </module>
410
411     <module name="SuppressionCommentFilter">
412         <property name="offCommentFormat" value="CHECKSTYLE OFF: (.+)"/>
413         <property name="onCommentFormat" value="CHECKSTYLE ON"/>
414         <property name="checkFormat" value="Javadoc.*"/>
415         <property name="messageFormat" value="$1"/>
416     </module>
417
418 </module>