style.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?xml version="1.0"?>
  2. <!DOCTYPE module PUBLIC
  3. "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
  4. "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
  5. <!--
  6. Checkstyle configuration that checks the sun coding conventions from:
  7. - the Java Language Specification at
  8. http://java.sun.com/docs/books/jls/second_edition/html/index.html
  9. - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
  10. - the Javadoc guidelines at
  11. http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
  12. - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
  13. - some best practices
  14. Checkstyle is very configurable. Be sure to read the documentation at
  15. http://checkstyle.sf.net (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. Finally, it is worth reading the documentation.
  19. -->
  20. <module name="Checker">
  21. <!-- Checks that a package.html file exists for each package. -->
  22. <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
  23. <module name="PackageHtml"/>
  24. <!-- Checks whether files end with a new line. -->
  25. <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
  26. <!-- <module name="NewlineAtEndOfFile"/> -->
  27. <!-- Checks that property files contain the same keys. -->
  28. <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
  29. <module name="Translation"/>
  30. <module name="TreeWalker">
  31. <!-- Checks for Javadoc comments. -->
  32. <!-- See http://checkstyle.sf.net/config_javadoc.html -->
  33. <module name="JavadocMethod"/>
  34. <module name="JavadocType"/>
  35. <module name="JavadocVariable"/>
  36. <!-- Checks for Naming Conventions. -->
  37. <!-- See http://checkstyle.sf.net/config_naming.html -->
  38. <module name="ConstantName"/>
  39. <module name="LocalFinalVariableName"/>
  40. <module name="LocalVariableName"/>
  41. <module name="MemberName"/>
  42. <module name="MethodName"/>
  43. <module name="PackageName"/>
  44. <module name="ParameterName"/>
  45. <module name="StaticVariableName"/>
  46. <module name="TypeName"/>
  47. <!-- Checks for Headers -->
  48. <!-- See http://checkstyle.sf.net/config_header.html -->
  49. <!-- <module name="Header"> -->
  50. <!-- The follow property value demonstrates the ability -->
  51. <!-- to have access to ANT properties. In this case it uses -->
  52. <!-- the ${basedir} property to allow Checkstyle to be run -->
  53. <!-- from any directory within a project. -->
  54. <!-- <property name="headerFile" value="${basedir}/java.header"/> -->
  55. <!-- </module> -->
  56. <!-- Following interprets the header file as regular expressions. -->
  57. <!-- <module name="RegexpHeader"/> -->
  58. <!-- Checks for imports -->
  59. <!-- See http://checkstyle.sf.net/config_import.html -->
  60. <module name="AvoidStarImport"/>
  61. <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
  62. <module name="RedundantImport"/>
  63. <module name="UnusedImports"/>
  64. <!-- Checks for Size Violations. -->
  65. <!-- See http://checkstyle.sf.net/config_sizes.html -->
  66. <!-- <module name="FileLength"/> -->
  67. <module name="LineLength">
  68. <property name="max" value="80"/>
  69. </module>
  70. <!-- <module name="MethodLength"/> -->
  71. <module name="ParameterNumber">
  72. <property name="max" value="12"/>
  73. </module>
  74. <!-- Checks for whitespace -->
  75. <!-- See http://checkstyle.sf.net/config_whitespace.html -->
  76. <module name="EmptyForIteratorPad"/>
  77. <module name="NoWhitespaceAfter"/>
  78. <module name="NoWhitespaceBefore"/>
  79. <module name="OperatorWrap"/>
  80. <module name="ParenPad"/>
  81. <module name="TabCharacter"/>
  82. <module name="WhitespaceAfter"/>
  83. <module name="WhitespaceAround"/>
  84. <!-- Modifier Checks -->
  85. <!-- See http://checkstyle.sf.net/config_modifiers.html -->
  86. <module name="ModifierOrder"/>
  87. <!-- <module name="RedundantModifier"/> -->
  88. <!-- Checks for blocks. You know, those {}'s -->
  89. <!-- See http://checkstyle.sf.net/config_blocks.html -->
  90. <module name="AvoidNestedBlocks"/>
  91. <module name="EmptyBlock"/>
  92. <module name="LeftCurly"/>
  93. <module name="NeedBraces"/>
  94. <module name="RightCurly">
  95. <property name="option" value="alone"/>
  96. </module>
  97. <!-- Checks for common coding problems -->
  98. <!-- See http://checkstyle.sf.net/config_coding.html -->
  99. <!-- <module name="AvoidInlineConditionals"/> -->
  100. <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
  101. <module name="EmptyStatement"/>
  102. <!-- <module name="EqualsHashCode"/> -->
  103. <module name="HiddenField">
  104. <property name="tokens" value="VARIABLE_DEF"/>
  105. </module>
  106. <module name="IllegalInstantiation"/>
  107. <module name="InnerAssignment"/>
  108. <!-- <module name="MagicNumber"/> -->
  109. <module name="MissingSwitchDefault"/>
  110. <module name="RedundantThrows"/>
  111. <module name="SimplifyBooleanExpression"/>
  112. <module name="SimplifyBooleanReturn"/>
  113. <!-- Checks for class design -->
  114. <!-- See http://checkstyle.sf.net/config_design.html -->
  115. <!--<module name="DesignForExtension"/> -->
  116. <module name="FinalClass"/>
  117. <module name="HideUtilityClassConstructor"/>
  118. <module name="InterfaceIsType"/>
  119. <module name="VisibilityModifier"/>
  120. <!-- Miscellaneous other checks. -->
  121. <!-- See http://checkstyle.sf.net/config_misc.html -->
  122. <module name="ArrayTypeStyle"/>
  123. <!-- <module name="FinalParameters"/> -->
  124. <!-- <module name="GenericIllegalRegexp"> -->
  125. <!-- <property name="format" value="\s+$"/> -->
  126. <!-- <property name="message" value="Line has trailing spaces."/> -->
  127. <!-- </module> -->
  128. <module name="TodoComment"/>
  129. <module name="UpperEll"/>
  130. </module>
  131. </module>