checkstyle.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?xml version="1.0"?>
  2. <!DOCTYPE module PUBLIC
  3. "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
  4. "https://checkstyle.org/dtds/configuration_1_3.dtd">
  5. <module name="Checker">
  6. <!--
  7. If you set the basedir property below, then all reported file
  8. names will be relative to the specified directory. See
  9. https://checkstyle.org/5.x/config.html#Checker
  10. <property name="basedir" value="${basedir}"/>
  11. -->
  12. <property name="severity" value="error"/>
  13. <property name="fileExtensions" value="java, properties, xml"/>
  14. <!-- Excludes all 'module-info.java' files -->
  15. <!-- See https://checkstyle.org/config_filefilters.html -->
  16. <module name="BeforeExecutionExclusionFileFilter">
  17. <property name="fileNamePattern" value="module\-info\.java$"/>
  18. </module>
  19. <!-- Checks that a package-info.java file exists for each package. -->
  20. <!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
  21. <!--<module name="JavadocPackage"/>-->
  22. <!-- Checks whether files end with a new line. -->
  23. <!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
  24. <module name="NewlineAtEndOfFile"/>
  25. <!-- Checks that property files contain the same keys. -->
  26. <!-- See https://checkstyle.org/config_misc.html#Translation -->
  27. <module name="Translation"/>
  28. <!-- Checks for Size Violations. -->
  29. <!-- See https://checkstyle.org/config_sizes.html -->
  30. <module name="FileLength"/>
  31. <module name="LineLength">
  32. <property name="max" value="100"/>
  33. <property name="fileExtensions" value="java"/>
  34. </module>
  35. <!-- Checks for whitespace -->
  36. <!-- See https://checkstyle.org/config_whitespace.html -->
  37. <module name="FileTabCharacter"/>
  38. <!-- Miscellaneous other checks. -->
  39. <!-- See https://checkstyle.org/config_misc.html -->
  40. <module name="RegexpSingleline">
  41. <property name="format" value="\s+$"/>
  42. <property name="minimum" value="0"/>
  43. <property name="maximum" value="0"/>
  44. <property name="message" value="Line has trailing spaces."/>
  45. </module>
  46. <!-- Checks for Headers -->
  47. <!-- See https://checkstyle.org/config_header.html -->
  48. <!-- <module name="Header"> -->
  49. <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
  50. <!-- <property name="fileExtensions" value="java"/> -->
  51. <!-- </module> -->
  52. <module name="SuppressWarningsFilter" />
  53. <module name="SuppressWithPlainTextCommentFilter"/>
  54. <module name="TreeWalker">
  55. <!-- Checks for Javadoc comments. -->
  56. <!-- See https://checkstyle.org/config_javadoc.html -->
  57. <module name="InvalidJavadocPosition"/>
  58. <module name="JavadocMethod">
  59. <property name="allowMissingParamTags" value="true"/>
  60. <property name="allowMissingReturnTag" value="true"/>
  61. </module>
  62. <module name="JavadocType"/>
  63. <!--<module name="JavadocVariable"/>-->
  64. <module name="JavadocStyle">
  65. <property name="checkFirstSentence" value="false"/>
  66. </module>
  67. <!--<module name="MissingJavadocMethod"/>-->
  68. <!-- Checks for Naming Conventions. -->
  69. <!-- See https://checkstyle.org/config_naming.html -->
  70. <module name="ConstantName"/>
  71. <module name="LocalFinalVariableName"/>
  72. <module name="LocalVariableName"/>
  73. <module name="MemberName">
  74. <property name="format" value="^(TAG|DEBUG|[a-z][a-zA-Z0-9]*)$"/>
  75. </module>
  76. <module name="MethodName"/>
  77. <module name="PackageName"/>
  78. <module name="ParameterName"/>
  79. <module name="StaticVariableName"/>
  80. <module name="TypeName"/>
  81. <!-- Checks for imports -->
  82. <!-- See https://checkstyle.org/config_import.html -->
  83. <module name="AvoidStarImport"/>
  84. <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
  85. <module name="RedundantImport"/>
  86. <module name="UnusedImports"/>
  87. <!-- Checks for Size Violations. -->
  88. <!-- See https://checkstyle.org/config_sizes.html -->
  89. <module name="MethodLength">
  90. <property name="severity" value="warning"/>
  91. </module>
  92. <module name="ParameterNumber">
  93. <property name="severity" value="warning"/>
  94. </module>
  95. <!-- Checks for whitespace -->
  96. <!-- See https://checkstyle.org/config_whitespace.html -->
  97. <module name="EmptyForIteratorPad"/>
  98. <module name="GenericWhitespace"/>
  99. <module name="MethodParamPad"/>
  100. <module name="NoWhitespaceAfter"/>
  101. <module name="NoWhitespaceBefore"/>
  102. <module name="OperatorWrap"/>
  103. <module name="ParenPad"/>
  104. <module name="TypecastParenPad"/>
  105. <module name="WhitespaceAfter"/>
  106. <module name="WhitespaceAround"/>
  107. <!-- Modifier Checks -->
  108. <!-- See https://checkstyle.org/config_modifiers.html -->
  109. <module name="ModifierOrder"/>
  110. <module name="RedundantModifier"/>
  111. <!-- Checks for blocks. You know, those {}'s -->
  112. <!-- See https://checkstyle.org/config_blocks.html -->
  113. <module name="AvoidNestedBlocks"/>
  114. <module name="EmptyBlock"/>
  115. <module name="LeftCurly"/>
  116. <module name="NeedBraces"/>
  117. <module name="RightCurly"/>
  118. <!-- Checks for common coding problems -->
  119. <!-- See https://checkstyle.org/config_coding.html -->
  120. <module name="EmptyStatement"/>
  121. <module name="EqualsHashCode">
  122. <property name="severity" value="warning"/>
  123. </module>
  124. <module name="HiddenField">
  125. <property name="ignoreConstructorParameter" value="true"/>
  126. <property name="ignoreSetter" value="true"/>
  127. </module>
  128. <module name="IllegalInstantiation"/>
  129. <module name="InnerAssignment"/>
  130. <!--<module name="MagicNumber"/>-->
  131. <!--<module name="MissingSwitchDefault">
  132. <property name="severity" value="warning"/>
  133. </module>-->
  134. <module name="MultipleVariableDeclarations"/>
  135. <module name="SimplifyBooleanExpression"/>
  136. <module name="SimplifyBooleanReturn"/>
  137. <module name="FinalLocalVariable">
  138. <property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
  139. <property name="validateEnhancedForLoopVariable" value="true"/>
  140. </module>
  141. <!-- Checks for class design -->
  142. <!-- See https://checkstyle.org/config_design.html -->
  143. <!--<module name="DesignForExtension"/>-->
  144. <module name="FinalClass"/>
  145. <module name="HideUtilityClassConstructor"/>
  146. <module name="InterfaceIsType"/>
  147. <!--<module name="VisibilityModifier">
  148. <property name="ignoreAnnotationCanonicalNames" value="State,ColumnInfo"/>
  149. <property name="severity" value="warning"/>
  150. </module>-->
  151. <!-- Miscellaneous other checks. -->
  152. <!-- See https://checkstyle.org/config_misc.html -->
  153. <module name="ArrayTypeStyle"/>
  154. <module name="FinalParameters"/>
  155. <!--<module name="TodoComment">
  156. <property name="format" value="(TODO:|FIXME:)"/>
  157. <property name="severity" value="warning"/>
  158. </module>-->
  159. <module name="UpperEll"/>
  160. <module name="SuppressWarningsHolder" />
  161. </module>
  162. </module>