netty-demo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
8.0 KiB

13 years ago
13 years ago
13 years ago
  1. <?xml version="1.0"?>
  2. <!--
  3. /*
  4. * Copyright 2001-2004 The Apache Software Foundation.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. -->
  19. <!DOCTYPE module PUBLIC
  20. "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
  21. "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
  22. <!--
  23. Checkstyle configuration that checks the sun coding conventions from:
  24. - the Java Language Specification at
  25. http://java.sun.com/docs/books/jls/second_edition/html/index.html
  26. - the Sun Code Conventions at http://java.sun.com/docs/codeconv/
  27. - the Javadoc guidelines at
  28. http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
  29. - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
  30. - some best practices
  31. Checkstyle is very configurable. Be sure to read the documentation at
  32. http://checkstyle.sf.net (or in your downloaded distribution).
  33. Most Checks are configurable, be sure to consult the documentation.
  34. To completely disable a check, just comment it out or delete it from the file.
  35. Finally, it is worth reading the documentation.
  36. -->
  37. <module name="Checker">
  38. <!-- Checks whether files end with a new line. -->
  39. <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
  40. <!-- module name="NewlineAtEndOfFile"/-->
  41. <!-- Checks that property files contain the same keys. -->
  42. <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
  43. <module name="Translation"/>
  44. <module name="FileLength"/>
  45. <module name="FileTabCharacter">
  46. <property name="eachLine" value="true"/>
  47. </module>
  48. <module name="TreeWalker">
  49. <!-- Checks for Naming Conventions. -->
  50. <!-- See http://checkstyle.sf.net/config_naming.html -->
  51. <module name="ConstantName">
  52. <property name="format" value="^([A-Z_][A-Z0-9]*(_[A-Z0-9]+)*|_log)$"/>
  53. </module>
  54. <module name="LocalFinalVariableName"/>
  55. <module name="LocalVariableName"/>
  56. <module name="MemberName"/>
  57. <module name="MethodName"/>
  58. <module name="PackageName"/>
  59. <module name="ParameterName"/>
  60. <module name="StaticVariableName"/>
  61. <module name="TypeName"/>
  62. <!-- Checks for Headers -->
  63. <!-- See http://checkstyle.sf.net/config_header.html -->
  64. <!-- <module name="Header"> -->
  65. <!-- The follow property value demonstrates the ability -->
  66. <!-- to have access to ANT properties. In this case it uses -->
  67. <!-- the ${basedir} property to allow Checkstyle to be run -->
  68. <!-- from any directory within a project. See property -->
  69. <!-- expansion, -->
  70. <!-- http://checkstyle.sf.net/config.html#properties -->
  71. <!-- <property -->
  72. <!-- name="headerFile" -->
  73. <!-- value="${basedir}/java.header"/> -->
  74. <!-- </module> -->
  75. <!-- Following interprets the header file as regular expressions. -->
  76. <!-- <module name="RegexpHeader"/> -->
  77. <!-- Checks for imports -->
  78. <!-- See http://checkstyle.sf.net/config_import.html -->
  79. <!--module name="AvoidStarImport"/-->
  80. <module name="IllegalImport"/>
  81. <!-- defaults to sun.* packages -->
  82. <module name="RedundantImport"/>
  83. <module name="UnusedImports"/>
  84. <!-- Checks for Size Violations. -->
  85. <!-- See http://checkstyle.sf.net/config_sizes.html -->
  86. <module name="LineLength">
  87. <property name="max" value="110"/>
  88. </module>
  89. <module name="MethodLength"/>
  90. <module name="ParameterNumber">
  91. <property name="max" value="5"/>
  92. </module>
  93. <!-- Checks for whitespace -->
  94. <!-- See http://checkstyle.sf.net/config_whitespace.html -->
  95. <module name="EmptyForIteratorPad"/>
  96. <module name="MethodParamPad"/>
  97. <module name="NoWhitespaceAfter"/>
  98. <module name="NoWhitespaceBefore"/>
  99. <module name="OperatorWrap"/>
  100. <module name="ParenPad"/>
  101. <module name="TypecastParenPad"/>
  102. <module name="WhitespaceAfter"/>
  103. <!--module name="WhitespaceAround"/-->
  104. <!-- Modifier Checks -->
  105. <!-- See http://checkstyle.sf.net/config_modifiers.html -->
  106. <module name="ModifierOrder"/>
  107. <module name="RedundantModifier"/>
  108. <!-- Checks for blocks. You know, those {}'s -->
  109. <!-- See http://checkstyle.sf.net/config_blocks.html -->
  110. <module name="AvoidNestedBlocks">
  111. <property name="allowInSwitchCase" value="true"/>
  112. </module>
  113. <module name="EmptyBlock"/>
  114. <module name="LeftCurly"/>
  115. <module name="NeedBraces"/>
  116. <module name="RightCurly"/>
  117. <!-- Checks for common coding problems -->
  118. <!-- See http://checkstyle.sf.net/config_coding.html -->
  119. <!--module name="AvoidInlineConditionals"/-->
  120. <!-- MY FAVOURITE -->
  121. <module name="EmptyStatement"/>
  122. <module name="EqualsHashCode"/>
  123. <!--module name="HiddenField"/-->
  124. <module name="IllegalInstantiation"/>
  125. <module name="InnerAssignment"/>
  126. <!--module name="MagicNumber"/-->
  127. <module name="RedundantThrows">
  128. <property name="allowUnchecked" value="true"/>
  129. </module>
  130. <module name="SimplifyBooleanExpression"/>
  131. <module name="SimplifyBooleanReturn"/>
  132. <module name="StringLiteralEquality"/>
  133. <module name="NestedIfDepth"/>
  134. <module name="NestedTryDepth"/>
  135. <module name="SuperClone"/>
  136. <module name="IllegalCatch">
  137. <property name="illegalClassNames" value=" java.lang.Throwable, java.lang.RuntimeException"/>
  138. </module>
  139. <!--module name="IllegalThrows"/-->
  140. <module name="FallThrough"/>
  141. <module name="UnnecessaryParentheses"/>
  142. <!--module name="FinalLocalVariable"/-->
  143. <!-- Checks for class design -->
  144. <!-- See http://checkstyle.sf.net/config_design.html -->
  145. <!--module name="DesignForExtension"/-->
  146. <module name="FinalClass"/>
  147. <!--module name="HideUtilityClassConstructor"/-->
  148. <module name="InterfaceIsType"/>
  149. <module name="VisibilityModifier"/>
  150. <!-- Miscellaneous other checks. -->
  151. <!-- See http://checkstyle.sf.net/config_misc.html -->
  152. <module name="ArrayTypeStyle"/>
  153. <module name="Regexp">
  154. <property name="format" value="System\.(out)|(err)\.print(ln)?\("/>
  155. <property name="illegalPattern" value="true"/>
  156. </module>
  157. <module name="Regexp">
  158. <property name="format" value="System\.exit"/>
  159. <property name="illegalPattern" value="true"/>
  160. </module>
  161. <module name="Regexp">
  162. <property name="format" value="\.printStacktrace"/>
  163. <property name="illegalPattern" value="true"/>
  164. </module>
  165. <!--module name="FinalParameters"/-->
  166. <!--module name="GenericIllegalRegexp">
  167. <property name="format" value="\s+$"/>
  168. <property name="message" value="Line has trailing spaces."/>
  169. </module-->
  170. <!--module name="TodoComment"/-->
  171. <module name="UpperEll"/>
  172. </module>
  173. </module>