blob: 65c2586c313234346dc0aeb1dc011460e2fdb61a [file] [log] [blame]
Alexander Afanasyevcbc41012016-02-19 20:10:57 -08001<?xml version="1.0"?>
Alexander Afanasyevcbc41012016-02-19 20:10:57 -08002<!DOCTYPE module PUBLIC
Davide Pesavento8cda2f92020-11-01 23:08:09 -05003 "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4 "https://checkstyle.org/dtds/configuration_1_3.dtd">
Alexander Afanasyevcbc41012016-02-19 20:10:57 -08005
6<!--
7
Alexander Afanasyevcbc41012016-02-19 20:10:57 -08008 Checkstyle configuration that checks the sun coding conventions from:
9
10 - the Java Language Specification at
Davide Pesavento8cda2f92020-11-01 23:08:09 -050011 https://docs.oracle.com/javase/specs/jls/se11/html/index.html
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080012
Davide Pesavento8cda2f92020-11-01 23:08:09 -050013 - the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080014
15 - the Javadoc guidelines at
Davide Pesavento8cda2f92020-11-01 23:08:09 -050016 https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080017
Davide Pesavento8cda2f92020-11-01 23:08:09 -050018 - the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080019
20 - some best practices
21
22 Checkstyle is very configurable. Be sure to read the documentation at
Davide Pesavento8cda2f92020-11-01 23:08:09 -050023 https://checkstyle.org (or in your downloaded distribution).
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080024
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.
Davide Pesavento8cda2f92020-11-01 23:08:09 -050028 To suppress certain violations please review suppression filters.
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080029
30 Finally, it is worth reading the documentation.
31
32-->
33
34<module name="Checker">
Davide Pesavento8cda2f92020-11-01 23:08:09 -050035 <!--
36 If you set the basedir property below, then all reported file
37 names will be relative to the specified directory. See
38 https://checkstyle.org/config.html#Checker
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080039
Davide Pesavento8cda2f92020-11-01 23:08:09 -050040 <property name="basedir" value="${basedir}"/>
41 -->
42 <property name="severity" value="error"/>
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080043
Davide Pesavento8cda2f92020-11-01 23:08:09 -050044 <property name="fileExtensions" value="java, properties, xml"/>
45
46 <!-- Excludes all 'module-info.java' files -->
47 <!-- See https://checkstyle.org/config_filefilters.html -->
48 <module name="BeforeExecutionExclusionFileFilter">
49 <property name="fileNamePattern" value="module\-info\.java$"/>
50 </module>
51
52 <!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
53 <module name="SuppressionFilter">
54 <property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
55 default="checkstyle-suppressions.xml" />
56 <property name="optional" value="true"/>
57 </module>
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080058
59 <!-- Checks that a package-info.java file exists for each package. -->
60 <!-- See http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage -->
Davide Pesavento8cda2f92020-11-01 23:08:09 -050061 <!-- <module name="JavadocPackage"/> -->
Alexander Afanasyevcbc41012016-02-19 20:10:57 -080062
63 <!-- Checks whether files end with a new line. -->
64 <!-- See http://checkstyle.sourceforge.net/config_misc.html#NewlineAtEndOfFile -->
65 <module name="NewlineAtEndOfFile"/>
66
67 <!-- Checks that property files contain the same keys. -->
68 <!-- See http://checkstyle.sourceforge.net/config_misc.html#Translation -->
69 <module name="Translation"/>
70
71 <!-- Checks for Size Violations. -->
72 <!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
73 <module name="FileLength"/>
74
75 <!-- Checks for whitespace -->
76 <!-- See http://checkstyle.sourceforge.net/config_whitespace.html -->
77 <module name="FileTabCharacter"/>
78
79 <!-- Miscellaneous other checks. -->
80 <!-- See http://checkstyle.sourceforge.net/config_misc.html -->
81 <module name="RegexpSingleline">
82 <property name="format" value="\s+$"/>
83 <property name="minimum" value="0"/>
84 <property name="maximum" value="0"/>
85 <property name="message" value="Line has trailing spaces."/>
86 </module>
87
88 <!-- Checks for Headers -->
89 <!-- See http://checkstyle.sourceforge.net/config_header.html -->
90 <!-- <module name="Header"> -->
91 <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
92 <!-- <property name="fileExtensions" value="java"/> -->
93 <!-- </module> -->
94
95 <module name="TreeWalker">
96
97 <!-- Checks for Javadoc comments. -->
98 <!-- See http://checkstyle.sourceforge.net/config_javadoc.html -->
Davide Pesavento8cda2f92020-11-01 23:08:09 -050099 <module name="InvalidJavadocPosition"/>
100 <!-- <module name="JavadocMethod"/> -->
101 <module name="JavadocType"/>
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800102 <module name="JavadocVariable">
103 <property name="excludeScope" value="private"/>
104 </module>
105 <module name="JavadocStyle"/>
Davide Pesavento8cda2f92020-11-01 23:08:09 -0500106 <!-- <module name="MissingJavadocMethod"/> -->
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800107
108 <!-- Checks for Naming Conventions. -->
109 <!-- See http://checkstyle.sourceforge.net/config_naming.html -->
110 <module name="ConstantName"/>
111 <module name="LocalFinalVariableName"/>
112 <module name="LocalVariableName"/>
113 <module name="MemberName"/>
114 <module name="MethodName"/>
115 <module name="PackageName"/>
116 <module name="ParameterName"/>
117 <module name="StaticVariableName"/>
118 <module name="TypeName"/>
119
120 <!-- Checks for imports -->
121 <!-- See http://checkstyle.sourceforge.net/config_import.html -->
122 <module name="AvoidStarImport"/>
123 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
124 <module name="RedundantImport"/>
125 <module name="UnusedImports">
126 <property name="processJavadoc" value="false"/>
127 </module>
128
129 <!-- Checks for Size Violations. -->
130 <!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
131 <module name="LineLength">
132 <property name="max" value="120"/>
133 </module>
134 <module name="MethodLength"/>
135 <module name="ParameterNumber"/>
136
137 <!-- Checks for whitespace -->
138 <!-- See http://checkstyle.sourceforge.net/config_whitespace.html -->
139 <module name="EmptyForIteratorPad"/>
140 <module name="GenericWhitespace"/>
141 <module name="MethodParamPad"/>
142 <module name="NoWhitespaceAfter"/>
143 <module name="NoWhitespaceBefore"/>
144 <module name="OperatorWrap">
145 <property name="option" value="eol"/>
146 </module>
147 <module name="ParenPad"/>
148 <module name="TypecastParenPad"/>
149 <module name="WhitespaceAfter"/>
150 <module name="WhitespaceAround"/>
151
152 <!-- Modifier Checks -->
153 <!-- See http://checkstyle.sourceforge.net/config_modifiers.html -->
154 <module name="ModifierOrder"/>
155 <module name="RedundantModifier"/>
156
157 <!-- Checks for blocks. You know, those {}'s -->
158 <!-- See http://checkstyle.sourceforge.net/config_blocks.html -->
159 <module name="AvoidNestedBlocks"/>
160 <module name="EmptyBlock"/>
161 <module name="LeftCurly"/>
162 <module name="NeedBraces"/>
163 <module name="RightCurly"/>
164
165 <!-- Checks for common coding problems -->
166 <!-- See http://checkstyle.sourceforge.net/config_coding.html -->
167 <module name="AvoidInlineConditionals"/>
168 <module name="EmptyStatement"/>
169 <module name="EqualsHashCode"/>
170 <!-- <module name="HiddenField"/> -->
171 <module name="IllegalInstantiation"/>
172 <module name="InnerAssignment"/>
Davide Pesavento8cda2f92020-11-01 23:08:09 -0500173 <!-- <module name="MagicNumber"/> -->
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800174 <module name="MissingSwitchDefault"/>
Davide Pesavento8cda2f92020-11-01 23:08:09 -0500175 <module name="MultipleVariableDeclarations"/>
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800176 <module name="SimplifyBooleanExpression"/>
177 <module name="SimplifyBooleanReturn"/>
178
179 <!-- Checks for class design -->
180 <!-- See http://checkstyle.sourceforge.net/config_design.html -->
Davide Pesavento8cda2f92020-11-01 23:08:09 -0500181 <!-- <module name="DesignForExtension"/> -->
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800182 <module name="FinalClass"/>
183 <module name="HideUtilityClassConstructor"/>
184 <module name="InterfaceIsType"/>
Davide Pesavento8cda2f92020-11-01 23:08:09 -0500185 <!-- <module name="VisibilityModifier"/> -->
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800186
187 <!-- Miscellaneous other checks. -->
188 <!-- See http://checkstyle.sourceforge.net/config_misc.html -->
189 <module name="ArrayTypeStyle"/>
Davide Pesavento8cda2f92020-11-01 23:08:09 -0500190 <!-- <module name="FinalParameters"/> -->
191 <!-- <module name="TodoComment"/> -->
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800192 <module name="UpperEll"/>
193
Davide Pesavento8cda2f92020-11-01 23:08:09 -0500194 <!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
195 <module name="SuppressionXpathFilter">
196 <property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
197 default="checkstyle-xpath-suppressions.xml" />
198 <property name="optional" value="true"/>
199 </module>
200
Alexander Afanasyevcbc41012016-02-19 20:10:57 -0800201 </module>
202
203</module>