|
| 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 | +<module name="Checker"> |
| 4 | + <module name="FileLength"/> |
| 5 | + <module name="FileTabCharacter"/> |
| 6 | + |
| 7 | + <module name="SuppressionFilter"> |
| 8 | + <property name="file" value="${checkStyleConfigDir}/checkstyle_suppressions.xml" /> |
| 9 | + </module> |
| 10 | + |
| 11 | + <!-- Trailing spaces --> |
| 12 | + <module name="RegexpSingleline"> |
| 13 | + <property name="format" value="\s+$"/> |
| 14 | + <property name="message" value="Line has trailing spaces."/> |
| 15 | + </module> |
| 16 | + |
| 17 | + <!-- Ensure trailling newline for compatibility --> |
| 18 | + <module name="NewlineAtEndOfFile" /> |
| 19 | + |
| 20 | + <!-- Space after 'for' and 'if' --> |
| 21 | + <module name="RegexpSingleline"> |
| 22 | + <property name="format" value="^\s*(for|if)\b[^ ]"/> |
| 23 | + <property name="message" value="Space needed before opening parenthesis."/> |
| 24 | + </module> |
| 25 | + |
| 26 | + <!-- For each spacing --> |
| 27 | + <module name="RegexpSingleline"> |
| 28 | + <property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/> |
| 29 | + <property name="message" value="Space needed around ':' character."/> |
| 30 | + </module> |
| 31 | + |
| 32 | + <module name="TreeWalker"> |
| 33 | + <!-- Checks for uncommented main() methods (debugging leftovers). --> |
| 34 | + <!-- Checks that long constants are defined with an upper ell. --> |
| 35 | + <!-- See http://checkstyle.sourceforge.net/config_misc.html#UpperEll --> |
| 36 | + <module name="UpperEll" /> |
| 37 | + |
| 38 | + <!-- Checks the style of array type definitions. --> |
| 39 | + <!-- See http://checkstyle.sourceforge.net/config_misc.html#ArrayTypeStyle --> |
| 40 | + <module name="ArrayTypeStyle" /> |
| 41 | + |
| 42 | + <!-- Checks that the outer type name and the file name match. --> |
| 43 | + <!-- See http://checkstyle.sourceforge.net/config_misc.html#OuterTypeFilename --> |
| 44 | + <module name="OuterTypeFilename" /> |
| 45 | + |
| 46 | + <!-- Validates Javadoc comments to help ensure they are well formed. --> |
| 47 | + <!-- See http://checkstyle.sourceforge.net/config_javadoc.html#JavadocStyle --> |
| 48 | + <!--<module name="JavadocStyle" />--> |
| 49 | + <!--<module name="JavadocType">--> |
| 50 | + <!--<property name="scope" value="public"/>--> |
| 51 | + <!--</module>--> |
| 52 | + |
| 53 | + <!-- Each of these naming modules validates identifiers for particular |
| 54 | + code elements. --> |
| 55 | + <!-- See http://checkstyle.sourceforge.net/config_naming.html --> |
| 56 | + <module name="ConstantName"> |
| 57 | + <property name="format" value="^[A-Z][A-Z0-9\$]*(_[A-Z0-9\$]+)*$" /> |
| 58 | + </module> |
| 59 | + <module name="LocalFinalVariableName" /> |
| 60 | + <module name="LocalVariableName" /> |
| 61 | + <module name="MemberName"> |
| 62 | + <property name="format" value="^[a-zA-Z][a-zA-Z0-9_\$]*$" /> |
| 63 | + </module> |
| 64 | + <module name="MethodName" > |
| 65 | + <property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$"/> |
| 66 | + </module> |
| 67 | + <module name="PackageName" /> |
| 68 | + <module name="ParameterName" /> |
| 69 | + <module name="StaticVariableName" /> |
| 70 | + <module name="TypeName" /> |
| 71 | + |
| 72 | + <module name="TrailingComment" /> |
| 73 | + |
| 74 | + <!-- Checks for imports. --> |
| 75 | + <!-- See http://checkstyle.sourceforge.net/config_imports.html --> |
| 76 | + <module name="AvoidStarImport"/> |
| 77 | + <module name="RedundantImport"/> |
| 78 | + <module name="UnusedImports"/> |
| 79 | + <!-- Default sun.* packages --> |
| 80 | + <module name="IllegalImport"> |
| 81 | + <property name="illegalPkgs" value="sun" /> |
| 82 | + <message key="import.illegal" value="Import from illegal package - {0}. Programs that contain direct calls to the sun.* packages are not 100% Pure Java." /> |
| 83 | + </module> |
| 84 | + <!-- Prevent importing JUnit 3 classes and Assert methods --> |
| 85 | + <module name="IllegalImport"> |
| 86 | + <property name="illegalPkgs" value="junit" /> |
| 87 | + <message key="import.illegal" value="Import from illegal package - {0}. Tests are written in JUnit 4, use org.junit.* equivalents." /> |
| 88 | + </module> |
| 89 | + <!-- Prevent importing Mockito matchers directly --> |
| 90 | + <module name="IllegalImport"> |
| 91 | + <property name="illegalPkgs" value="org.mockito.internal" /> |
| 92 | + <message key="import.illegal" value="Import from illegal package - {0}. Use org.mockito.Matchers to instantiate argument matchers; or org.hamcrest.Matchers for assertThat." /> |
| 93 | + </module> |
| 94 | + |
| 95 | + <!-- Checks for whitespace. --> |
| 96 | + <!-- See http://checkstyle.sourceforge.net/config_whitespace.html --> |
| 97 | + <module name="GenericWhitespace" /> |
| 98 | + <module name="MethodParamPad" /> |
| 99 | + <module name="NoWhitespaceAfter"> |
| 100 | + <property name="tokens" |
| 101 | + value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS" /> |
| 102 | + </module> |
| 103 | + <module name="NoWhitespaceBefore" /> |
| 104 | + <module name="OperatorWrap" /> |
| 105 | + <module name="ParenPad" /> |
| 106 | + <module name="TypecastParenPad" /> |
| 107 | + <module name="WhitespaceAfter" /> |
| 108 | + <module name="WhitespaceAround" /> |
| 109 | + |
| 110 | + |
| 111 | + <!-- Modifier Checks. --> |
| 112 | + <!-- See http://checkstyle.sourceforge.net/config_modifier.html --> |
| 113 | + <module name="ModifierOrder" /> |
| 114 | + |
| 115 | + <!-- Checks for blocks. --> |
| 116 | + <!-- See http://checkstyle.sourceforge.net/config_blocks.html --> |
| 117 | + <module name="AvoidNestedBlocks" /> |
| 118 | + <module name="EmptyBlock" > |
| 119 | + <property name="option" value="text"/> |
| 120 | + </module> |
| 121 | + <module name="NeedBraces"/> |
| 122 | + |
| 123 | + <module name="LeftCurly" /> |
| 124 | + <module name="RightCurly"> |
| 125 | + <property name="tokens" |
| 126 | + value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_ELSE" /> |
| 127 | + </module> |
| 128 | + |
| 129 | + <!-- Checks for common coding problems. --> |
| 130 | + <!-- See http://checkstyle.sourceforge.net/config_coding.html --> |
| 131 | + <module name="CovariantEquals" /> |
| 132 | + <module name="DefaultComesLast" /> |
| 133 | + <module name="EmptyStatement" /> |
| 134 | + <module name="EqualsHashCode" /> |
| 135 | + <module name="NoClone" /> |
| 136 | + <module name="NoFinalizer" /> |
| 137 | + <module name="OneStatementPerLine" /> |
| 138 | + <module name="IllegalInstantiation"/> |
| 139 | + <module name="SimplifyBooleanExpression" /> |
| 140 | + <module name="SimplifyBooleanReturn" /> |
| 141 | + <module name="StringLiteralEquality" /> |
| 142 | + <module name="UnnecessaryParentheses" /> |
| 143 | + <module name="LineLength"> |
| 144 | + <property name="max" value="120" /> |
| 145 | + </module> |
| 146 | + |
| 147 | + <!-- Checks for class design. --> |
| 148 | + <!-- See http://checkstyle.sourceforge.net/config_design.html --> |
| 149 | + <module name="FinalClass" /> |
| 150 | + <module name="InterfaceIsType" /> |
| 151 | + </module> |
| 152 | +</module> |
0 commit comments