| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> |
|---|
| 3 | <!-- |
|---|
| 4 | |
|---|
| 5 | Checkstyle configuration for CSc 301 at Cal Poly. |
|---|
| 6 | |
|---|
| 7 | A relaxed version of these standards: |
|---|
| 8 | http://www.csc.calpoly.edu/%7Ejdalbey/SWE/code_std.html |
|---|
| 9 | |
|---|
| 10 | To completely disable a check, just comment it out or delete it from the file. |
|---|
| 11 | |
|---|
| 12 | Finally, it is worth reading the documentation: |
|---|
| 13 | http://checkstyle.sourceforge.net/ |
|---|
| 14 | |
|---|
| 15 | DOCUMENT HISTORY |
|---|
| 16 | 1/5/2016 Relaxed even more. |
|---|
| 17 | 5/3/2010 Relaxed some standards for CSc 301 |
|---|
| 18 | 9/24/09 Branched from CSc 309 and simplified for CSc 103. |
|---|
| 19 | 4/9/06 Added Severity = Warning to several checks. |
|---|
| 20 | 4/14/06 Removed check: EqualsHashCode |
|---|
| 21 | Don't require Javadoc on PRIVATE methods. |
|---|
| 22 | Changed LineLength to 89: The length of a line in Eclipse at 800x600 resolution. |
|---|
| 23 | 4/19/06 Changed VisibilityModifier to protectedAllowed. |
|---|
| 24 | Allow types to have underscore characters in the name. |
|---|
| 25 | 5/3/06 Made method length check a warning and instead |
|---|
| 26 | made JavaNCSS count an error. |
|---|
| 27 | 5/22/06 Added custom check for one letter variable names. |
|---|
| 28 | Added custom check for logic structure comments. |
|---|
| 29 | |
|---|
| 30 | --> |
|---|
| 31 | <module name="Checker"> |
|---|
| 32 | |
|---|
| 33 | <module name="TreeWalker"> |
|---|
| 34 | <!-- Custom checks written for Dalbey's coding standard --> |
|---|
| 35 | <!-- Single character variable names not allowed. --> |
|---|
| 36 | <module name="VariableNameLength"/> |
|---|
| 37 | <!-- Logic structures must be preceded by a comment. --> |
|---|
| 38 | <module name="LogicComment"/> |
|---|
| 39 | <property name="tabWidth" value="4"/> |
|---|
| 40 | |
|---|
| 41 | <!-- Checks for Naming Conventions. --> |
|---|
| 42 | <!-- See http://checkstyle.sf.net/config_naming.html --> |
|---|
| 43 | <module name="LocalFinalVariableName"/> |
|---|
| 44 | <module name="LocalVariableName"/> |
|---|
| 45 | |
|---|
| 46 | <module name="MemberName"/> |
|---|
| 47 | <module name="MethodName"/> |
|---|
| 48 | <module name="PackageName"/> |
|---|
| 49 | <module name="ParameterName"/> |
|---|
| 50 | <module name="StaticVariableName"/> |
|---|
| 51 | <module name="TypeName"> |
|---|
| 52 | <property name="format" value="^[A-Z][_a-zA-Z0-9]*$"/> |
|---|
| 53 | </module> |
|---|
| 54 | |
|---|
| 55 | <!-- Checks for Size Violations. --> |
|---|
| 56 | <!-- See http://checkstyle.sf.net/config_sizes.html --> |
|---|
| 57 | <module name="LineLength"> |
|---|
| 58 | <property name="max" value="89"/> |
|---|
| 59 | </module> |
|---|
| 60 | <module name="MethodLength"> |
|---|
| 61 | <property name="max" value="60"/> |
|---|
| 62 | <property name="countEmpty" value="false"/> |
|---|
| 63 | <property name="severity" value="warning"/> |
|---|
| 64 | </module> |
|---|
| 65 | <module name="ParameterNumber"/> |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | <!-- Checks for whitespace --> |
|---|
| 69 | <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
|---|
| 70 | <module name="Indentation"> |
|---|
| 71 | <property name="basicOffset" value="4"/> |
|---|
| 72 | <property name="braceAdjustment" value="0"/> |
|---|
| 73 | <property name="caseIndent" value="4"/> |
|---|
| 74 | </module> |
|---|
| 75 | |
|---|
| 76 | <module name="EmptyBlock"> |
|---|
| 77 | <property name="option" value="stmt"/> |
|---|
| 78 | <property name="tokens" value="LITERAL_CATCH"/> |
|---|
| 79 | </module> |
|---|
| 80 | <module name="TabCharacter"/> |
|---|
| 81 | <!-- left brace must be on a new line --> |
|---|
| 82 | <module name="LeftCurly"> |
|---|
| 83 | <property name="option" value="nl"/> |
|---|
| 84 | </module> |
|---|
| 85 | <module name="NeedBraces"/> |
|---|
| 86 | <module name="RightCurly"> |
|---|
| 87 | <property name="option" value="alone"/> |
|---|
| 88 | </module> |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | <!-- Checks for common coding problems --> |
|---|
| 92 | <!-- See http://checkstyle.sf.net/config_coding.html --> |
|---|
| 93 | <module name="AvoidInlineConditionals"/> |
|---|
| 94 | <module name="EmptyStatement"/> |
|---|
| 95 | <module name="HiddenField"> |
|---|
| 96 | <property name="ignoreConstructorParameter" value="true"/> |
|---|
| 97 | <property name="ignoreSetter" value="true"/> |
|---|
| 98 | </module> |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | <module name="IllegalInstantiation"/> |
|---|
| 102 | <module name="InnerAssignment"> |
|---|
| 103 | <property name="severity" value="warning"/> |
|---|
| 104 | </module> |
|---|
| 105 | <module name="SimplifyBooleanExpression"/> |
|---|
| 106 | <module name="SimplifyBooleanReturn"/> |
|---|
| 107 | |
|---|
| 108 | <!-- Checks for class design --> |
|---|
| 109 | <!-- See http://checkstyle.sf.net/config_design.html --> |
|---|
| 110 | <module name="FinalClass"/> |
|---|
| 111 | <module name="InterfaceIsType"/> |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | <!-- Metrics checks. --> |
|---|
| 115 | <module name="ClassFanOutComplexity"/> |
|---|
| 116 | |
|---|
| 117 | <module name="CyclomaticComplexity"> |
|---|
| 118 | <property name="max" value="15"/> |
|---|
| 119 | <property name="severity" value="warning"/> |
|---|
| 120 | </module> |
|---|
| 121 | |
|---|
| 122 | <!-- Miscellaneous other checks. --> |
|---|
| 123 | <!-- See http://checkstyle.sf.net/config_misc.html --> |
|---|
| 124 | <module name="ArrayTypeStyle"/> |
|---|
| 125 | |
|---|
| 126 | <module name="StringLiteralEquality"/> |
|---|
| 127 | <module name="InnerAssignment"/> |
|---|
| 128 | <module name="FallThrough"/> |
|---|
| 129 | <module name="TodoComment"/> |
|---|
| 130 | <module name="UpperEll"/> |
|---|
| 131 | <!-- checkstyle 5.5 needed for these checks |
|---|
| 132 | <module name="GenericWhitespace"/> |
|---|
| 133 | --> |
|---|
| 134 | |
|---|
| 135 | </module> <!-- end TreeWalker --> |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | <!-- checkstyle 5.5 needed for these checks |
|---|
| 139 | <module name="FileTabCharacter"/> |
|---|
| 140 | --> |
|---|
| 141 | |
|---|
| 142 | </module> |
|---|
| 143 | |
|---|
| 144 | |
|---|