aboutsummaryrefslogtreecommitdiff
path: root/_checkstyle/checks.xml
blob: 93bbca1d1374446a5fe6d22518bd0829021912bb (plain)
  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. <!--
  6. Checkstyle configuration that checks the sun coding conventions from:
  7. - the Java Language Specification at
  8. https://docs.oracle.com/javase/specs/jls/se11/html/index.html
  9. - the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
  10. - the Javadoc guidelines at
  11. https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
  12. - the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
  13. - some best practices
  14. Checkstyle is very configurable. Be sure to read the documentation at
  15. https://checkstyle.org (or in your downloaded distribution).
  16. Most Checks are configurable, be sure to consult the documentation.
  17. To completely disable a check, just comment it out or delete it from the file.
  18. To suppress certain violations please review suppression filters.
  19. Finally, it is worth reading the documentation.
  20. -->
  21. <module name="Checker">
  22. <!--
  23. If you set the basedir property below, then all reported file
  24. names will be relative to the specified directory. See
  25. https://checkstyle.org/config.html#Checker
  26. <property name="basedir" value="${basedir}"/>
  27. -->
  28. <property name="severity" value="error"/>
  29. <property name="fileExtensions" value="java, properties, xml"/>
  30. <!-- Excludes all 'module-info.java' files -->
  31. <!-- See https://checkstyle.org/config_filefilters.html -->
  32. <module name="BeforeExecutionExclusionFileFilter">
  33. <property name="fileNamePattern" value="module\-info\.java$"/>
  34. </module>
  35. <!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
  36. <module name="SuppressionFilter">
  37. <property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
  38. default="checkstyle-suppressions.xml" />
  39. <property name="optional" value="true"/>
  40. </module>
  41. <!-- Checks that a package-info.java file exists for each package. -->
  42. <!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
  43. <!--<module name="JavadocPackage"/>-->
  44. <!-- Checks whether files end with a new line. -->
  45. <!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
  46. <module name="NewlineAtEndOfFile"/>
  47. <!-- Checks that property files contain the same keys. -->
  48. <!-- See https://checkstyle.org/config_misc.html#Translation -->
  49. <module name="Translation"/>
  50. <!-- Checks for Size Violations. -->
  51. <!-- See https://checkstyle.org/config_sizes.html -->
  52. <module name="FileLength"/>
  53. <module name="LineLength">
  54. <property name="fileExtensions" value="java"/>
  55. <property name="ignorePattern" value="SPDX-|https?://"/>
  56. <property name="max" value="73"/>
  57. </module>
  58. <!-- Checks for whitespace -->
  59. <!-- See https://checkstyle.org/config_whitespace.html -->
  60. <!--<module name="FileTabCharacter"/>-->
  61. <!-- Miscellaneous other checks. -->
  62. <!-- See https://checkstyle.org/config_misc.html -->
  63. <module name="RegexpSingleline">
  64. <property name="format" value="\s+$"/>
  65. <property name="minimum" value="0"/>
  66. <property name="maximum" value="0"/>
  67. <property name="message" value="Line has trailing spaces."/>
  68. </module>
  69. <!-- Checks for Headers -->
  70. <!-- See https://checkstyle.org/config_header.html -->
  71. <!-- <module name="Header"> -->
  72. <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
  73. <!-- <property name="fileExtensions" value="java"/> -->
  74. <!-- </module> -->
  75. <module name="TreeWalker">
  76. <!-- Checks for Javadoc comments. -->
  77. <!-- See https://checkstyle.org/config_javadoc.html -->
  78. <module name="InvalidJavadocPosition"/>
  79. <!--<module name="JavadocMethod"/>-->
  80. <module name="JavadocType"/>
  81. <!--<module name="JavadocVariable"/>-->
  82. <module name="JavadocStyle"/>
  83. <!--<module name="MissingJavadocMethod"/>-->
  84. <!-- Checks for Naming Conventions. -->
  85. <!-- See https://checkstyle.org/config_naming.html -->
  86. <module name="ConstantName"/>
  87. <module name="LocalFinalVariableName"/>
  88. <module name="LocalVariableName"/>
  89. <module name="MemberName"/>
  90. <module name="MethodName"/>
  91. <module name="PackageName"/>
  92. <module name="ParameterName"/>
  93. <module name="StaticVariableName"/>
  94. <module name="TypeName"/>
  95. <!-- Checks for imports -->
  96. <!-- See https://checkstyle.org/config_imports.html -->
  97. <module name="AvoidStarImport"/>
  98. <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
  99. <module name="RedundantImport"/>
  100. <module name="UnusedImports">
  101. <property name="processJavadoc" value="false"/>
  102. </module>
  103. <!-- Checks for Size Violations. -->
  104. <!-- See https://checkstyle.org/config_sizes.html -->
  105. <module name="MethodLength"/>
  106. <module name="ParameterNumber"/>
  107. <!-- Checks for whitespace -->
  108. <!-- See https://checkstyle.org/config_whitespace.html -->
  109. <module name="EmptyForIteratorPad"/>
  110. <module name="GenericWhitespace"/>
  111. <module name="MethodParamPad"/>
  112. <module name="NoWhitespaceAfter"/>
  113. <module name="NoWhitespaceBefore"/>
  114. <module name="OperatorWrap"/>
  115. <module name="ParenPad"/>
  116. <module name="TypecastParenPad"/>
  117. <module name="WhitespaceAfter"/>
  118. <module name="WhitespaceAround"/>
  119. <!-- Modifier Checks -->
  120. <!-- See https://checkstyle.org/config_modifiers.html -->
  121. <module name="ModifierOrder"/>
  122. <module name="RedundantModifier"/>
  123. <!-- Checks for blocks. You know, those {}'s -->
  124. <!-- See https://checkstyle.org/config_blocks.html -->
  125. <module name="AvoidNestedBlocks"/>
  126. <module name="EmptyBlock"/>
  127. <module name="LeftCurly"/>
  128. <module name="NeedBraces"/>
  129. <module name="RightCurly"/>
  130. <!-- Checks for common coding problems -->
  131. <!-- See https://checkstyle.org/config_coding.html -->
  132. <module name="EmptyStatement"/>
  133. <module name="EqualsHashCode"/>
  134. <!--<module name="HiddenField"/>-->
  135. <module name="IllegalInstantiation"/>
  136. <module name="InnerAssignment"/>
  137. <module name="MagicNumber"/>
  138. <module name="MissingSwitchDefault"/>
  139. <module name="MultipleVariableDeclarations"/>
  140. <module name="SimplifyBooleanExpression"/>
  141. <module name="SimplifyBooleanReturn"/>
  142. <!-- Checks for class design -->
  143. <!-- See https://checkstyle.org/config_design.html -->
  144. <module name="DesignForExtension"/>
  145. <module name="FinalClass"/>
  146. <module name="HideUtilityClassConstructor"/>
  147. <module name="InterfaceIsType"/>
  148. <module name="VisibilityModifier"/>
  149. <!-- Miscellaneous other checks. -->
  150. <!-- See https://checkstyle.org/config_misc.html -->
  151. <module name="ArrayTypeStyle"/>
  152. <module name="FinalParameters"/>
  153. <module name="TodoComment"/>
  154. <module name="UpperEll"/>
  155. <!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
  156. <module name="SuppressionXpathFilter">
  157. <property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
  158. default="checkstyle-xpath-suppressions.xml" />
  159. <property name="optional" value="true"/>
  160. </module>
  161. </module>
  162. </module>