| <?xml version="1.0"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| <!DOCTYPE module PUBLIC |
| "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" |
| "https://checkstyle.org/dtds/configuration_1_3.dtd"> |
| |
| <module name="Checker"> |
| |
| <property name="severity" value="error" /> |
| |
| <property name="fileExtensions" value="java, xml, properties, gradle, sh" /> |
| |
| <!-- Excludes all 'module-info.java' files. --> |
| <!-- See https://checkstyle.org/config_filefilters.html --> |
| <module name="BeforeExecutionExclusionFileFilter"> |
| <property name="fileNamePattern" value="module\-info\.java$" /> |
| </module> |
| |
| <!-- https://checkstyle.org/config_filters.html#SuppressionFilter --> |
| <module name="SuppressionFilter"> |
| <property name="file" value="${config_loc}/suppressions.xml" /> |
| <property name="optional" value="false" /> |
| </module> |
| |
| <!-- Checks that a 'package-info.java' file exists for each package. --> |
| <!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage --> |
| <module name="JavadocPackage" /> |
| |
| <!-- Checks for the presence of Apache license headers. --> |
| <!-- See https://checkstyle.org/config_header.html --> |
| <module name="RegexpHeader"> |
| <property name="fileExtensions" value="java" /> |
| <property name="header" value="^/\*\n \* Licensed to the Apache Software Foundation" /> |
| </module> |
| <!-- TODO: Add checks for other file types (xml, properties, gradle, sh) --> |
| |
| <!-- Checks whether files end with a new line. --> |
| <!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile --> |
| <module name="NewlineAtEndOfFile" /> |
| |
| <!-- Checks that property files contain the same keys. --> |
| <!-- See https://checkstyle.org/config_misc.html#Translation --> |
| <module name="Translation" /> |
| |
| <!-- Checks for size violations. --> |
| <!-- See https://checkstyle.org/config_sizes.html --> |
| <module name="FileLength"> |
| <property name="fileExtensions" value="java, xml, properties, gradle, sh" /> |
| <property name="max" value="3500" /> |
| </module> |
| <module name="LineLength"> |
| <property name="fileExtensions" value="java, xml, properties, gradle, sh" /> |
| <property name="ignorePattern" value="\b(package|import|Pattern\.compile|https?:://|CHECKSTYLE IGNORE)\b"/> |
| <property name="max" value="160" /> |
| </module> |
| |
| <!-- Checks for whitespace. --> |
| <!-- See https://checkstyle.org/config_whitespace.html --> |
| <module name="FileTabCharacter" /> |
| |
| <!-- Miscellaneous other checks. --> |
| <!-- See https://checkstyle.org/config_misc.html --> |
| <module name="RegexpSingleline"> |
| <property name="format" value="\s+$" /> |
| <property name="minimum" value="0" /> |
| <property name="maximum" value="0" /> |
| <property name="message" value="Line has trailing spaces." /> |
| </module> |
| |
| <module name="TreeWalker"> |
| |
| <property name="tabWidth" value="4"/> |
| |
| <!-- Enables in-code single-line suppressions with a comment. --> |
| <!-- See https://checkstyle.org/config_filters.html#SuppressWithNearbyCommentFilter --> |
| <module name="SuppressWithNearbyCommentFilter"> |
| <property name="commentFormat" value="CHECKSTYLE\s+IGNORE:\s+\S+" /> |
| <property name="influenceFormat" value="-1" /> |
| </module> |
| <module name="SuppressWithNearbyCommentFilter"> |
| <property name="commentFormat" value="CHECKSTYLE\s+IGNORE:\s+\S+" /> |
| <property name="influenceFormat" value="+1" /> |
| </module> |
| |
| <!-- Checks for JavaDoc comments. --> |
| <!-- See https://checkstyle.org/config_javadoc.html --> |
| <module name="InvalidJavadocPosition" /> |
| <module name="JavadocMethod" /> |
| <module name="JavadocType" /> |
| <module name="JavadocVariable" /> |
| <module name="JavadocStyle"> |
| <property name="checkFirstSentence" value="false" /> |
| </module> |
| <module name="MissingJavadocMethod" /> |
| |
| <!-- Checks for naming conventions. --> |
| <!-- See https://checkstyle.org/config_naming.html --> |
| <!-- <module name="ConstantName" />--> |
| <module name="LocalFinalVariableName" /> |
| <module name="LocalVariableName" /> |
| <module name="MemberName" /> |
| <module name="MethodName" /> |
| <module name="PackageName" /> |
| <module name="ParameterName" /> |
| <module name="StaticVariableName" /> |
| <module name="TypeName" /> |
| |
| <!-- Checks for imports. --> |
| <!-- See https://checkstyle.org/config_imports.html --> |
| <module name="AvoidStarImport" /> |
| <module name="IllegalImport" /> |
| <module name="RedundantImport" /> |
| <module name="UnusedImports" /> |
| |
| <!-- Checks for size violations. --> |
| <!-- See https://checkstyle.org/config_sizes.html --> |
| <module name="MethodLength"> |
| <property name="max" value="120" /> |
| </module> |
| <module name="ParameterNumber"> |
| <property name="max" value="8" /> |
| <property name="ignoreOverriddenMethods" value="true" /> |
| </module> |
| |
| <!-- Checks for whitespace. --> |
| <!-- See https://checkstyle.org/config_whitespace.html --> |
| <module name="EmptyForIteratorPad" /> |
| <module name="GenericWhitespace" /> |
| <module name="MethodParamPad" /> |
| <module name="NoWhitespaceAfter" /> |
| <module name="NoWhitespaceBefore" /> |
| <!-- <module name="OperatorWrap" />--> |
| <module name="ParenPad" /> |
| <module name="TypecastParenPad" /> |
| <module name="WhitespaceAfter" /> |
| <module name="WhitespaceAround" /> |
| |
| <!-- Modifier checks. --> |
| <!-- See https://checkstyle.org/config_modifier.html --> |
| <module name="ModifierOrder" /> |
| <module name="RedundantModifier" /> |
| |
| <!-- Checks for blocks. You know, those {}'s. --> |
| <!-- See https://checkstyle.org/config_blocks.html --> |
| <module name="AvoidNestedBlocks" /> |
| <module name="EmptyBlock" /> |
| <module name="LeftCurly"> |
| <property name="option" value="eol" /> |
| <property name="tokens" value="LAMBDA" /> |
| </module> |
| <module name="LeftCurly"> |
| <property name="option" value="nl" /> |
| <property name="ignoreEnums" value="false" /> |
| <property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, |
| INTERFACE_DEF, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT, |
| LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, |
| LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, |
| METHOD_DEF, OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF" /> |
| </module> |
| <module name="NeedBraces" /> |
| <module name="RightCurly"> |
| <property name="option" value="alone" /> |
| </module> |
| |
| <!-- Checks for common coding problems. --> |
| <!-- See https://checkstyle.org/config_coding.html --> |
| <module name="EmptyStatement" /> |
| <module name="EqualsHashCode" /> |
| <module name="HiddenField"> |
| <property name="ignoreConstructorParameter" value="true" /> |
| <property name="ignoreSetter" value="true" /> |
| </module> |
| <module name="IllegalInstantiation" /> |
| <module name="InnerAssignment" /> |
| <module name="MagicNumber"> |
| <property name="ignoreNumbers" value="-2147483648, -32768, -128, -1, 0, 1, 2, 3, 4, 8, 16, 32, |
| 42, 64, 127, 128, 255, 256, 512, 1000, 1024, 2048, 4096, 8192, |
| 16384, 32767, 32768, 65535, 65536, 1000000, 1048576, 1000000000, |
| 1073741824, 2147483647, 2147483648, 4294967295" /> |
| </module> |
| <module name="MissingSwitchDefault" /> |
| <module name="MultipleVariableDeclarations" /> |
| <module name="SimplifyBooleanExpression" /> |
| <module name="SimplifyBooleanReturn" /> |
| |
| <!-- Checks for class design. --> |
| <!-- See https://checkstyle.org/config_design.html --> |
| <module name="DesignForExtension" /> |
| <!-- <module name="FinalClass" />--> |
| <module name="HideUtilityClassConstructor" /> |
| <module name="InterfaceIsType" /> |
| <!-- Miscellaneous other checks. --> |
| <!-- See https://checkstyle.org/config_misc.html --> |
| <module name="ArrayTypeStyle" /> |
| <module name="TodoComment" /> |
| <module name="UpperEll" /> |
| |
| </module> |
| |
| </module> |