2 <!DOCTYPE module PUBLIC
3 "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4 "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
8 Checkstyle configuration that checks the sun coding conventions from:
10 - the Java Language Specification at
11 http://java.sun.com/docs/books/jls/second_edition/html/index.html
13 - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
15 - the Javadoc guidelines at
16 http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
18 - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
22 Checkstyle is very configurable. Be sure to read the documentation at
23 http://checkstyle.sf.net (or in your downloaded distribution).
25 Most Checks are configurable, be sure to consult the documentation.
27 To completely disable a check, just comment it out or delete it from the file.
29 Finally, it is worth reading the documentation.
33 <module name="Checker">
35 If you set the basedir property below, then all reported file
36 names will be relative to the specified directory. See
37 http://checkstyle.sourceforge.net/5.x/config.html#Checker
39 <property name="basedir" value="${basedir}"/>
41 <property name="charset" value="UTF-8"/>
43 <property name="severity" value="warning"/>
45 <property name="fileExtensions" value="java, properties, xml"/>
47 <!-- Checks whether files end with a new line. -->
48 <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
49 <module name="NewlineAtEndOfFile"/>
51 <!-- Checks that property files contain the same keys. -->
52 <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
53 <module name="Translation"/>
55 <!-- Checks for Size Violations. -->
56 <!-- See http://checkstyle.sf.net/config_sizes.html -->
57 <module name="FileLength"/>
59 <!-- Checks for whitespace -->
60 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
61 <module name="FileTabCharacter"/>
63 <!-- Miscellaneous other checks. -->
64 <!-- See http://checkstyle.sf.net/config_misc.html -->
65 <module name="RegexpSingleline">
66 <property name="format" value="\s+$"/>
67 <property name="minimum" value="0"/>
68 <property name="maximum" value="0"/>
69 <property name="message" value="Line has trailing spaces."/>
72 <!-- Checks for Headers -->
73 <!-- See http://checkstyle.sf.net/config_header.html -->
74 <!-- <module name="Header"> -->
75 <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
76 <!-- <property name="fileExtensions" value="java"/> -->
79 <module name="TreeWalker">
81 <!-- Checks for Javadoc comments. -->
82 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
83 <module name="JavadocMethod">
84 <property name="scope" value="public"/>
86 <module name="JavadocType"/>
87 <module name="JavadocVariable">
88 <property name="scope" value="public"/>
90 <module name="JavadocStyle"/>
92 <!-- Checks for Naming Conventions. -->
93 <!-- See http://checkstyle.sf.net/config_naming.html -->
94 <module name="ConstantName"/>
95 <module name="LocalFinalVariableName"/>
96 <module name="LocalVariableName"/>
97 <module name="MemberName"/>
98 <module name="MethodName"/>
99 <module name="PackageName"/>
100 <module name="ParameterName"/>
101 <module name="StaticVariableName"/>
102 <module name="TypeName"/>
104 <!-- Checks for imports -->
105 <!-- See http://checkstyle.sf.net/config_import.html -->
106 <module name="AvoidStarImport"/>
107 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
108 <module name="RedundantImport"/>
109 <module name="UnusedImports">
110 <property name="processJavadoc" value="false"/>
113 <!-- Checks for Size Violations. -->
114 <!-- See http://checkstyle.sf.net/config_sizes.html -->
115 <module name="LineLength">
116 <property name="max" value="100"/>
119 <module name="MethodLength"/>
120 <module name="ParameterNumber"/>
122 <!-- Checks for whitespace -->
123 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
124 <module name="EmptyForIteratorPad"/>
125 <module name="GenericWhitespace"/>
126 <module name="MethodParamPad"/>
127 <module name="NoWhitespaceAfter"/>
128 <module name="NoWhitespaceBefore"/>
129 <module name="OperatorWrap"/>
130 <module name="ParenPad"/>
131 <module name="TypecastParenPad"/>
132 <module name="WhitespaceAfter"/>
133 <module name="WhitespaceAround"/>
135 <!-- Modifier Checks -->
136 <!-- See http://checkstyle.sf.net/config_modifiers.html -->
137 <module name="ModifierOrder"/>
138 <module name="RedundantModifier"/>
140 <!-- Checks for blocks. You know, those {}'s -->
141 <!-- See http://checkstyle.sf.net/config_blocks.html -->
142 <module name="AvoidNestedBlocks"/>
143 <module name="EmptyBlock"/>
144 <module name="LeftCurly"/>
145 <module name="NeedBraces"/>
146 <module name="RightCurly"/>
148 <!-- Checks for common coding problems -->
149 <!-- See http://checkstyle.sf.net/config_coding.html -->
150 <module name="AvoidInlineConditionals"/>
151 <module name="EmptyStatement"/>
152 <module name="EqualsHashCode"/>
153 <module name="HiddenField"/>
154 <module name="IllegalInstantiation"/>
155 <module name="InnerAssignment"/>
156 <!-- <module name="MagicNumber"/> -->
157 <module name="MissingSwitchDefault"/>
158 <module name="SimplifyBooleanExpression"/>
159 <module name="SimplifyBooleanReturn"/>
161 <!-- Checks for class design -->
162 <!-- See http://checkstyle.sf.net/config_design.html -->
164 <module name="DesignForExtension"/>
166 <module name="FinalClass"/>
167 <module name="HideUtilityClassConstructor"/>
168 <module name="InterfaceIsType"/>
169 <module name="VisibilityModifier"/>
171 <!-- Miscellaneous other checks. -->
172 <!-- See http://checkstyle.sf.net/config_misc.html -->
173 <module name="ArrayTypeStyle"/>
174 <module name="FinalParameters"/>
175 <module name="TodoComment"/>
176 <module name="UpperEll"/>