rmq_checkstyle.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!DOCTYPE module PUBLIC
  17. "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
  18. "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
  19. <!--Refer http://checkstyle.sourceforge.net/reports/google-java-style.html#s2.2-file-encoding -->
  20. <module name="Checker">
  21. <property name="localeLanguage" value="en"/>
  22. <!--To configure the check to report on the first instance in each file-->
  23. <module name="FileTabCharacter"/>
  24. <!-- header -->
  25. <module name="RegexpHeader">
  26. <property name="header" value="/\*\nLicensed to the Apache Software Foundation*"/>
  27. <property name="fileExtensions" value="java" />
  28. </module>
  29. <module name="RegexpSingleline">
  30. <property name="format" value="System\.out\.println"/>
  31. <property name="message" value="Prohibit invoking System.out.println in source code !"/>
  32. </module>
  33. <module name="RegexpSingleline">
  34. <property name="format" value="//FIXME"/>
  35. <property name="message" value="Recommended fix FIXME task !"/>
  36. </module>
  37. <module name="RegexpSingleline">
  38. <property name="format" value="//TODO"/>
  39. <property name="message" value="Recommended fix TODO task !"/>
  40. </module>
  41. <module name="RegexpSingleline">
  42. <property name="format" value="@alibaba"/>
  43. <property name="message" value="Recommended remove @alibaba keyword!"/>
  44. </module>
  45. <module name="RegexpSingleline">
  46. <property name="format" value="@taobao"/>
  47. <property name="message" value="Recommended remove @taobao keyword!"/>
  48. </module>
  49. <module name="RegexpSingleline">
  50. <property name="format" value="@author"/>
  51. <property name="message" value="Recommended remove @author tag in javadoc!"/>
  52. </module>
  53. <module name="RegexpSingleline">
  54. <property name="format"
  55. value=".*[\u3400-\u4DB5\u4E00-\u9FA5\u9FA6-\u9FBB\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9\uFF00-\uFFEF\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF]+.*"/>
  56. <property name="message" value="Not allow chinese character !"/>
  57. </module>
  58. <module name="FileLength">
  59. <property name="max" value="3000"/>
  60. </module>
  61. <module name="TreeWalker">
  62. <module name="UnusedImports">
  63. <property name="processJavadoc" value="true"/>
  64. </module>
  65. <module name="RedundantImport"/>
  66. <!--<module name="IllegalImport" />-->
  67. <!--Checks that classes that override equals() also override hashCode()-->
  68. <module name="EqualsHashCode"/>
  69. <!--Checks for over-complicated boolean expressions. Currently finds code like if (topic == true), topic || true, !false, etc.-->
  70. <module name="SimplifyBooleanExpression"/>
  71. <module name="OneStatementPerLine"/>
  72. <module name="UnnecessaryParentheses"/>
  73. <!--Checks for over-complicated boolean return statements. For example the following code-->
  74. <module name="SimplifyBooleanReturn"/>
  75. <!--Check that the default is after all the cases in producerGroup switch statement-->
  76. <module name="DefaultComesLast"/>
  77. <!--Detects empty statements (standalone ";" semicolon)-->
  78. <module name="EmptyStatement"/>
  79. <!--Checks that long constants are defined with an upper ell-->
  80. <module name="UpperEll"/>
  81. <module name="ConstantName">
  82. <property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)|(^log$)"/>
  83. </module>
  84. <!--Checks that local, non-final variable names conform to producerGroup format specified by the format property-->
  85. <module name="LocalVariableName"/>
  86. <!--Validates identifiers for local, final variables, including catch parameters-->
  87. <module name="LocalFinalVariableName"/>
  88. <!--Validates identifiers for non-static fields-->
  89. <module name="MemberName"/>
  90. <!--Validates identifiers for class type parameters-->
  91. <module name="ClassTypeParameterName">
  92. <property name="format" value="^[A-Z0-9]*$"/>
  93. </module>
  94. <!--Validates identifiers for method type parameters-->
  95. <module name="MethodTypeParameterName">
  96. <property name="format" value="^[A-Z0-9]*$"/>
  97. </module>
  98. <module name="PackageName"/>
  99. <module name="ParameterName"/>
  100. <module name="StaticVariableName"/>
  101. <module name="TypeName"/>
  102. <!--Checks that there are no import statements that use the * notation-->
  103. <module name="AvoidStarImport"/>
  104. <!--whitespace-->
  105. <module name="GenericWhitespace"/>
  106. <module name="NoWhitespaceBefore"/>
  107. <module name="NoWhitespaceAfter"/>
  108. <module name="WhitespaceAround">
  109. <property name="allowEmptyConstructors" value="true"/>
  110. <property name="allowEmptyMethods" value="true"/>
  111. </module>
  112. <module name="Indentation"/>
  113. <module name="MethodParamPad"/>
  114. <module name="ParenPad"/>
  115. <module name="TypecastParenPad"/>
  116. </module>
  117. </module>