|
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 | | - 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 |
38 | | -
|
39 | | - <property name="basedir" value="${basedir}"/> |
40 | | - --> |
41 | | - |
42 | | - <!-- Checks that a package-info.java file exists for each package. --> |
43 | | - <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> |
44 | | - <module name="JavadocPackage"/> |
45 | | - |
46 | | - <!-- Checks whether files end with a new line. --> |
47 | | - <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> |
48 | | - <module name="NewlineAtEndOfFile"/> |
49 | | - |
50 | | - <!-- Checks that property files contain the same keys. --> |
51 | | - <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> |
52 | | - <module name="Translation"/> |
53 | | - |
54 | | - <!-- Checks for Size Violations. --> |
55 | | - <!-- See http://checkstyle.sf.net/config_sizes.html --> |
56 | | - <module name="FileLength"/> |
57 | | - |
58 | | - <!-- Checks for whitespace --> |
59 | | - <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
60 | | - <module name="FileTabCharacter"/> |
61 | | - |
62 | | - <!-- Miscellaneous other checks. --> |
63 | | - <!-- See http://checkstyle.sf.net/config_misc.html --> |
64 | | - <module name="RegexpSingleline"> |
65 | | - <property name="format" value="\s+$"/> |
66 | | - <property name="minimum" value="0"/> |
67 | | - <property name="maximum" value="0"/> |
68 | | - <property name="message" value="Line has trailing spaces."/> |
69 | | - </module> |
70 | | - |
71 | | - <module name="TreeWalker"> |
72 | | - |
73 | | - <!-- Checks for Javadoc comments. --> |
74 | | - <!-- See http://checkstyle.sf.net/config_javadoc.html --> |
75 | | - <module name="JavadocMethod"/> |
76 | | - <module name="JavadocType"/> |
77 | | - <module name="JavadocVariable"/> |
78 | | - <module name="JavadocStyle"/> |
79 | | - |
80 | | - |
81 | | - <!-- Checks for Naming Conventions. --> |
82 | | - <!-- See http://checkstyle.sf.net/config_naming.html --> |
83 | | - <module name="ConstantName"/> |
84 | | - <module name="LocalFinalVariableName"/> |
85 | | - <module name="LocalVariableName"/> |
86 | | - <module name="MemberName"/> |
87 | | - <module name="MethodName"/> |
88 | | - <module name="PackageName"/> |
89 | | - <module name="ParameterName"/> |
90 | | - <module name="StaticVariableName"/> |
91 | | - <module name="TypeName"/> |
92 | | - |
93 | | - |
94 | | - <!-- Checks for Headers --> |
95 | | - <!-- See http://checkstyle.sf.net/config_header.html --> |
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}/java.header"/> --> |
106 | | - <!-- </module> --> |
107 | | - |
108 | | - <!-- Following interprets the header file as regular expressions. --> |
109 | | - <!-- <module name="RegexpHeader"/> --> |
110 | | - |
111 | | - |
112 | | - <!-- Checks for imports --> |
113 | | - <!-- See http://checkstyle.sf.net/config_import.html --> |
114 | | - <module name="AvoidStarImport"/> |
115 | | - <module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
116 | | - <module name="RedundantImport"/> |
117 | | - <module name="UnusedImports"/> |
118 | | - |
119 | | - |
120 | | - <!-- Checks for Size Violations. --> |
121 | | - <!-- See http://checkstyle.sf.net/config_sizes.html --> |
122 | | - <module name="LineLength"/> |
123 | | - <module name="MethodLength"/> |
124 | | - <module name="ParameterNumber"/> |
125 | | - |
126 | | - |
127 | | - <!-- Checks for whitespace --> |
128 | | - <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
129 | | - <module name="EmptyForIteratorPad"/> |
130 | | - <module name="GenericWhitespace"/> |
131 | | - <module name="MethodParamPad"/> |
132 | | - <module name="NoWhitespaceAfter"/> |
133 | | - <module name="NoWhitespaceBefore"/> |
134 | | - <module name="OperatorWrap"/> |
135 | | - <module name="ParenPad"/> |
136 | | - <module name="TypecastParenPad"/> |
137 | | - <module name="WhitespaceAfter"/> |
138 | | - <module name="WhitespaceAround"/> |
139 | | - |
140 | | - |
141 | | - <!-- Modifier Checks --> |
142 | | - <!-- See http://checkstyle.sf.net/config_modifiers.html --> |
143 | | - <module name="ModifierOrder"/> |
144 | | - <module name="RedundantModifier"/> |
145 | | - |
146 | | - |
147 | | - <!-- Checks for blocks. You know, those {}'s --> |
148 | | - <!-- See http://checkstyle.sf.net/config_blocks.html --> |
149 | | - <module name="AvoidNestedBlocks"/> |
150 | | - <module name="EmptyBlock"/> |
151 | | - <module name="LeftCurly"/> |
152 | | - <module name="NeedBraces"/> |
153 | | - <module name="RightCurly"/> |
154 | | - |
155 | | - |
156 | | - <!-- Checks for common coding problems --> |
157 | | - <!-- See http://checkstyle.sf.net/config_coding.html --> |
158 | | - <module name="AvoidInlineConditionals"/> |
159 | | - <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> |
160 | | - <module name="EmptyStatement"/> |
161 | | - <module name="EqualsHashCode"/> |
162 | | - <module name="HiddenField"/> |
163 | | - <module name="IllegalInstantiation"/> |
164 | | - <module name="InnerAssignment"/> |
165 | | - <module name="MagicNumber"/> |
166 | | - <module name="MissingSwitchDefault"/> |
167 | | - <module name="RedundantThrows"/> |
168 | | - <module name="SimplifyBooleanExpression"/> |
169 | | - <module name="SimplifyBooleanReturn"/> |
170 | | - |
171 | | - <!-- Checks for class design --> |
172 | | - <!-- See http://checkstyle.sf.net/config_design.html --> |
173 | | - <module name="DesignForExtension"/> |
174 | | - <module name="FinalClass"/> |
175 | | - <module name="HideUtilityClassConstructor"/> |
176 | | - <module name="InterfaceIsType"/> |
177 | | - <module name="VisibilityModifier"/> |
178 | | - |
179 | | - |
180 | | - <!-- Miscellaneous other checks. --> |
181 | | - <!-- See http://checkstyle.sf.net/config_misc.html --> |
182 | | - <module name="ArrayTypeStyle"/> |
183 | | - <module name="FinalParameters"/> |
184 | | - <module name="TodoComment"/> |
185 | | - <module name="UpperEll"/> |
186 | | - |
187 | | - </module> |
188 | | - |
189 | | -</module> |
| 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 | + 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 |
| 38 | +
|
| 39 | + <property name="basedir" value="${basedir}"/> |
| 40 | + --> |
| 41 | + |
| 42 | + <!-- Checks that a package-info.java file exists for each package. --> |
| 43 | + <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> |
| 44 | + <module name="JavadocPackage"/> |
| 45 | + |
| 46 | + <!-- Checks whether files end with a new line. --> |
| 47 | + <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> |
| 48 | + <module name="NewlineAtEndOfFile"/> |
| 49 | + |
| 50 | + <!-- Checks that property files contain the same keys. --> |
| 51 | + <!-- See http://checkstyle.sf.net/config_misc.html#Translation --> |
| 52 | + <module name="Translation"/> |
| 53 | + |
| 54 | + <!-- Checks for Size Violations. --> |
| 55 | + <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 56 | + <module name="FileLength"/> |
| 57 | + |
| 58 | + <!-- Checks for whitespace --> |
| 59 | + <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 60 | + <module name="FileTabCharacter"/> |
| 61 | + |
| 62 | + <!-- Miscellaneous other checks. --> |
| 63 | + <!-- See http://checkstyle.sf.net/config_misc.html --> |
| 64 | + <module name="RegexpSingleline"> |
| 65 | + <property name="format" value="\s+$"/> |
| 66 | + <property name="minimum" value="0"/> |
| 67 | + <property name="maximum" value="0"/> |
| 68 | + <property name="message" value="Line has trailing spaces."/> |
| 69 | + </module> |
| 70 | + |
| 71 | + <module name="TreeWalker"> |
| 72 | + |
| 73 | + <!-- Checks for Javadoc comments. --> |
| 74 | + <!-- See http://checkstyle.sf.net/config_javadoc.html --> |
| 75 | + <module name="JavadocMethod"/> |
| 76 | + <module name="JavadocType"/> |
| 77 | + <module name="JavadocVariable"/> |
| 78 | + <module name="JavadocStyle"/> |
| 79 | + |
| 80 | + |
| 81 | + <!-- Checks for Naming Conventions. --> |
| 82 | + <!-- See http://checkstyle.sf.net/config_naming.html --> |
| 83 | + <module name="ConstantName"/> |
| 84 | + <module name="LocalFinalVariableName"/> |
| 85 | + <module name="LocalVariableName"/> |
| 86 | + <module name="MemberName"/> |
| 87 | + <module name="MethodName"/> |
| 88 | + <module name="PackageName"/> |
| 89 | + <module name="ParameterName"/> |
| 90 | + <module name="StaticVariableName"/> |
| 91 | + <module name="TypeName"/> |
| 92 | + |
| 93 | + |
| 94 | + <!-- Checks for Headers --> |
| 95 | + <!-- See http://checkstyle.sf.net/config_header.html --> |
| 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}/java.header"/> --> |
| 106 | + <!-- </module> --> |
| 107 | + |
| 108 | + <!-- Following interprets the header file as regular expressions. --> |
| 109 | + <!-- <module name="RegexpHeader"/> --> |
| 110 | + |
| 111 | + |
| 112 | + <!-- Checks for imports --> |
| 113 | + <!-- See http://checkstyle.sf.net/config_import.html --> |
| 114 | + <module name="AvoidStarImport"/> |
| 115 | + <module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
| 116 | + <module name="RedundantImport"/> |
| 117 | + <module name="UnusedImports"/> |
| 118 | + |
| 119 | + |
| 120 | + <!-- Checks for Size Violations. --> |
| 121 | + <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 122 | + <module name="LineLength"/> |
| 123 | + <module name="MethodLength"/> |
| 124 | + <module name="ParameterNumber"/> |
| 125 | + |
| 126 | + |
| 127 | + <!-- Checks for whitespace --> |
| 128 | + <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 129 | + <module name="EmptyForIteratorPad"/> |
| 130 | + <module name="GenericWhitespace"/> |
| 131 | + <module name="MethodParamPad"/> |
| 132 | + <module name="NoWhitespaceAfter"/> |
| 133 | + <module name="NoWhitespaceBefore"/> |
| 134 | + <module name="OperatorWrap"/> |
| 135 | + <module name="ParenPad"/> |
| 136 | + <module name="TypecastParenPad"/> |
| 137 | + <module name="WhitespaceAfter"/> |
| 138 | + <module name="WhitespaceAround"/> |
| 139 | + |
| 140 | + |
| 141 | + <!-- Modifier Checks --> |
| 142 | + <!-- See http://checkstyle.sf.net/config_modifiers.html --> |
| 143 | + <module name="ModifierOrder"/> |
| 144 | + <module name="RedundantModifier"/> |
| 145 | + |
| 146 | + |
| 147 | + <!-- Checks for blocks. You know, those {}'s --> |
| 148 | + <!-- See http://checkstyle.sf.net/config_blocks.html --> |
| 149 | + <module name="AvoidNestedBlocks"/> |
| 150 | + <module name="EmptyBlock"/> |
| 151 | + <module name="LeftCurly"/> |
| 152 | + <module name="NeedBraces"/> |
| 153 | + <module name="RightCurly"/> |
| 154 | + |
| 155 | + |
| 156 | + <!-- Checks for common coding problems --> |
| 157 | + <!-- See http://checkstyle.sf.net/config_coding.html --> |
| 158 | + <module name="AvoidInlineConditionals"/> |
| 159 | + <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> |
| 160 | + <module name="EmptyStatement"/> |
| 161 | + <module name="EqualsHashCode"/> |
| 162 | + <module name="HiddenField"/> |
| 163 | + <module name="IllegalInstantiation"/> |
| 164 | + <module name="InnerAssignment"/> |
| 165 | + <module name="MagicNumber"/> |
| 166 | + <module name="MissingSwitchDefault"/> |
| 167 | + <module name="RedundantThrows"/> |
| 168 | + <module name="SimplifyBooleanExpression"/> |
| 169 | + <module name="SimplifyBooleanReturn"/> |
| 170 | + |
| 171 | + <!-- Checks for class design --> |
| 172 | + <!-- See http://checkstyle.sf.net/config_design.html --> |
| 173 | + <module name="DesignForExtension"/> |
| 174 | + <module name="FinalClass"/> |
| 175 | + <module name="HideUtilityClassConstructor"/> |
| 176 | + <module name="InterfaceIsType"/> |
| 177 | + <module name="VisibilityModifier"/> |
| 178 | + |
| 179 | + |
| 180 | + <!-- Miscellaneous other checks. --> |
| 181 | + <!-- See http://checkstyle.sf.net/config_misc.html --> |
| 182 | + <module name="ArrayTypeStyle"/> |
| 183 | + <module name="FinalParameters"/> |
| 184 | + <module name="TodoComment"/> |
| 185 | + <module name="UpperEll"/> |
| 186 | + |
| 187 | + </module> |
| 188 | + |
| 189 | +</module> |
0 commit comments