1 <?xml version="1.0"?>
\r
2 <!DOCTYPE module PUBLIC
\r
3 "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
\r
4 "http://www.puppycrawl.com/dtds/configuration_1_2.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 <!-- Checks that a package.html file exists for each package. -->
\r
36 <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
\r
37 <module name="PackageHtml"/>
\r
39 <!-- Checks whether files end with a new line. -->
\r
40 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
\r
41 <module name="NewlineAtEndOfFile"/>
\r
43 <!-- Checks that property files contain the same keys. -->
\r
44 <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
\r
45 <module name="Translation"/>
\r
48 <module name="TreeWalker">
\r
50 <!-- Checks for Javadoc comments. -->
\r
51 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
\r
52 <module name="JavadocMethod"/>
\r
53 <module name="JavadocType"/>
\r
54 <module name="JavadocVariable"/>
\r
55 <module name="JavadocStyle"/>
\r
58 <!-- Checks for Naming Conventions. -->
\r
59 <!-- See http://checkstyle.sf.net/config_naming.html -->
\r
60 <module name="ConstantName"/>
\r
61 <module name="LocalFinalVariableName"/>
\r
62 <module name="LocalVariableName"/>
\r
63 <module name="MemberName"/>
\r
64 <module name="MethodName"/>
\r
65 <module name="PackageName"/>
\r
66 <module name="ParameterName"/>
\r
67 <module name="StaticVariableName"/>
\r
68 <module name="TypeName"/>
\r
71 <!-- Checks for Headers -->
\r
72 <!-- See http://checkstyle.sf.net/config_header.html -->
\r
73 <!-- <module name="Header"> -->
\r
74 <!-- The follow property value demonstrates the ability -->
\r
75 <!-- to have access to ANT properties. In this case it uses -->
\r
76 <!-- the ${basedir} property to allow Checkstyle to be run -->
\r
77 <!-- from any directory within a project. See property -->
\r
79 <!-- http://checkstyle.sf.net/config.html#properties -->
\r
81 <!-- name="headerFile" -->
\r
82 <!-- value="${basedir}/java.header"/> -->
\r
85 <!-- Following interprets the header file as regular expressions. -->
\r
86 <!-- <module name="RegexpHeader"/> -->
\r
89 <!-- Checks for imports -->
\r
90 <!-- See http://checkstyle.sf.net/config_import.html -->
\r
91 <module name="AvoidStarImport"/>
\r
92 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
\r
93 <module name="RedundantImport"/>
\r
94 <module name="UnusedImports"/>
\r
97 <!-- Checks for Size Violations. -->
\r
98 <!-- See http://checkstyle.sf.net/config_sizes.html -->
\r
99 <module name="FileLength"/>
\r
100 <module name="LineLength"/>
\r
101 <module name="MethodLength"/>
\r
102 <module name="ParameterNumber"/>
\r
105 <!-- Checks for whitespace -->
\r
106 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
\r
107 <module name="EmptyForIteratorPad"/>
\r
108 <module name="MethodParamPad"/>
\r
109 <module name="NoWhitespaceAfter"/>
\r
110 <module name="NoWhitespaceBefore"/>
\r
111 <module name="OperatorWrap"/>
\r
112 <module name="ParenPad"/>
\r
113 <module name="TypecastParenPad"/>
\r
114 <module name="TabCharacter"/>
\r
115 <module name="WhitespaceAfter"/>
\r
116 <module name="WhitespaceAround"/>
\r
119 <!-- Modifier Checks -->
\r
120 <!-- See http://checkstyle.sf.net/config_modifiers.html -->
\r
121 <module name="ModifierOrder"/>
\r
122 <module name="RedundantModifier"/>
\r
125 <!-- Checks for blocks. You know, those {}'s -->
\r
126 <!-- See http://checkstyle.sf.net/config_blocks.html -->
\r
127 <module name="AvoidNestedBlocks"/>
\r
128 <module name="EmptyBlock"/>
\r
129 <module name="LeftCurly"/>
\r
130 <module name="NeedBraces"/>
\r
131 <module name="RightCurly"/>
\r
134 <!-- Checks for common coding problems -->
\r
135 <!-- See http://checkstyle.sf.net/config_coding.html -->
\r
136 <module name="AvoidInlineConditionals"/>
\r
137 <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
\r
138 <module name="EmptyStatement"/>
\r
139 <module name="EqualsHashCode"/>
\r
140 <module name="HiddenField"/>
\r
141 <module name="IllegalInstantiation"/>
\r
142 <module name="InnerAssignment"/>
\r
143 <module name="MagicNumber"/>
\r
144 <module name="MissingSwitchDefault"/>
\r
145 <module name="RedundantThrows"/>
\r
146 <module name="SimplifyBooleanExpression"/>
\r
147 <module name="SimplifyBooleanReturn"/>
\r
149 <!-- Checks for class design -->
\r
150 <!-- See http://checkstyle.sf.net/config_design.html -->
\r
151 <module name="DesignForExtension"/>
\r
152 <module name="FinalClass"/>
\r
153 <module name="HideUtilityClassConstructor"/>
\r
154 <module name="InterfaceIsType"/>
\r
155 <module name="VisibilityModifier"/>
\r
158 <!-- Miscellaneous other checks. -->
\r
159 <!-- See http://checkstyle.sf.net/config_misc.html -->
\r
160 <module name="ArrayTypeStyle"/>
\r
161 <module name="FinalParameters"/>
\r
162 <module name="GenericIllegalRegexp">
\r
163 <property name="format" value="\s+$"/>
\r
164 <property name="message" value="Line has trailing spaces."/>
\r
166 <module name="TodoComment"/>
\r
167 <module name="UpperEll"/>
\r