blob: f39f33561e1e666dd5caac4178b385225fbd2a50 [file] [log] [blame]
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -08001<?xml version="1.0"?>
2<!DOCTYPE module PUBLIC
Davide Pesaventob6df5132019-09-24 14:05:00 -04003 "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4 "https://checkstyle.org/dtds/configuration_1_3.dtd">
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -08005
6<!--
7
8 Checkstyle configuration that checks the sun coding conventions from:
9
10 - the Java Language Specification at
Davide Pesaventob6df5132019-09-24 14:05:00 -040011 https://docs.oracle.com/javase/specs/jls/se11/html/index.html
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080012
Davide Pesaventob6df5132019-09-24 14:05:00 -040013 - the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080014
15 - the Javadoc guidelines at
Davide Pesaventob6df5132019-09-24 14:05:00 -040016 https://www.oracle.com/technetwork/java/javase/documentation/index-137868.html
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080017
Davide Pesaventob6df5132019-09-24 14:05:00 -040018 - the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080019
20 - some best practices
21
22 Checkstyle is very configurable. Be sure to read the documentation at
Davide Pesaventob6df5132019-09-24 14:05:00 -040023 https://checkstyle.org (or in your downloaded distribution).
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -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.
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
Davide Pesaventob6df5132019-09-24 14:05:00 -040037 https://checkstyle.org/5.x/config.html#Checker
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080038
39 <property name="basedir" value="${basedir}"/>
40 -->
41
42 <property name="fileExtensions" value="java, properties, xml"/>
43
Davide Pesaventob6df5132019-09-24 14:05:00 -040044 <!-- Excludes all 'module-info.java' files -->
45 <!-- See https://checkstyle.org/config_filefilters.html -->
46 <module name="BeforeExecutionExclusionFileFilter">
47 <property name="fileNamePattern" value="module\-info\.java$"/>
48 </module>
49
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080050 <!-- Checks that a package-info.java file exists for each package. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040051 <!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
52 <!-- <module name="JavadocPackage"/> -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080053
54 <!-- Checks whether files end with a new line. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040055 <!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080056 <module name="NewlineAtEndOfFile"/>
57
58 <!-- Checks that property files contain the same keys. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040059 <!-- See https://checkstyle.org/config_misc.html#Translation -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080060 <module name="Translation"/>
61
62 <!-- Checks for Size Violations. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040063 <!-- See https://checkstyle.org/config_sizes.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080064 <module name="FileLength"/>
65
66 <!-- Checks for whitespace -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040067 <!-- See https://checkstyle.org/config_whitespace.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080068 <module name="FileTabCharacter"/>
69
70 <!-- Miscellaneous other checks. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040071 <!-- See https://checkstyle.org/config_misc.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080072 <module name="RegexpSingleline">
73 <property name="format" value="\s+$"/>
74 <property name="minimum" value="0"/>
75 <property name="maximum" value="0"/>
76 <property name="message" value="Line has trailing spaces."/>
77 </module>
78
79 <!-- Checks for Headers -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040080 <!-- See https://checkstyle.org/config_header.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080081 <!-- <module name="Header"> -->
82 <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
83 <!-- <property name="fileExtensions" value="java"/> -->
84 <!-- </module> -->
85
86 <module name="TreeWalker">
87
88 <!-- Checks for Javadoc comments. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -040089 <!-- See https://checkstyle.org/config_javadoc.html -->
90 <module name="InvalidJavadocPosition"/>
91 <module name="JavadocMethod"/>
92 <module name="JavadocType"/>
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080093 <module name="JavadocVariable">
94 <property name="excludeScope" value="private"/>
95 </module>
96 <module name="JavadocStyle"/>
Davide Pesaventob6df5132019-09-24 14:05:00 -040097 <!-- <module name="MissingJavadocMethod"/> -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -080098
99 <!-- Checks for Naming Conventions. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400100 <!-- See https://checkstyle.org/config_naming.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800101 <module name="ConstantName"/>
102 <module name="LocalFinalVariableName"/>
103 <module name="LocalVariableName"/>
104 <module name="MemberName"/>
105 <module name="MethodName"/>
106 <module name="PackageName"/>
107 <module name="ParameterName"/>
108 <module name="StaticVariableName"/>
109 <module name="TypeName"/>
110
111 <!-- Checks for imports -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400112 <!-- See https://checkstyle.org/config_import.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800113 <module name="AvoidStarImport"/>
114 <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
115 <module name="RedundantImport"/>
116 <module name="UnusedImports">
117 <property name="processJavadoc" value="false"/>
118 </module>
119
120 <!-- Checks for Size Violations. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400121 <!-- See https://checkstyle.org/config_sizes.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800122 <module name="LineLength">
123 <property name="max" value="120"/>
124 </module>
125 <module name="MethodLength"/>
126 <module name="ParameterNumber"/>
127
128 <!-- Checks for whitespace -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400129 <!-- See https://checkstyle.org/config_whitespace.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800130 <module name="EmptyForIteratorPad"/>
131 <module name="GenericWhitespace"/>
132 <module name="MethodParamPad"/>
133 <module name="NoWhitespaceAfter"/>
134 <module name="NoWhitespaceBefore"/>
135 <module name="OperatorWrap">
136 <property name="option" value="eol"/>
137 </module>
138 <module name="ParenPad"/>
139 <module name="TypecastParenPad"/>
140 <module name="WhitespaceAfter"/>
141 <module name="WhitespaceAround"/>
142
143 <!-- Modifier Checks -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400144 <!-- See https://checkstyle.org/config_modifiers.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800145 <module name="ModifierOrder"/>
146 <module name="RedundantModifier"/>
147
148 <!-- Checks for blocks. You know, those {}'s -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400149 <!-- See https://checkstyle.org/config_blocks.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800150 <module name="AvoidNestedBlocks"/>
151 <module name="EmptyBlock"/>
152 <module name="LeftCurly"/>
153 <module name="NeedBraces"/>
154 <module name="RightCurly"/>
155
156 <!-- Checks for common coding problems -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400157 <!-- See https://checkstyle.org/config_coding.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800158 <module name="EmptyStatement"/>
159 <module name="EqualsHashCode"/>
160 <!-- <module name="HiddenField"/> -->
161 <module name="IllegalInstantiation"/>
162 <module name="InnerAssignment"/>
Davide Pesaventob6df5132019-09-24 14:05:00 -0400163 <!-- <module name="MagicNumber"/> -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800164 <module name="MissingSwitchDefault"/>
Davide Pesaventob6df5132019-09-24 14:05:00 -0400165 <module name="MultipleVariableDeclarations"/>
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800166 <module name="SimplifyBooleanExpression"/>
167 <module name="SimplifyBooleanReturn"/>
168
169 <!-- Checks for class design -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400170 <!-- See https://checkstyle.org/config_design.html -->
171 <!-- <module name="DesignForExtension"/> -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800172 <module name="FinalClass"/>
173 <module name="HideUtilityClassConstructor"/>
174 <module name="InterfaceIsType"/>
175 <module name="VisibilityModifier"/>
176
177 <!-- Miscellaneous other checks. -->
Davide Pesaventob6df5132019-09-24 14:05:00 -0400178 <!-- See https://checkstyle.org/config_misc.html -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800179 <module name="ArrayTypeStyle"/>
180 <module name="FinalParameters"/>
Davide Pesaventob6df5132019-09-24 14:05:00 -0400181 <!-- <module name="TodoComment"/> -->
Alexander Afanasyeve36e1af2016-02-19 18:06:05 -0800182 <module name="UpperEll"/>
183
184 </module>
185
186</module>