blob: 8d5770725afcc54fc9a3fcae09e92d5d57ad5dba [file] [log] [blame]
Yuta HIGUCHIf9808442014-03-20 15:56:50 -07001<?xml version="1.0"?>
2<!DOCTYPE module PUBLIC
3 "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4 "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5
6
7<!--
8
9 Checkstyle configuration that checks the sun coding conventions from:
10
11 - the Java Language Specification at
12 http://java.sun.com/docs/books/jls/second_edition/html/index.html
13
14 - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
15
16 - the Javadoc guidelines at
17 http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
18
19 - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
20
21 - some best practices
22
23 Checkstyle is very configurable. Be sure to read the documentation at
24 http://checkstyle.sf.net (or in your downloaded distribution).
25
26 Most Checks are configurable, be sure to consult the documentation.
27
28 To completely disable a check, just comment it out or delete it from the file.
29
30 Finally, it is worth reading the documentation.
31
32-->
33
34<module name="Checker">
35 <!--
36 If you set the basedir property below, then all reported file
37 names will be relative to the specified directory. See
38 http://checkstyle.sourceforge.net/5.x/config.html#Checker
39
40 <property name="basedir" value="${basedir}"/>
41 -->
42 <!-- Checks that a package-info.java file exists for each package. -->
43 <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
44 <!-- ONOS does not currently supply package level Javadoc information
45 in package-info files -->
46 <!-- <module name="JavadocPackage"/> -->
47
48 <!-- Checks whether files end with a new line. -->
49 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
50 <module name="NewlineAtEndOfFile"/>
51
52 <!-- Checks that property files contain the same keys. -->
53 <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
54 <module name="Translation"/>
55
56 <!-- Checks for Size Violations. -->
57 <!-- See http://checkstyle.sf.net/config_sizes.html -->
58 <module name="FileLength"/>
59
60 <!-- Checks for whitespace -->
61 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
62 <module name="FileTabCharacter"/>
63
64 <!-- Miscellaneous other checks. -->
65 <!-- See http://checkstyle.sf.net/config_misc.html -->
66 <module name="RegexpSingleline">
67 <property name="format" value="\s+$"/>
68 <property name="minimum" value="0"/>
69 <property name="maximum" value="0"/>
70 <property name="message" value="Line has trailing spaces."/>
71 </module>
72
73 <!-- Checks for Headers -->
74 <!-- See http://checkstyle.sf.net/config_header.html -->
75 <!-- <module name="Header"> -->
76 <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
77 <!-- <property name="fileExtensions" value="java"/> -->
78 <!-- </module> -->
79
80 <module name="TreeWalker">
81
82 <!-- Checks for Javadoc comments. -->
83 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
84 <module name="JavadocMethod"/>
85 <module name="JavadocType"/>
86 <module name="JavadocVariable">
87 <!-- Suppress check for private member Javadocs.
88 Possibly revist fixing these. -->
89 <property name="scope" value="public"/>
90 </module>
91 <module name="JavadocStyle"/>
92
93
94 <!-- Checks for Naming Conventions. -->
95 <!-- See http://checkstyle.sf.net/config_naming.html -->
96 <module name="ConstantName"/>
97 <module name="LocalFinalVariableName"/>
98 <module name="LocalVariableName"/>
99 <module name="MemberName"/>
100 <module name="MethodName"/>
101 <module name="PackageName"/>
102 <module name="ParameterName"/>
103 <module name="StaticVariableName"/>
104 <module name="TypeName"/>
105
106
107 <!-- Checks for imports -->
108 <!-- See http://checkstyle.sf.net/config_import.html -->
109 <module name="AvoidStarImport"/>
110 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
111 <module name="RedundantImport"/>
112 <module name="UnusedImports"/>
113
114
115 <!-- Checks for Size Violations. -->
116 <!-- See http://checkstyle.sf.net/config_sizes.html -->
117 <module name="LineLength">
118 <!-- ONOS standard usage is 80 columns, but we allow up
119 to 120 to not break the build. -->
120 <property name="max" value="120" />
121 </module>
122 <module name="MethodLength"/>
123 <module name="ParameterNumber"/>
124
125
126 <!-- Checks for whitespace -->
127 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
128 <module name="EmptyForIteratorPad"/>
129 <module name="GenericWhitespace"/>
130 <module name="MethodParamPad"/>
131 <module name="NoWhitespaceAfter"/>
132 <module name="NoWhitespaceBefore"/>
133 <!-- Disabled for ONOS. Default rules specify undesired behavior for the '?' operator -->
134 <!-- <module name="OperatorWrap"/> -->
135 <module name="ParenPad"/>
136 <module name="TypecastParenPad"/>
137 <module name="WhitespaceAfter"/>
138 <module name="WhitespaceAround"/>
139
140
141 <!-- Modifier Checks -->
142 <!-- See http://checkstyle.sf.net/config_modifiers.html -->
143 <module name="ModifierOrder"/>
144 <module name="RedundantModifier"/>
145
146
147 <!-- Checks for blocks. You know, those {}'s -->
148 <!-- See http://checkstyle.sf.net/config_blocks.html -->
149 <module name="AvoidNestedBlocks">
150 <!-- ONOS alows declarations inside of switch case blocks -->
151 <property name="allowInSwitchCase" value="true"/>
152 <property name="severity" value="warning"/>
153 </module>
154 <module name="EmptyBlock"/>
155 <module name="LeftCurly"/>
156 <module name="NeedBraces"/>
157 <module name="RightCurly"/>
158
159
160 <!-- Checks for common coding problems -->
161 <!-- See http://checkstyle.sf.net/config_coding.html -->
162 <!-- ONOS allows conditional operators -->
163 <!-- <module name="AvoidInlineConditionals"/> -->
164 <module name="EmptyStatement"/>
165 <module name="EqualsHashCode"/>
166 <module name="HiddenField"/>
167 <module name="IllegalInstantiation"/>
168 <module name="InnerAssignment"/>
169 <!-- Many violations of this rule present, revist in a
170 subsequent round of cleanups -->
171 <!-- <module name="MagicNumber"/> -->
172 <module name="MissingSwitchDefault"/>
173 <module name="RedundantThrows"/>
174 <module name="SimplifyBooleanExpression"/>
175 <module name="SimplifyBooleanReturn"/>
176
177 <!-- Checks for class design -->
178 <!-- See http://checkstyle.sf.net/config_design.html -->
179 <!-- ONOS produces many warnings of this type.
180 Fixing all of these is outside the scope of the current cleanup. -->
181 <!-- <module name="DesignForExtension"/> -->
182 <module name="FinalClass"/>
183 <module name="HideUtilityClassConstructor"/>
184 <module name="InterfaceIsType"/>
185 <module name="VisibilityModifier"/>
186
187
188 <!-- Miscellaneous other checks. -->
189 <!-- See http://checkstyle.sf.net/config_misc.html -->
190 <module name="ArrayTypeStyle"/>
191 <!-- Many violations of this rule currently, too many to fix
192 in the current cleanup. -->
193 <!-- <module name="FinalParameters"/> -->
194 <!-- ONOS allows TODO markers in checked in source code -->
195 <!-- <module name="TodoComment"/> -->
196 <module name="UpperEll"/>
197
198 </module>
199
200</module>