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