checkstyle.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?xml version="1.0"?>
  2. <!DOCTYPE module PUBLIC
  3. "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
  4. "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
  5. <!--
  6. Checkstyle configuration for Hadoop that is based on the sun_checks.xml file
  7. that is bundled with Checkstyle and includes checks for:
  8. - the Java Language Specification at
  9. http://java.sun.com/docs/books/jls/second_edition/html/index.html
  10. - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
  11. - the Javadoc guidelines at
  12. http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
  13. - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
  14. - some best practices
  15. Checkstyle is very configurable. Be sure to read the documentation at
  16. http://checkstyle.sf.net (or in your downloaded distribution).
  17. Most Checks are configurable, be sure to consult the documentation.
  18. To completely disable a check, just comment it out or delete it from the file.
  19. Finally, it is worth reading the documentation.
  20. -->
  21. <module name="Checker">
  22. <!-- Checks that a package.html file exists for each package. -->
  23. <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
  24. <module name="JavadocPackage"/>
  25. <!-- Checks whether files end with a new line. -->
  26. <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
  27. <!-- module name="NewlineAtEndOfFile"/-->
  28. <!-- Checks that property files contain the same keys. -->
  29. <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
  30. <module name="Translation"/>
  31. <module name="FileLength"/>
  32. <module name="FileTabCharacter"/>
  33. <module name="TreeWalker">
  34. <!-- Checks for Javadoc comments. -->
  35. <!-- See http://checkstyle.sf.net/config_javadoc.html -->
  36. <module name="JavadocType">
  37. <property name="scope" value="public"/>
  38. <property name="allowMissingParamTags" value="true"/>
  39. </module>
  40. <module name="JavadocStyle"/>
  41. <!-- Checks for Naming Conventions. -->
  42. <!-- See http://checkstyle.sf.net/config_naming.html -->
  43. <module name="ConstantName"/>
  44. <module name="LocalFinalVariableName"/>
  45. <module name="LocalVariableName"/>
  46. <module name="MemberName"/>
  47. <module name="MethodName"/>
  48. <module name="PackageName"/>
  49. <module name="ParameterName"/>
  50. <module name="StaticVariableName"/>
  51. <module name="TypeName"/>
  52. <!-- Checks for Headers -->
  53. <!-- See http://checkstyle.sf.net/config_header.html -->
  54. <!-- <module name="Header"> -->
  55. <!-- The follow property value demonstrates the ability -->
  56. <!-- to have access to ANT properties. In this case it uses -->
  57. <!-- the ${basedir} property to allow Checkstyle to be run -->
  58. <!-- from any directory within a project. See property -->
  59. <!-- expansion, -->
  60. <!-- http://checkstyle.sf.net/config.html#properties -->
  61. <!-- <property -->
  62. <!-- name="headerFile" -->
  63. <!-- value="${basedir}/java.header"/> -->
  64. <!-- </module> -->
  65. <!-- Following interprets the header file as regular expressions. -->
  66. <!-- <module name="RegexpHeader"/> -->
  67. <!-- Checks for imports -->
  68. <!-- See http://checkstyle.sf.net/config_import.html -->
  69. <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
  70. <module name="RedundantImport"/>
  71. <module name="UnusedImports"/>
  72. <!-- Checks for Size Violations. -->
  73. <!-- See http://checkstyle.sf.net/config_sizes.html -->
  74. <module name="LineLength"/>
  75. <module name="MethodLength"/>
  76. <module name="ParameterNumber"/>
  77. <!-- Checks for whitespace -->
  78. <!-- See http://checkstyle.sf.net/config_whitespace.html -->
  79. <module name="EmptyForIteratorPad"/>
  80. <module name="MethodParamPad"/>
  81. <module name="NoWhitespaceAfter"/>
  82. <module name="NoWhitespaceBefore"/>
  83. <module name="ParenPad"/>
  84. <module name="TypecastParenPad"/>
  85. <module name="WhitespaceAfter">
  86. <property name="tokens" value="COMMA, SEMI"/>
  87. </module>
  88. <!-- Modifier Checks -->
  89. <!-- See http://checkstyle.sf.net/config_modifiers.html -->
  90. <module name="ModifierOrder"/>
  91. <module name="RedundantModifier"/>
  92. <!-- Checks for blocks. You know, those {}'s -->
  93. <!-- See http://checkstyle.sf.net/config_blocks.html -->
  94. <module name="AvoidNestedBlocks"/>
  95. <module name="EmptyBlock"/>
  96. <module name="LeftCurly"/>
  97. <module name="NeedBraces"/>
  98. <module name="RightCurly"/>
  99. <!-- Checks for common coding problems -->
  100. <!-- See http://checkstyle.sf.net/config_coding.html -->
  101. <!-- module name="AvoidInlineConditionals"/-->
  102. <module name="DoubleCheckedLocking"/>
  103. <module name="EmptyStatement"/>
  104. <module name="EqualsHashCode"/>
  105. <module name="HiddenField">
  106. <property name="ignoreConstructorParameter" value="true"/>
  107. </module>
  108. <module name="IllegalInstantiation"/>
  109. <module name="InnerAssignment"/>
  110. <module name="MissingSwitchDefault"/>
  111. <module name="RedundantThrows"/>
  112. <module name="SimplifyBooleanExpression"/>
  113. <module name="SimplifyBooleanReturn"/>
  114. <!-- Checks for class design -->
  115. <!-- See http://checkstyle.sf.net/config_design.html -->
  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="Indentation">
  124. <property name="basicOffset" value="2" />
  125. <property name="caseIndent" value="0" />
  126. </module>
  127. <module name="TodoComment"/>
  128. <module name="UpperEll"/>
  129. </module>
  130. </module>