|
| 1 | +<?xml version="1.0"?> |
| 2 | +<!DOCTYPE module PUBLIC |
| 3 | + "-//Puppy Crawl//DTD Check Configuration 1.2//EN" |
| 4 | + "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> |
| 5 | + |
| 6 | +<!-- |
| 7 | + Recommended check style configuration for Neptune packages. |
| 8 | +
|
| 9 | + This checkstyle configuration is based on Google Java style guide |
| 10 | + with additional customizations and best practices. |
| 11 | +
|
| 12 | + - Google Java Style |
| 13 | + http://google.github.io/styleguide/javaguide.html |
| 14 | +
|
| 15 | + The rules enforced are very minimal and not very annoying. Please |
| 16 | + modify this if you think a particular rule is not adding much value |
| 17 | + instead of disabling checkstyle. |
| 18 | +
|
| 19 | + Checkstyle is very configurable. Be sure to read the documentation at |
| 20 | + http://checkstyle.sf.net (or in your downloaded distribution). |
| 21 | +--> |
| 22 | +<module name="Checker"> |
| 23 | + |
| 24 | + <property name="charset" value="UTF-8"/> |
| 25 | + |
| 26 | + <!-- Checks whether files end with a new line. --> |
| 27 | + <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> |
| 28 | + <module name="NewlineAtEndOfFile"/> |
| 29 | + |
| 30 | + <!-- Checks for Size Violations. --> |
| 31 | + <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 32 | + <module name="FileLength"/> |
| 33 | + |
| 34 | + <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 35 | + <module name="FileTabCharacter"/> |
| 36 | + |
| 37 | + <module name="RegexpSingleline"> |
| 38 | + <property name="format" value="\s+$"/> |
| 39 | + <property name="message" value="Line has trailing spaces."/> |
| 40 | + </module> |
| 41 | + |
| 42 | + <!-- Supressions file --> |
| 43 | + <module name="SuppressionFilter"> |
| 44 | + <property name="file" value="./checkstyle/suppressions.xml"/> |
| 45 | + </module> |
| 46 | + |
| 47 | + <module name="SuppressWarningsFilter"/> |
| 48 | + |
| 49 | + <module name="TreeWalker"> |
| 50 | + |
| 51 | + <!-- Suppress checkstyle using @SuppressWarnings --> |
| 52 | + <module name="SuppressWarningsHolder"/> |
| 53 | + |
| 54 | + <!-- Suppress checkstyle using // CHECKSTYLE.OFF --> |
| 55 | + <module name="SuppressionCommentFilter"> |
| 56 | + <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/> |
| 57 | + <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/> |
| 58 | + <property name="checkFormat" value="$1"/> |
| 59 | + </module> |
| 60 | + |
| 61 | + <!-- To configure the check so that it matches default IntelliJ IDEA formatter configuration (tested on v14): |
| 62 | +
|
| 63 | + - group of static imports is on the bottom |
| 64 | + - groups of non-static imports: all imports except of "javax" and "java", then "javax" and "java" |
| 65 | + - imports will be sorted in the groups |
| 66 | + - groups are separated by, at least, one blank line |
| 67 | +
|
| 68 | + Note: "separated" option is disabled because IDEA default has blank line between "java" and static imports, |
| 69 | + and no blank line between "javax" and "java" |
| 70 | + --> |
| 71 | + <module name="CustomImportOrder"> |
| 72 | + <property name="customImportOrderRules" |
| 73 | + value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/> |
| 74 | + <property name="specialImportsRegExp" value="^javax\."/> |
| 75 | + <property name="standardPackageRegExp" value="^java\."/> |
| 76 | + <property name="sortImportsInGroupAlphabetically" value="true"/> |
| 77 | + <property name="separateLineBetweenGroups" value="false"/> |
| 78 | + </module> |
| 79 | + |
| 80 | + |
| 81 | + <!-- Checks for Size Violations. --> |
| 82 | + <!-- See http://checkstyle.sf.net/config_sizes.html --> |
| 83 | + <module name="LineLength"> |
| 84 | + <property name="max" value="120"/> |
| 85 | + <property name="ignorePattern" value="(^ *\** *)|(^import )"/> |
| 86 | + </module> |
| 87 | + <!-- <module name="MethodLength"/>--> |
| 88 | + <!-- <module name="ParameterNumber"/>--> |
| 89 | + |
| 90 | + <module name="NonEmptyAtclauseDescription"/> |
| 91 | + |
| 92 | + <!-- Checks for Naming Conventions. --> |
| 93 | + <!-- See http://checkstyle.sf.net/config_naming.html --> |
| 94 | + <module name="ConstantName"/> |
| 95 | + <module name="LocalFinalVariableName"/> |
| 96 | + <module name="LocalVariableName"/> |
| 97 | + <module name="MemberName"/> |
| 98 | + <module name="MethodName"/> |
| 99 | + <module name="PackageName"/> |
| 100 | + <module name="ParameterName"/> |
| 101 | + <module name="StaticVariableName"/> |
| 102 | + <module name="TypeName"/> |
| 103 | + |
| 104 | + <!-- Checks for imports --> |
| 105 | + <!-- See http://checkstyle.sf.net/config_import.html --> |
| 106 | + <module name="AvoidStarImport"/> |
| 107 | + <module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
| 108 | + <module name="RedundantImport"/> |
| 109 | + <module name="UnusedImports"/> |
| 110 | + |
| 111 | + <!-- Modifier Checks --> |
| 112 | + <!-- See http://checkstyle.sf.net/config_modifiers.html --> |
| 113 | + <module name="ModifierOrder"/> |
| 114 | + <module name="RedundantModifier"/> |
| 115 | + |
| 116 | + <!-- Checks for blocks. You know, those {}'s --> |
| 117 | + <!-- See http://checkstyle.sf.net/config_blocks.html --> |
| 118 | + <module name="EmptyBlock"/> |
| 119 | + <module name="LeftCurly"/> |
| 120 | + <module name="NeedBraces"/> |
| 121 | + <module name="RightCurly"/> |
| 122 | + |
| 123 | + <!-- Checks for whitespace --> |
| 124 | + <module name="MethodParamPad"/> |
| 125 | + |
| 126 | + <!-- Checks for common coding problems --> |
| 127 | + <module name="HiddenField"> |
| 128 | + <property name="tokens" value="VARIABLE_DEF"/> |
| 129 | + </module> |
| 130 | + |
| 131 | + <!-- Checks for class design --> |
| 132 | + <!-- See http://checkstyle.sf.net/config_design.html --> |
| 133 | + <module name="FinalClass"/> |
| 134 | + <module name="VisibilityModifier"/> |
| 135 | + |
| 136 | + <!-- Miscellaneous other checks --> |
| 137 | + <module name="ArrayTypeStyle"/> |
| 138 | + <module name="UpperEll"/> |
| 139 | + <module name="FinalParameters"/> |
| 140 | + <module name="FinalLocalVariable"/> |
| 141 | + <module name="CommentsIndentation"/> |
| 142 | + <module name="WhitespaceAround"/> |
| 143 | + <module name="TodoComment"> |
| 144 | + <property name="severity" value="warning"/> |
| 145 | + <property name="format" value="(TODO)|(FIXME)"/> |
| 146 | + </module> |
| 147 | + |
| 148 | + <module name="EqualsAvoidNullCheck"/> |
| 149 | + </module> |
| 150 | +</module> |
0 commit comments