root / branches / Mobile1.0 / build / build-tools / src / main / resources / gvsig / checkstyle_gvsig.xml @ 79
History | View | Annotate | Download (8.37 KB)
1 |
<?xml version="1.0"?>
|
---|---|
2 |
<!DOCTYPE module PUBLIC
|
3 |
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
|
4 |
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
|
5 |
|
6 |
<!--
|
7 |
|
8 |
Checkstyle configuration that checks the sun coding conventions from:
|
9 |
|
10 |
- the Java Language Specification at
|
11 |
http://java.sun.com/docs/books/jls/second_edition/html/index.html
|
12 |
|
13 |
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
|
14 |
|
15 |
- the Javadoc guidelines at
|
16 |
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
|
17 |
|
18 |
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
|
19 |
|
20 |
- some best practices
|
21 |
|
22 |
Checkstyle is very configurable. Be sure to read the documentation at
|
23 |
http://checkstyle.sf.net (or in your downloaded distribution).
|
24 |
|
25 |
Most Checks are configurable, be sure to consult the documentation.
|
26 |
|
27 |
To completely disable a check, just comment it out or delete it from the file.
|
28 |
|
29 |
Finally, it is worth reading the documentation.
|
30 |
|
31 |
-->
|
32 |
|
33 |
<module name="Checker"> |
34 |
|
35 |
<!-- Checks that a package.html file exists for each package. -->
|
36 |
<!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
|
37 |
<module name="PackageHtml"/> |
38 |
|
39 |
<!-- Checks whether files end with a new line. -->
|
40 |
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
|
41 |
<!--module name="NewlineAtEndOfFile"/-->
|
42 |
|
43 |
<!-- Checks that property files contain the same keys. -->
|
44 |
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
|
45 |
<!--module name="Translation"/-->
|
46 |
|
47 |
<module name="TreeWalker"> |
48 |
|
49 |
<property name="charset" value="UTF-8"/> |
50 |
|
51 |
<!-- Checks for Javadoc comments. -->
|
52 |
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
53 |
<!-- gvSIG: All protected or public classes must have a Javadoc
|
54 |
comment with the @author tag included -->
|
55 |
<module name="JavadocType"> |
56 |
<property name="scope" value="protected"/> |
57 |
<property name="authorFormat" value="\S"/> |
58 |
</module>
|
59 |
<!-- gvSIG: All protected or public classes must have a Javadoc
|
60 |
comments, except getters and setters -->
|
61 |
<module name="JavadocMethod"> |
62 |
<property name="scope" value="protected"/> |
63 |
<property name="allowMissingPropertyJavadoc" value="true"/> |
64 |
</module>
|
65 |
<!-- gvSIG: Check correctly formatted Javadoc -->
|
66 |
<module name="JavadocStyle"> |
67 |
<property name="scope" value="protected"/> |
68 |
</module>
|
69 |
<!--
|
70 |
<module name="JavadocVariable"/>
|
71 |
-->
|
72 |
|
73 |
<!-- Checks for Naming Conventions. -->
|
74 |
<!-- See http://checkstyle.sf.net/config_naming.html -->
|
75 |
<!-- gvSIG: All packages must begin with org.gvsig. -->
|
76 |
<module name="PackageName"> |
77 |
<property name="format" |
78 |
value="^org\.gvsig(\.[a-z][a-z0-9]*)+$"/> |
79 |
</module>
|
80 |
<!-- gvSIG: Abstract class names must begin with Abstract. -->
|
81 |
<module name="AbstractClassName"/> |
82 |
<!--
|
83 |
<module name="ConstantName"/>
|
84 |
<module name="LocalFinalVariableName"/>
|
85 |
<module name="LocalVariableName"/>
|
86 |
<module name="MemberName"/>
|
87 |
<module name="MethodName"/>
|
88 |
<module name="ParameterName"/>
|
89 |
<module name="StaticVariableName"/>
|
90 |
<module name="TypeName"/>
|
91 |
-->
|
92 |
|
93 |
<!-- Checks for Headers -->
|
94 |
<!-- See http://checkstyle.sf.net/config_header.html -->
|
95 |
<!-- gvSIG: Files must have the gvSIG header. -->
|
96 |
<module name="Header"> |
97 |
<!-- The follow property value demonstrates the ability -->
|
98 |
<!-- to have access to ANT properties. In this case it uses -->
|
99 |
<!-- the ${basedir} property to allow Checkstyle to be run -->
|
100 |
<!-- from any directory within a project. See property -->
|
101 |
<!-- expansion, -->
|
102 |
<!-- http://checkstyle.sf.net/config.html#properties -->
|
103 |
<!-- <property -->
|
104 |
<!-- name="headerFile" -->
|
105 |
<!-- value="${basedir}/build/java.header"/> -->
|
106 |
<property name="headerFile" value="${checkstyle.header.file}"/> |
107 |
<property name="ignoreLines" value="2"/> |
108 |
</module>
|
109 |
|
110 |
<!-- Following interprets the header file as regular expressions. -->
|
111 |
<!-- <module name="RegexpHeader"/> -->
|
112 |
|
113 |
|
114 |
<!-- Checks for imports -->
|
115 |
<!-- See http://checkstyle.sf.net/config_import.html -->
|
116 |
<!-- gvSIG: Add warnings for redundant and unused imports -->
|
117 |
<module name="RedundantImport"> |
118 |
<property name="severity" value="warning"/> |
119 |
</module>
|
120 |
<module name="UnusedImports"> |
121 |
<property name="severity" value="warning"/> |
122 |
</module>
|
123 |
<!--
|
124 |
<module name="AvoidStarImport"/>
|
125 |
<module name="IllegalImport"/> <!-#- defaults to sun.* packages -#->
|
126 |
-->
|
127 |
|
128 |
<!-- Checks for Size Violations. -->
|
129 |
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
130 |
<!--
|
131 |
<module name="FileLength"/>
|
132 |
<module name="LineLength"/>
|
133 |
<module name="MethodLength"/>
|
134 |
<module name="ParameterNumber"/>
|
135 |
-->
|
136 |
|
137 |
<!-- Checks for whitespace -->
|
138 |
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
139 |
<!--
|
140 |
<module name="EmptyForIteratorPad"/>
|
141 |
<module name="MethodParamPad"/>
|
142 |
<module name="NoWhitespaceAfter"/>
|
143 |
<module name="NoWhitespaceBefore"/>
|
144 |
<module name="OperatorWrap"/>
|
145 |
<module name="ParenPad"/>
|
146 |
<module name="TypecastParenPad"/>
|
147 |
<module name="TabCharacter"/>
|
148 |
<module name="WhitespaceAfter"/>
|
149 |
<module name="WhitespaceAround"/>
|
150 |
-->
|
151 |
|
152 |
<!-- Modifier Checks -->
|
153 |
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
154 |
<!--
|
155 |
<module name="ModifierOrder"/>
|
156 |
<module name="RedundantModifier"/>
|
157 |
-->
|
158 |
|
159 |
<!-- Checks for blocks. You know, those {}'s -->
|
160 |
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
161 |
<!--
|
162 |
<module name="AvoidNestedBlocks"/>
|
163 |
<module name="EmptyBlock"/>
|
164 |
<module name="LeftCurly"/>
|
165 |
<module name="NeedBraces"/>
|
166 |
<module name="RightCurly"/>
|
167 |
-->
|
168 |
|
169 |
<!-- Checks for common coding problems -->
|
170 |
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
171 |
<!-- gvSIG: Check for some common programming errors -->
|
172 |
<module name="DoubleCheckedLocking"/> |
173 |
<module name="CovariantEquals"/> |
174 |
<module name="EqualsHashCode"/> |
175 |
<module name="IllegalInstantiation"> |
176 |
<property name="classes" value="java.lang.Boolean"/> |
177 |
</module>
|
178 |
<module name="StringLiteralEquality"/> |
179 |
<!--
|
180 |
<module name="AvoidInlineConditionals"/>
|
181 |
<module name="EmptyStatement"/>
|
182 |
<module name="HiddenField"/>
|
183 |
<module name="InnerAssignment"/>
|
184 |
<module name="MagicNumber"/>
|
185 |
<module name="MissingSwitchDefault"/>
|
186 |
<module name="RedundantThrows"/>
|
187 |
<module name="SimplifyBooleanExpression"/>
|
188 |
<module name="SimplifyBooleanReturn"/>
|
189 |
-->
|
190 |
|
191 |
<!-- Checks for class design -->
|
192 |
<!-- See http://checkstyle.sf.net/config_design.html -->
|
193 |
<!--
|
194 |
<module name="DesignForExtension"/>
|
195 |
<module name="FinalClass"/>
|
196 |
<module name="HideUtilityClassConstructor"/>
|
197 |
<module name="InterfaceIsType"/>
|
198 |
<module name="VisibilityModifier"/>
|
199 |
-->
|
200 |
|
201 |
<!-- Miscellaneous other checks. -->
|
202 |
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
203 |
<!-- gvSIG: Get the author from the Javadoc -->
|
204 |
<!--
|
205 |
<module name="WriteTag">
|
206 |
<property name="tag" value="@author"/>
|
207 |
<property name="tagFormat" value="\S"/>
|
208 |
</module>
|
209 |
<module name="ArrayTypeStyle"/>
|
210 |
<module name="FinalParameters"/>
|
211 |
<module name="GenericIllegalRegexp">
|
212 |
<property name="format" value="\s+$"/>
|
213 |
<property name="message" value="Line has trailing spaces."/>
|
214 |
</module>
|
215 |
<module name="TodoComment"/>
|
216 |
<module name="UpperEll"/>
|
217 |
-->
|
218 |
|
219 |
</module>
|
220 |
|
221 |
</module>
|