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

checkstyle-config 4.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?xml version="1.0"?>
  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 "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
  17. <module name="Checker">
  18. <module name="TreeWalker">
  19. <!-- Javadoc requirements -->
  20. <module name="JavadocType">
  21. <property name="scope" value="protected"/>
  22. </module>
  23. <module name="JavadocMethod">
  24. <property name="scope" value="protected"/>
  25. <property name="allowUndeclaredRTE" value="true"/>
  26. </module>
  27. <module name="JavadocVariable">
  28. <property name="scope" value="public"/>
  29. </module>
  30. <!-- element naming -->
  31. <module name="PackageName"/>
  32. <module name="TypeName"/>
  33. <module name="ConstantName"/>
  34. <module name="LocalFinalVariableName"/>
  35. <module name="LocalVariableName"/>
  36. <module name="MemberName"/>
  37. <module name="MethodName"/>
  38. <module name="ParameterName"/>
  39. <module name="StaticVariableName"/>
  40. <!-- required licence file -->
  41. <module name="Header">
  42. <property name="headerFile" value="${config.dir}/RequiredHeader.txt"/>
  43. <property name="ignoreLines" value="2"/>
  44. </module>
  45. <!-- Import conventions -->
  46. <module name="AvoidStarImport"/>
  47. <module name="IllegalImport"/>
  48. <module name="RedundantImport"/>
  49. <module name="UnusedImports"/>
  50. <!-- size limits -->
  51. <module name="FileLength"/>
  52. <module name="LineLength">
  53. <property name="max" value="100"/>
  54. <property name="ignorePattern" value="^ *\* *[^ ]+$"/>
  55. </module>
  56. <module name="MethodLength"/>
  57. <module name="ParameterNumber"/>
  58. <!-- whitespace checks -->
  59. <module name="EmptyForIteratorPad"/>
  60. <module name="NoWhitespaceAfter"/>
  61. <module name="NoWhitespaceBefore"/>
  62. <module name="OperatorWrap"/>
  63. <module name="ParenPad"/>
  64. <module name="TabCharacter"/>
  65. <module name="WhitespaceAfter"/>
  66. <module name="WhitespaceAround"/>
  67. <!-- Modifier Checks -->
  68. <module name="ModifierOrder"/>
  69. <module name="RedundantModifier"/>
  70. <!-- Checks for blocks -->
  71. <module name="AvoidNestedBlocks"/>
  72. <module name="EmptyBlock">
  73. <property name="option" value="text"/>
  74. </module>
  75. <module name="LeftCurly"/>
  76. <module name="NeedBraces"/>
  77. <module name="RightCurly"/>
  78. <!-- Checks for common coding problems -->
  79. <!--<module name="AvoidInlineConditionals"/> -->
  80. <module name="DoubleCheckedLocking"/>
  81. <module name="EmptyStatement"/>
  82. <module name="EqualsHashCode"/>
  83. <module name="IllegalInstantiation">
  84. <property name="classes" value="java.lang.Boolean"/>
  85. </module>
  86. <module name="InnerAssignment"/>
  87. <module name="MagicNumber"/>
  88. <module name="MissingSwitchDefault"/>
  89. <!-- Allow redundant throw declarations for doc purposes
  90. <module name="RedundantThrows">
  91. <property name="allowUnchecked" value="true"/>
  92. </module>
  93. -->
  94. <module name="SimplifyBooleanExpression"/>
  95. <module name="SimplifyBooleanReturn"/>
  96. <!-- Checks for class design -->
  97. <!-- <module name="DesignForExtension"/> -->
  98. <module name="FinalClass"/>
  99. <module name="HideUtilityClassConstructor"/>
  100. <module name="InterfaceIsType"/>
  101. <module name="VisibilityModifier"/>
  102. <!-- Miscellaneous other checks. -->
  103. <module name="ArrayTypeStyle"/>
  104. <module name="GenericIllegalRegexp">
  105. <property name="format" value="\s+$"/>
  106. <property name="message" value="Line has trailing spaces."/>
  107. </module>
  108. <module name="TodoComment"/>
  109. <module name="UpperEll"/>
  110. <!-- allow comment suppression of checks -->
  111. <module name="FileContentsHolder"/>
  112. </module>
  113. <!-- <module name="au.com.redhillconsulting.simian.SimianCheck"/> -->
  114. <module name="SuppressionCommentFilter">
  115. <property name="offCommentFormat" value="CheckStyle\:([\w\|]+) *OFF"/>
  116. <property name="onCommentFormat" value="CheckStyle\:([\w\|]+) *ON"/>
  117. <property name="checkFormat" value="$1"/>
  118. </module>
  119. </module>