aboutsummaryrefslogtreecommitdiff
path: root/_checkstyle/checks.xml
blob: 951b39aeabfe0e77856b9bdc92e018985f7d6262 (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="max" value="73"/>
  56. </module>
  57. <!-- Checks for whitespace -->
  58. <!-- See https://checkstyle.org/config_whitespace.html -->
  59. <!--<module name="FileTabCharacter"/>-->
  60. <!-- Miscellaneous other checks. -->
  61. <!-- See https://checkstyle.org/config_misc.html -->
  62. <module name="RegexpSingleline">
  63. <property name="format" value="\s+$"/>
  64. <property name="minimum" value="0"/>
  65. <property name="maximum" value="0"/>
  66. <property name="message" value="Line has trailing spaces."/>
  67. </module>
  68. <!-- Checks for Headers -->
  69. <!-- See https://checkstyle.org/config_header.html -->
  70. <!-- <module name="Header"> -->
  71. <!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
  72. <!-- <property name="fileExtensions" value="java"/> -->
  73. <!-- </module> -->
  74. <module name="TreeWalker">
  75. <!-- Checks for Javadoc comments. -->
  76. <!-- See https://checkstyle.org/config_javadoc.html -->
  77. <module name="InvalidJavadocPosition"/>
  78. <!--<module name="JavadocMethod"/>-->
  79. <module name="JavadocType"/>
  80. <!--<module name="JavadocVariable"/>-->
  81. <module name="JavadocStyle"/>
  82. <!--<module name="MissingJavadocMethod"/>-->
  83. <!-- Checks for Naming Conventions. -->
  84. <!-- See https://checkstyle.org/config_naming.html -->
  85. <module name="ConstantName"/>
  86. <module name="LocalFinalVariableName"/>
  87. <module name="LocalVariableName"/>
  88. <module name="MemberName"/>
  89. <module name="MethodName"/>
  90. <module name="PackageName"/>
  91. <module name="ParameterName"/>
  92. <module name="StaticVariableName"/>
  93. <module name="TypeName"/>
  94. <!-- Checks for imports -->
  95. <!-- See https://checkstyle.org/config_imports.html -->
  96. <module name="AvoidStarImport"/>
  97. <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
  98. <module name="RedundantImport"/>
  99. <module name="UnusedImports">
  100. <property name="processJavadoc" value="false"/>
  101. </module>
  102. <!-- Checks for Size Violations. -->
  103. <!-- See https://checkstyle.org/config_sizes.html -->
  104. <module name="MethodLength"/>
  105. <module name="ParameterNumber"/>
  106. <!-- Checks for whitespace -->
  107. <!-- See https://checkstyle.org/config_whitespace.html -->
  108. <module name="EmptyForIteratorPad"/>
  109. <module name="GenericWhitespace"/>
  110. <module name="MethodParamPad"/>
  111. <module name="NoWhitespaceAfter"/>
  112. <module name="NoWhitespaceBefore"/>
  113. <module name="OperatorWrap"/>
  114. <module name="ParenPad"/>
  115. <module name="TypecastParenPad"/>
  116. <module name="WhitespaceAfter"/>
  117. <module name="WhitespaceAround"/>
  118. <!-- Modifier Checks -->
  119. <!-- See https://checkstyle.org/config_modifiers.html -->
  120. <module name="ModifierOrder"/>
  121. <module name="RedundantModifier"/>
  122. <!-- Checks for blocks. You know, those {}'s -->
  123. <!-- See https://checkstyle.org/config_blocks.html -->
  124. <module name="AvoidNestedBlocks"/>
  125. <module name="EmptyBlock"/>
  126. <module name="LeftCurly"/>
  127. <module name="NeedBraces"/>
  128. <module name="RightCurly"/>
  129. <!-- Checks for common coding problems -->
  130. <!-- See https://checkstyle.org/config_coding.html -->
  131. <module name="EmptyStatement"/>
  132. <module name="EqualsHashCode"/>
  133. <!--<module name="HiddenField"/>-->
  134. <module name="IllegalInstantiation"/>
  135. <module name="InnerAssignment"/>
  136. <module name="MagicNumber"/>
  137. <module name="MissingSwitchDefault"/>
  138. <module name="MultipleVariableDeclarations"/>
  139. <module name="SimplifyBooleanExpression"/>
  140. <module name="SimplifyBooleanReturn"/>
  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. <!-- Miscellaneous other checks. -->
  149. <!-- See https://checkstyle.org/config_misc.html -->
  150. <module name="ArrayTypeStyle"/>
  151. <module name="FinalParameters"/>
  152. <module name="TodoComment"/>
  153. <module name="UpperEll"/>
  154. <!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
  155. <module name="SuppressionXpathFilter">
  156. <property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
  157. default="checkstyle-xpath-suppressions.xml" />
  158. <property name="optional" value="true"/>
  159. </module>
  160. </module>
  161. </module>