1 <?xml version="1.0"?>
\r
2 <!DOCTYPE module PUBLIC
\r
3 "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
\r
4 "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
\r
8 Checkstyle configuration that checks the sun coding conventions from:
\r
10 - the Java Language Specification at
\r
11 http://java.sun.com/docs/books/jls/second_edition/html/index.html
\r
13 - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
\r
15 - the Javadoc guidelines at
\r
16 http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
\r
18 - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
\r
20 - some best practices
\r
22 Checkstyle is very configurable. Be sure to read the documentation at
\r
23 http://checkstyle.sf.net (or in your downloaded distribution).
\r
25 Most Checks are configurable, be sure to consult the documentation.
\r
27 To completely disable a check, just comment it out or delete it from the file.
\r
29 Finally, it is worth reading the documentation.
\r
33 <module name="Checker">
\r
35 If you set the basedir property below, then all reported file
\r
36 names will be relative to the specified directory. See
\r
37 http://checkstyle.sourceforge.net/5.x/config.html#Checker
\r
39 <property name="basedir" value="${basedir}"/>
\r
42 <!-- Checks that a package-info.java file exists for each package. -->
\r
43 <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
\r
44 <module name="JavadocPackage"/>
\r
46 <!-- Checks whether files end with a new line. -->
\r
47 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
\r
48 <module name="NewlineAtEndOfFile"/>
\r
50 <!-- Checks that property files contain the same keys. -->
\r
51 <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
\r
52 <module name="Translation"/>
\r
54 <!-- Checks for Size Violations. -->
\r
55 <!-- See http://checkstyle.sf.net/config_sizes.html -->
\r
56 <module name="FileLength"/>
\r
58 <!-- Checks for whitespace -->
\r
59 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
\r
60 <module name="FileTabCharacter"/>
\r
62 <!-- Miscellaneous other checks. -->
\r
63 <!-- See http://checkstyle.sf.net/config_misc.html -->
\r
64 <module name="RegexpSingleline">
\r
65 <property name="format" value="\s+$"/>
\r
66 <property name="minimum" value="0"/>
\r
67 <property name="maximum" value="0"/>
\r
68 <property name="message" value="Line has trailing spaces."/>
\r
71 <module name="TreeWalker">
\r
73 <!-- Checks for Javadoc comments. -->
\r
74 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
\r
75 <module name="JavadocMethod"/>
\r
76 <module name="JavadocType"/>
\r
77 <module name="JavadocVariable"/>
\r
78 <module name="JavadocStyle"/>
\r
81 <!-- Checks for Naming Conventions. -->
\r
82 <!-- See http://checkstyle.sf.net/config_naming.html -->
\r
83 <module name="ConstantName"/>
\r
84 <module name="LocalFinalVariableName"/>
\r
85 <module name="LocalVariableName"/>
\r
86 <module name="MemberName"/>
\r
87 <module name="MethodName"/>
\r
88 <module name="PackageName"/>
\r
89 <module name="ParameterName"/>
\r
90 <module name="StaticVariableName"/>
\r
91 <module name="TypeName"/>
\r
94 <!-- Checks for Headers -->
\r
95 <!-- See http://checkstyle.sf.net/config_header.html -->
\r
96 <!-- <module name="Header"> -->
\r
97 <!-- The follow property value demonstrates the ability -->
\r
98 <!-- to have access to ANT properties. In this case it uses -->
\r
99 <!-- the ${basedir} property to allow Checkstyle to be run -->
\r
100 <!-- from any directory within a project. See property -->
\r
101 <!-- expansion, -->
\r
102 <!-- http://checkstyle.sf.net/config.html#properties -->
\r
104 <!-- name="headerFile" -->
\r
105 <!-- value="${basedir}/java.header"/> -->
\r
108 <!-- Following interprets the header file as regular expressions. -->
\r
109 <!-- <module name="RegexpHeader"/> -->
\r
112 <!-- Checks for imports -->
\r
113 <!-- See http://checkstyle.sf.net/config_import.html -->
\r
114 <module name="AvoidStarImport"/>
\r
115 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
\r
116 <module name="RedundantImport"/>
\r
117 <module name="UnusedImports"/>
\r
120 <!-- Checks for Size Violations. -->
\r
121 <!-- See http://checkstyle.sf.net/config_sizes.html -->
\r
122 <module name="LineLength"/>
\r
123 <module name="MethodLength"/>
\r
124 <module name="ParameterNumber"/>
\r
127 <!-- Checks for whitespace -->
\r
128 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
\r
129 <module name="EmptyForIteratorPad"/>
\r
130 <module name="GenericWhitespace"/>
\r
131 <module name="MethodParamPad"/>
\r
132 <module name="NoWhitespaceAfter"/>
\r
133 <module name="NoWhitespaceBefore"/>
\r
134 <module name="OperatorWrap"/>
\r
135 <module name="ParenPad"/>
\r
136 <module name="TypecastParenPad"/>
\r
137 <module name="WhitespaceAfter"/>
\r
138 <module name="WhitespaceAround"/>
\r
141 <!-- Modifier Checks -->
\r
142 <!-- See http://checkstyle.sf.net/config_modifiers.html -->
\r
143 <module name="ModifierOrder"/>
\r
144 <module name="RedundantModifier"/>
\r
147 <!-- Checks for blocks. You know, those {}'s -->
\r
148 <!-- See http://checkstyle.sf.net/config_blocks.html -->
\r
149 <module name="AvoidNestedBlocks"/>
\r
150 <module name="EmptyBlock"/>
\r
151 <module name="LeftCurly"/>
\r
152 <module name="NeedBraces"/>
\r
153 <module name="RightCurly"/>
\r
156 <!-- Checks for common coding problems -->
\r
157 <!-- See http://checkstyle.sf.net/config_coding.html -->
\r
158 <module name="AvoidInlineConditionals"/>
\r
159 <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
\r
160 <module name="EmptyStatement"/>
\r
161 <module name="EqualsHashCode"/>
\r
162 <module name="HiddenField"/>
\r
163 <module name="IllegalInstantiation"/>
\r
164 <module name="InnerAssignment"/>
\r
165 <module name="MagicNumber"/>
\r
166 <module name="MissingSwitchDefault"/>
\r
167 <module name="RedundantThrows"/>
\r
168 <module name="SimplifyBooleanExpression"/>
\r
169 <module name="SimplifyBooleanReturn"/>
\r
171 <!-- Checks for class design -->
\r
172 <!-- See http://checkstyle.sf.net/config_design.html -->
\r
173 <module name="DesignForExtension"/>
\r
174 <module name="FinalClass"/>
\r
175 <module name="HideUtilityClassConstructor"/>
\r
176 <module name="InterfaceIsType"/>
\r
177 <module name="VisibilityModifier"/>
\r
180 <!-- Miscellaneous other checks. -->
\r
181 <!-- See http://checkstyle.sf.net/config_misc.html -->
\r
182 <module name="ArrayTypeStyle"/>
\r
183 <module name="FinalParameters"/>
\r
184 <module name="TodoComment"/>
\r
185 <module name="UpperEll"/>
\r