checkstyle.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. ~
  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. <!DOCTYPE module PUBLIC
  19. "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
  20. "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
  21. <module name="Checker">
  22. <property name="charset" value="UTF-8"/>
  23. <property name="severity" value="error"/>
  24. <property name="fileExtensions" value="java"/>
  25. <module name="Header">
  26. <property name="headerFile" value="{{HEADER_FILE}}"/>
  27. </module>
  28. <module name="SuppressionFilter">
  29. <property name="file" value="checkstyle-suppressions.xml"/>
  30. </module>
  31. <module name="FileTabCharacter">
  32. <property name="eachLine" value="true"/>
  33. </module>
  34. <module name="RegexpSingleline">
  35. <property name="format" value="\s+$"/>
  36. <property name="message" value="No trailing whitespace allowed."/>
  37. </module>
  38. <module name="TreeWalker">
  39. <module name="OuterTypeFilename"/>
  40. <module name="IllegalTokenText">
  41. <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
  42. <property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
  43. <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
  44. </module>
  45. <module name="AvoidEscapedUnicodeCharacters">
  46. <property name="allowEscapesForControlCharacters" value="true"/>
  47. <property name="allowByTailComment" value="true"/>
  48. <property name="allowNonPrintableEscapes" value="true"/>
  49. <property name="allowIfAllCharactersEscaped" value="true"/>
  50. </module>
  51. <module name="LineLength">
  52. <property name="max" value="100"/>
  53. <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
  54. </module>
  55. <module name="NoLineWrap"/>
  56. <module name="EmptyBlock">
  57. <property name="option" value="TEXT"/>
  58. <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
  59. </module>
  60. <module name="NeedBraces">
  61. <property name="allowSingleLineStatement" value="true"/>
  62. </module>
  63. <module name="OneStatementPerLine"/>
  64. <module name="ArrayTypeStyle"/>
  65. <module name="FallThrough"/>
  66. <module name="UpperEll"/>
  67. <module name="ModifierOrder"/>
  68. <module name="SeparatorWrap">
  69. <property name="tokens" value="DOT"/>
  70. <property name="option" value="nl"/>
  71. </module>
  72. <module name="SeparatorWrap">
  73. <property name="tokens" value="COMMA"/>
  74. <property name="option" value="EOL"/>
  75. </module>
  76. <module name="PackageName">
  77. <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
  78. <message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
  79. </module>
  80. <module name="ClassTypeParameterName">
  81. <property name="format" value="([A-Z][a-zA-Z0-9]*$)"/>
  82. <message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
  83. </module>
  84. <module name="MethodTypeParameterName">
  85. <property name="format" value="([A-Z][a-zA-Z0-9]*)"/>
  86. <message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
  87. </module>
  88. <module name="NoFinalizer"/>
  89. <module name="GenericWhitespace">
  90. <message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
  91. <message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
  92. <message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
  93. <message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
  94. </module>
  95. <module name="ImportOrder">
  96. <property name="separated" value="true"/>
  97. <property name="ordered" value="true"/>
  98. <property name="groups" value="/^javax?\./,scala,*,org.apache.livy"/>
  99. </module>
  100. <module name="MethodParamPad"/>
  101. <module name="AnnotationLocation">
  102. <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
  103. </module>
  104. <module name="AnnotationLocation">
  105. <property name="tokens" value="VARIABLE_DEF"/>
  106. <property name="allowSamelineMultipleAnnotations" value="true"/>
  107. </module>
  108. <module name="MethodName">
  109. <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
  110. <message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
  111. </module>
  112. <module name="EmptyCatchBlock">
  113. <property name="exceptionVariableName" value="expected"/>
  114. </module>
  115. <module name="CommentsIndentation"/>
  116. </module>
  117. </module>