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