24558dd678e8fb4b817a1c2d0aa4a83e1e30f7bc
[utils] / build / style.xml
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
5 \r
6 <!--\r
7 \r
8   Checkstyle configuration that checks the sun coding conventions from:\r
9 \r
10     - the Java Language Specification at\r
11       http://java.sun.com/docs/books/jls/second_edition/html/index.html\r
12 \r
13     - the Sun Code Conventions at http://java.sun.com/docs/codeconv/\r
14 \r
15     - the Javadoc guidelines at\r
16       http://java.sun.com/j2se/javadoc/writingdoccomments/index.html\r
17 \r
18     - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html\r
19 \r
20     - some best practices\r
21 \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
24 \r
25   Most Checks are configurable, be sure to consult the documentation.\r
26 \r
27   To completely disable a check, just comment it out or delete it from the file.\r
28 \r
29   Finally, it is worth reading the documentation.\r
30 \r
31 -->\r
32 \r
33 <module name="Checker">\r
34 \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
38 \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
42 \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
46 \r
47 \r
48     <module name="TreeWalker">\r
49 \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
56          \r
57         <!-- Checks for Naming Conventions.                  -->\r
58         <!-- See http://checkstyle.sf.net/config_naming.html -->\r
59         <module name="ConstantName"/>\r
60         <module name="LocalFinalVariableName"/>\r
61         <module name="LocalVariableName"/>\r
62         <module name="MemberName"/>\r
63         <module name="MethodName"/>\r
64         <module name="PackageName"/>\r
65         <module name="ParameterName"/>\r
66         <module name="StaticVariableName"/>\r
67         <module name="TypeName"/>\r
68 \r
69 \r
70         <!-- Checks for Headers                                -->\r
71         <!-- See http://checkstyle.sf.net/config_header.html   -->\r
72         <!-- <module name="Header">                            -->\r
73             <!-- The follow property value demonstrates the ability     -->\r
74             <!-- to have access to ANT properties. In this case it uses -->\r
75             <!-- the ${basedir} property to allow Checkstyle to be run  -->\r
76             <!-- from any directory within a project. See property      -->\r
77             <!-- expansion,                                             -->\r
78             <!-- http://checkstyle.sf.net/config.html#properties        -->\r
79             <!-- <property                                              -->\r
80             <!--     name="headerFile"                                  -->\r
81             <!--     value="${basedir}/java.header"/>                   -->\r
82         <!-- </module> -->\r
83 \r
84         <!-- Following interprets the header file as regular expressions. -->\r
85         <!-- <module name="RegexpHeader"/>                                -->\r
86 \r
87 \r
88         <!-- Checks for imports                              -->\r
89         <!-- See http://checkstyle.sf.net/config_import.html -->\r
90         <module name="AvoidStarImport"/>\r
91         <module name="IllegalImport"/> <!-- defaults to sun.* packages -->\r
92         <module name="RedundantImport"/>\r
93         <module name="UnusedImports"/>\r
94 \r
95 \r
96         <!-- Checks for Size Violations.                    -->\r
97         <!-- See http://checkstyle.sf.net/config_sizes.html -->\r
98         <module name="FileLength"/>\r
99         <module name="LineLength"/>\r
100         <module name="MethodLength"/>\r
101         <module name="ParameterNumber"/>\r
102 \r
103 \r
104         <!-- Checks for whitespace                               -->\r
105         <!-- See http://checkstyle.sf.net/config_whitespace.html -->\r
106         <module name="EmptyForIteratorPad"/>\r
107         <!-- module name="MethodParamPad"/ -->\r
108         <module name="NoWhitespaceAfter"/>\r
109         <module name="NoWhitespaceBefore"/>\r
110         <module name="OperatorWrap"/>\r
111         <module name="ParenPad"/>\r
112         <!-- module name="TypecastParenPad"/ -->\r
113         <module name="TabCharacter"/>\r
114         <module name="WhitespaceAfter"/>\r
115         <module name="WhitespaceAround"/>\r
116 \r
117 \r
118         <!-- Modifier Checks                                    -->\r
119         <!-- See http://checkstyle.sf.net/config_modifiers.html -->\r
120         <module name="ModifierOrder"/>\r
121         <module name="RedundantModifier"/>\r
122 \r
123 \r
124         <!-- Checks for blocks. You know, those {}'s         -->\r
125         <!-- See http://checkstyle.sf.net/config_blocks.html -->\r
126         <module name="AvoidNestedBlocks"/>\r
127         <module name="EmptyBlock"/>\r
128         <module name="LeftCurly"/>\r
129         <module name="NeedBraces"/>\r
130         <module name="RightCurly"/>\r
131 \r
132 \r
133         <!-- Checks for common coding problems               -->\r
134         <!-- See http://checkstyle.sf.net/config_coding.html -->\r
135         <module name="AvoidInlineConditionals"/>\r
136         <module name="DoubleCheckedLocking"/>    <!-- MY FAVOURITE -->\r
137         <module name="EmptyStatement"/>\r
138         <module name="EqualsHashCode"/>\r
139         <module name="HiddenField"/>\r
140         <module name="IllegalInstantiation"/>\r
141         <module name="InnerAssignment"/>\r
142         <module name="MagicNumber"/>\r
143         <module name="MissingSwitchDefault"/>\r
144         <module name="RedundantThrows"/>\r
145         <module name="SimplifyBooleanExpression"/>\r
146         <module name="SimplifyBooleanReturn"/>\r
147 \r
148         <!-- Checks for class design                         -->\r
149         <!-- See http://checkstyle.sf.net/config_design.html -->\r
150         <module name="DesignForExtension"/>\r
151         <module name="FinalClass"/>\r
152         <module name="HideUtilityClassConstructor"/>\r
153         <module name="InterfaceIsType"/>\r
154         <module name="VisibilityModifier"/>\r
155 \r
156 \r
157         <!-- Miscellaneous other checks.                   -->\r
158         <!-- See http://checkstyle.sf.net/config_misc.html -->\r
159         <module name="ArrayTypeStyle"/>\r
160         <module name="FinalParameters"/>\r
161         <module name="GenericIllegalRegexp">\r
162             <property name="format" value="\s+$"/>\r
163             <property name="message" value="Line has trailing spaces."/>\r
164         </module>\r
165         <module name="TodoComment"/>\r
166         <module name="UpperEll"/>\r
167 \r
168     </module>\r
169 \r
170 </module>\r