|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> |
| 3 | +<!--refer to http://checkstyle.sourceforge.net/availablechecks.html--> |
| 4 | +<module name="Checker"> |
| 5 | + <module name="RegexpSingleline"> |
| 6 | + <!-- Checks that FIXME is not used in comments. TODO is preferred. --> |
| 7 | + <property name="format" value="((//.*)|(\*.*))FIXME"/> |
| 8 | + <property name="message" value='TODO is preferred to FIXME. e.g. "TODO(johndoe): Refactor when v2 is released."'/> |
| 9 | + </module> |
| 10 | + <module name="RegexpSingleline"> |
| 11 | + <!-- Checks that TODOs are named. (Actually, just that they are followed by an open paren.) --> |
| 12 | + <property name="format" value="((//.*)|(\*.*))TODO[^(]"/> |
| 13 | + <property name="message" value='All TODOs should be named. e.g. "TODO(johndoe): Refactor when v2 is released."'/> |
| 14 | + </module> |
| 15 | + <module name="TreeWalker"> |
| 16 | + <!--Checks the placement of left curly braces on types, methods and other blocks:--> |
| 17 | + <module name="LeftCurly"/> |
| 18 | + |
| 19 | + <!--Checks the placement of right curly braces.--> |
| 20 | + <module name="RightCurly"/> |
| 21 | + |
| 22 | + <!--Detects empty statements (standalone ';').--> |
| 23 | + <module name="EmptyStatement"/> |
| 24 | + |
| 25 | + <!--Checks that classes that override equals() also override hashCode().--> |
| 26 | + <module name="EqualsHashCode"/> |
| 27 | + |
| 28 | + <!--Checks that any combination of String literals with optional assignment is on the left side of an equals() comparison.--> |
| 29 | + <module name="EqualsAvoidNull"/> |
| 30 | + |
| 31 | + <!--Restricts the number of executable statements to a specified limit--> |
| 32 | + <module name="ExecutableStatementCount"> |
| 33 | + <property name="max" value="40"/> |
| 34 | + </module> |
| 35 | + |
| 36 | + <!--Checks for long anonymous inner classes.--> |
| 37 | + <module name="AnonInnerLength"> |
| 38 | + <property name="max" value="15"/> |
| 39 | + </module> |
| 40 | + |
| 41 | + <!--Checks for long methods.--> |
| 42 | + <module name="MethodLength"> |
| 43 | + <property name="countEmpty" value="false"/> |
| 44 | + <property name="max" value="50"/> |
| 45 | + </module> |
| 46 | + |
| 47 | + <!--Checks for unused import statements.--> |
| 48 | + <module name="UnusedImports"/> |
| 49 | + |
| 50 | + <!--Checks for imports that are redundant.--> |
| 51 | + <module name="RedundantImport"/> |
| 52 | + |
| 53 | + <!--Implements Bloch, Effective Java, Item 17 - Use Interfaces only to define types.--> |
| 54 | + <module name="InterfaceIsType"/> |
| 55 | + |
| 56 | + <!--Checks that the order of modifiers conforms to the suggestions in the Java Language specification, sections 8.1.1, 8.3.1 and 8.4.3.--> |
| 57 | + <module name="ModifierOrder"/> |
| 58 | + |
| 59 | + <!--Checks there is only one statement per line.--> |
| 60 | + <module name="OneStatementPerLine"/> |
| 61 | + |
| 62 | + <!--Checks line wrapping for operators.--> |
| 63 | + <module name="OperatorWrap"/> |
| 64 | + |
| 65 | + <!-- naming begin --> |
| 66 | + <module name="PackageName"> |
| 67 | + <property name="format" value="^[a-z][a-z0-9\.]*$"/> |
| 68 | + </module> |
| 69 | + |
| 70 | + <module name="TypeName"> |
| 71 | + <property name="format" value="^[A-Z][a-zA-Z0-9]*$"/> |
| 72 | + </module> |
| 73 | + |
| 74 | + <module name="MemberName"> |
| 75 | + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> |
| 76 | + </module> |
| 77 | + |
| 78 | + <module name="MethodName"> |
| 79 | + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> |
| 80 | + </module> |
| 81 | + |
| 82 | + <module name="ParameterName"> |
| 83 | + <property name="format" value="^[a-z][a-zA-Z0-9]*$"/> |
| 84 | + </module> |
| 85 | + |
| 86 | + <module name="ConstantName"/> |
| 87 | + |
| 88 | + <module name="StaticVariableName"/> |
| 89 | + |
| 90 | + <module name="LocalVariableName"/> |
| 91 | + |
| 92 | + <module name="ClassTypeParameterName"/> |
| 93 | + |
| 94 | + <module name="MethodTypeParameterName"/> |
| 95 | + <!-- naming end --> |
| 96 | + |
| 97 | + <!--Checks the number of parameters that a method or constructor has.--> |
| 98 | + <module name="ParameterNumber"> |
| 99 | + <property name="max" value="5"/> |
| 100 | + </module> |
| 101 | + |
| 102 | + <module name="Indentation"/> |
| 103 | + |
| 104 | + <!--Checks that there is no whitespace before a token.--> |
| 105 | + <module name="NoWhitespaceBefore"> |
| 106 | + <property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC"/> |
| 107 | + <property name="allowLineBreaks" value="true"/> |
| 108 | + </module> |
| 109 | + |
| 110 | + <!--Checks that there is no whitespace after a token.--> |
| 111 | + <module name="NoWhitespaceAfter"> |
| 112 | + <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/> |
| 113 | + </module> |
| 114 | + |
| 115 | + <!--Checks that a token is surrounded by whitespace. Empty constructor and method bodies (blocks) of the form--> |
| 116 | + <module name="WhitespaceAround"> |
| 117 | + <property name="tokens" |
| 118 | + value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"/> |
| 119 | + </module> |
| 120 | + |
| 121 | + <!--Checks that a token is followed by whitespace, with the exception that it does not check for whitespace after the semicolon of an empty for iterator.--> |
| 122 | + <module name="WhitespaceAfter"/> |
| 123 | + |
| 124 | + <!--Checks that the whitespace around the Generic tokens < and > are correct to the typical convention.--> |
| 125 | + <module name="GenericWhitespace"/> |
| 126 | + |
| 127 | + <!--Checks the padding between the identifier of a method definition, constructor definition, method call, or constructor invocation; and the left parenthesis of the parameter list. --> |
| 128 | + <module name="MethodParamPad"/> |
| 129 | + |
| 130 | + <!--Checks if unnecessary parentheses are used in a statement or expression.--> |
| 131 | + <module name="UnnecessaryParentheses"/> |
| 132 | + |
| 133 | + <!--Detects uncommented main methods.--> |
| 134 | + <module name="UncommentedMain"/> |
| 135 | + |
| 136 | + <!--Checks for overly complicated boolean expressions.--> |
| 137 | + <module name="SimplifyBooleanExpression"/> |
| 138 | + |
| 139 | + <!--Checks for overly complicated boolean return statements.--> |
| 140 | + <module name="SimplifyBooleanReturn"/> |
| 141 | + |
| 142 | + <!--Restricts nested for blocks to a specified depth (default = 1).--> |
| 143 | + <module name="NestedForDepth"/> |
| 144 | + |
| 145 | + <!--Restricts nested if-else blocks to a specified depth (default = 1).--> |
| 146 | + <module name="NestedIfDepth"/> |
| 147 | + |
| 148 | + <!--Restricts nested try-catch-finally blocks to a specified depth (default = 1).--> |
| 149 | + <module name="NestedTryDepth"> |
| 150 | + <property name="max" value="0"/> |
| 151 | + </module> |
| 152 | + |
| 153 | + <!--Checks that each variable declaration is in its own statement and on its own line.--> |
| 154 | + <module name="MultipleVariableDeclarations"/> |
| 155 | + |
| 156 | + <!--Checks that switch statement has "default" clause.--> |
| 157 | + <module name="MissingSwitchDefault"/> |
| 158 | + </module> |
| 159 | + |
| 160 | + <!--Checks for long source files.--> |
| 161 | + <module name="FileLength"> |
| 162 | + <property name="max" value="500"/> |
| 163 | + </module> |
| 164 | + |
| 165 | + <!--Checks to see if a file contains a tab character.--> |
| 166 | + <module name="FileTabCharacter"/> |
| 167 | +</module> |
0 commit comments