checkstyle.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE module PUBLIC
  3. "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
  4. "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
  5. <!-- This is a checkstyle configuration file. For descriptions of
  6. what the following rules do, please see the checkstyle configuration
  7. page at http://checkstyle.sourceforge.net/config.html -->
  8. <module name="Checker">
  9. <!-- Checks whether files end with a new line. -->
  10. <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
  11. <module name="NewlineAtEndOfFile" />
  12. <!-- Checks that property files contain the same keys. -->
  13. <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
  14. <module name="Translation" />
  15. <!-- Checks for Size Violations. -->
  16. <!-- See http://checkstyle.sf.net/config_sizes.html -->
  17. <module name="FileLength" />
  18. <!-- Checks for whitespace -->
  19. <!-- See http://checkstyle.sf.net/config_whitespace.html -->
  20. <module name="FileTabCharacter" />
  21. <!-- Miscellaneous other checks. -->
  22. <!-- See http://checkstyle.sf.net/config_misc.html -->
  23. <module name="RegexpSingleline">
  24. <property name="format" value="\s+$" />
  25. <property name="minimum" value="0" />
  26. <property name="maximum" value="0" />
  27. <property name="message" value="Line has trailing spaces." />
  28. <property name="severity" value="info" />
  29. </module>
  30. <module name="SuppressWarningsFilter"/>
  31. <module name="TreeWalker">
  32. <!-- Checks for Naming Conventions. -->
  33. <!-- See http://checkstyle.sf.net/config_naming.html -->
  34. <module name="ConstantName" />
  35. <module name="LocalFinalVariableName" />
  36. <module name="LocalVariableName" />
  37. <module name="MemberName" />
  38. <module name="MethodName" />
  39. <module name="PackageName" />
  40. <module name="ParameterName" />
  41. <module name="StaticVariableName" />
  42. <module name="TypeName" />
  43. <module name="SuppressWarningsHolder"/>
  44. <!-- Checks for imports -->
  45. <!-- See http://checkstyle.sf.net/config_import.html -->
  46. <module name="AvoidStarImport">
  47. <property name="allowStaticMemberImports" value="true" />
  48. </module>
  49. <module name="IllegalImport" />
  50. <!-- defaults to sun.* packages -->
  51. <module name="RedundantImport" />
  52. <module name="UnusedImports" />
  53. <module name="CustomImportOrder">
  54. <property name="thirdPartyPackageRegExp" value=".*"/>
  55. <property name="specialImportsRegExp" value="com.genymobile"/>
  56. <property name="separateLineBetweenGroups" value="true"/>
  57. <property name="customImportOrderRules" value="SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"/>
  58. </module>
  59. <!-- Checks for Size Violations. -->
  60. <!-- See http://checkstyle.sf.net/config_sizes.html -->
  61. <module name="LineLength">
  62. <!-- what is a good max value? -->
  63. <property name="max" value="150" />
  64. <!-- ignore lines like "$File: //depot/... $" -->
  65. <property name="ignorePattern" value="\$File.*\$" />
  66. <property name="severity" value="info" />
  67. </module>
  68. <module name="MethodLength" />
  69. <module name="ParameterNumber">
  70. <property name="ignoreOverriddenMethods" value="true"/>
  71. </module>
  72. <!-- Checks for whitespace -->
  73. <!-- See http://checkstyle.sf.net/config_whitespace.html -->
  74. <module name="EmptyForIteratorPad" />
  75. <module name="GenericWhitespace" />
  76. <module name="MethodParamPad" />
  77. <module name="NoWhitespaceAfter" />
  78. <module name="NoWhitespaceBefore" />
  79. <module name="OperatorWrap" />
  80. <module name="ParenPad" />
  81. <module name="TypecastParenPad" />
  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. <property name="option" value="text" />
  93. </module>
  94. <module name="LeftCurly" />
  95. <module name="NeedBraces" />
  96. <module name="RightCurly" />
  97. <!-- Checks for common coding problems -->
  98. <!-- See http://checkstyle.sf.net/config_coding.html -->
  99. <!-- <module name="AvoidInlineConditionals"/> -->
  100. <module name="EmptyStatement" />
  101. <module name="EqualsHashCode" />
  102. <module name="HiddenField">
  103. <property name="tokens" value="VARIABLE_DEF" />
  104. <!-- only check variables not parameters -->
  105. <property name="ignoreConstructorParameter" value="true" />
  106. <property name="ignoreSetter" value="true" />
  107. <property name="severity" value="warning" />
  108. </module>
  109. <module name="IllegalInstantiation" />
  110. <module name="InnerAssignment" />
  111. <module name="MagicNumber">
  112. <property name="severity" value="info" />
  113. <property name="ignoreHashCodeMethod" value="true" />
  114. <property name="ignoreAnnotation" value="true" />
  115. </module>
  116. <module name="MissingSwitchDefault" />
  117. <module name="SimplifyBooleanExpression" />
  118. <module name="SimplifyBooleanReturn" />
  119. <!-- Checks for class design -->
  120. <!-- See http://checkstyle.sf.net/config_design.html -->
  121. <!-- <module name="DesignForExtension"/> -->
  122. <module name="FinalClass" />
  123. <module name="HideUtilityClassConstructor" />
  124. <module name="InterfaceIsType" />
  125. <module name="VisibilityModifier" />
  126. <!-- Miscellaneous other checks. -->
  127. <!-- See http://checkstyle.sf.net/config_misc.html -->
  128. <module name="ArrayTypeStyle" />
  129. <!-- <module name="FinalParameters"/> -->
  130. <module name="TodoComment">
  131. <property name="format" value="TODO" />
  132. <property name="severity" value="info" />
  133. </module>
  134. <module name="UpperEll" />
  135. <module name="FileContentsHolder" />
  136. <!-- Required by comment suppression filters -->
  137. </module>
  138. <module name="SuppressionFilter">
  139. <!--<property name="file" value="team-props/checkstyle/checkstyle-suppressions.xml" />-->
  140. </module>
  141. <!-- Enable suppression comments -->
  142. <module name="SuppressionCommentFilter">
  143. <property name="offCommentFormat" value="CHECKSTYLE IGNORE\s+(\S+)" />
  144. <property name="onCommentFormat" value="CHECKSTYLE END IGNORE\s+(\S+)" />
  145. <property name="checkFormat" value="$1" />
  146. </module>
  147. <module name="SuppressWithNearbyCommentFilter">
  148. <!-- Syntax is "SUPPRESS CHECKSTYLE name" -->
  149. <property name="commentFormat" value="SUPPRESS CHECKSTYLE (\w+)" />
  150. <property name="checkFormat" value="$1" />
  151. <property name="influenceFormat" value="1" />
  152. </module>
  153. </module>