|
| 1 | +<!-- |
| 2 | + ~ Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + ~ contributor license agreements. See the NOTICE file distributed with |
| 4 | + ~ this work for additional information regarding copyright ownership. |
| 5 | + ~ The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + ~ (the "License"); you may not use this file except in compliance with |
| 7 | + ~ the License. You may obtain a copy of the License at |
| 8 | + ~ |
| 9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + ~ |
| 11 | + ~ Unless required by applicable law or agreed to in writing, software |
| 12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + ~ See the License for the specific language governing permissions and |
| 15 | + ~ limitations under the License. |
| 16 | + --> |
| 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 | + |
| 22 | +<!-- |
| 23 | +
|
| 24 | + Checkstyle configuration based on the Google coding conventions from: |
| 25 | +
|
| 26 | + - Google Java Style |
| 27 | + https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html |
| 28 | +
|
| 29 | + with Spark-specific changes from: |
| 30 | +
|
| 31 | + https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide |
| 32 | +
|
| 33 | + Checkstyle is very configurable. Be sure to read the documentation at |
| 34 | + http://checkstyle.sf.net (or in your downloaded distribution). |
| 35 | +
|
| 36 | + Most Checks are configurable, be sure to consult the documentation. |
| 37 | +
|
| 38 | + To completely disable a check, just comment it out or delete it from the file. |
| 39 | +
|
| 40 | + Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov. |
| 41 | +
|
| 42 | + --> |
| 43 | + |
| 44 | +<module name = "Checker"> |
| 45 | + <property name="charset" value="UTF-8"/> |
| 46 | + |
| 47 | + <property name="severity" value="error"/> |
| 48 | + |
| 49 | + <property name="fileExtensions" value="java, properties, xml"/> |
| 50 | + |
| 51 | + <module name="SuppressionFilter"> |
| 52 | + <property name="file" value="checkstyle-suppressions.xml"/> |
| 53 | + </module> |
| 54 | + |
| 55 | + <!-- Checks for whitespace --> |
| 56 | + <!-- See http://checkstyle.sf.net/config_whitespace.html --> |
| 57 | + <module name="FileTabCharacter"> |
| 58 | + <property name="eachLine" value="true"/> |
| 59 | + </module> |
| 60 | + |
| 61 | + <module name="TreeWalker"> |
| 62 | + <module name="OuterTypeFilename"/> |
| 63 | + <module name="IllegalTokenText"> |
| 64 | + <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/> |
| 65 | + <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)"/> |
| 66 | + <property name="message" value="Avoid using corresponding octal or Unicode escape."/> |
| 67 | + </module> |
| 68 | + <module name="AvoidEscapedUnicodeCharacters"> |
| 69 | + <property name="allowEscapesForControlCharacters" value="true"/> |
| 70 | + <property name="allowByTailComment" value="true"/> |
| 71 | + <property name="allowNonPrintableEscapes" value="true"/> |
| 72 | + </module> |
| 73 | + <!-- TODO: 11/09/15 disabled - the lengths are currently > 100 in many places --> |
| 74 | + <!-- |
| 75 | + <module name="LineLength"> |
| 76 | + <property name="max" value="100"/> |
| 77 | + <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/> |
| 78 | + </module> |
| 79 | + --> |
| 80 | + <module name="NoLineWrap"/> |
| 81 | + <module name="EmptyBlock"> |
| 82 | + <property name="option" value="TEXT"/> |
| 83 | + <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/> |
| 84 | + </module> |
| 85 | + <module name="NeedBraces"> |
| 86 | + <property name="allowSingleLineStatement" value="true"/> |
| 87 | + </module> |
| 88 | + <module name="OneStatementPerLine"/> |
| 89 | + <module name="ArrayTypeStyle"/> |
| 90 | + <module name="FallThrough"/> |
| 91 | + <module name="UpperEll"/> |
| 92 | + <module name="ModifierOrder"/> |
| 93 | + <module name="SeparatorWrap"> |
| 94 | + <property name="tokens" value="DOT"/> |
| 95 | + <property name="option" value="nl"/> |
| 96 | + </module> |
| 97 | + <module name="SeparatorWrap"> |
| 98 | + <property name="tokens" value="COMMA"/> |
| 99 | + <property name="option" value="EOL"/> |
| 100 | + </module> |
| 101 | + <module name="PackageName"> |
| 102 | + <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> |
| 103 | + <message key="name.invalidPattern" |
| 104 | + value="Package name ''{0}'' must match pattern ''{1}''."/> |
| 105 | + </module> |
| 106 | + <module name="ClassTypeParameterName"> |
| 107 | + <property name="format" value="([A-Z][a-zA-Z0-9]*$)"/> |
| 108 | + <message key="name.invalidPattern" |
| 109 | + value="Class type name ''{0}'' must match pattern ''{1}''."/> |
| 110 | + </module> |
| 111 | + <module name="MethodTypeParameterName"> |
| 112 | + <property name="format" value="([A-Z][a-zA-Z0-9]*)"/> |
| 113 | + <message key="name.invalidPattern" |
| 114 | + value="Method type name ''{0}'' must match pattern ''{1}''."/> |
| 115 | + </module> |
| 116 | + <module name="NoFinalizer"/> |
| 117 | + <module name="GenericWhitespace"> |
| 118 | + <message key="ws.followed" |
| 119 | + value="GenericWhitespace ''{0}'' is followed by whitespace."/> |
| 120 | + <message key="ws.preceded" |
| 121 | + value="GenericWhitespace ''{0}'' is preceded with whitespace."/> |
| 122 | + <message key="ws.illegalFollow" |
| 123 | + value="GenericWhitespace ''{0}'' should followed by whitespace."/> |
| 124 | + <message key="ws.notPreceded" |
| 125 | + value="GenericWhitespace ''{0}'' is not preceded with whitespace."/> |
| 126 | + </module> |
| 127 | + <!-- TODO: 11/09/15 disabled - indentation is currently inconsistent --> |
| 128 | + <!-- |
| 129 | + <module name="Indentation"> |
| 130 | + <property name="basicOffset" value="4"/> |
| 131 | + <property name="braceAdjustment" value="0"/> |
| 132 | + <property name="caseIndent" value="4"/> |
| 133 | + <property name="throwsIndent" value="4"/> |
| 134 | + <property name="lineWrappingIndentation" value="4"/> |
| 135 | + <property name="arrayInitIndent" value="4"/> |
| 136 | + </module> |
| 137 | + --> |
| 138 | + <!-- TODO: 11/09/15 disabled - order is currently wrong in many places --> |
| 139 | + <!-- |
| 140 | + <module name="ImportOrder"> |
| 141 | + <property name="separated" value="true"/> |
| 142 | + <property name="ordered" value="true"/> |
| 143 | + <property name="groups" value="/^javax?\./,scala,*,org.apache.spark"/> |
| 144 | + </module> |
| 145 | + --> |
| 146 | + <module name="MethodParamPad"/> |
| 147 | + <module name="AnnotationLocation"> |
| 148 | + <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/> |
| 149 | + </module> |
| 150 | + <module name="AnnotationLocation"> |
| 151 | + <property name="tokens" value="VARIABLE_DEF"/> |
| 152 | + <property name="allowSamelineMultipleAnnotations" value="true"/> |
| 153 | + </module> |
| 154 | + <module name="MethodName"> |
| 155 | + <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/> |
| 156 | + <message key="name.invalidPattern" |
| 157 | + value="Method name ''{0}'' must match pattern ''{1}''."/> |
| 158 | + </module> |
| 159 | + <module name="EmptyCatchBlock"> |
| 160 | + <property name="exceptionVariableName" value="expected"/> |
| 161 | + </module> |
| 162 | + <module name="CommentsIndentation"/> |
| 163 | + </module> |
| 164 | +</module> |
0 commit comments