blob: 86e163f50ced1dce347f69f09474adb3e3088d40 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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="${checkstyle.severity}" default="warning"/>
<!-- LENGTHS -->
<!-- Desired line length is 120 -->
<module name="LineLength">
<property name="max" value="120"/>
<message key="maxLineLen"
value="Line is longer than {0,number,integer} characters (found {1,number,integer}). Try to keep lines under 120 characters."/>
</module>
<module name="TreeWalker">
<!-- ANNOTATIONS -->
<!-- No trailing empty parenthesis or commas -->
<module name="AnnotationUseStyle">
<property name="elementStyle" value="ignore"/>
</module>
<!-- Ensure @Override is present when {@inheritDoc} Javadoc tag is present -->
<module name="MissingOverride"/>
<!-- Package level annotations belong in package-info.java -->
<module name="PackageAnnotation"/>
<!-- BLOCKS -->
<!-- Block opening brace on same line -->
<module name="LeftCurly">
<property name="option" value="eol"/>
</module>
<!-- Block blocing brace on same line -->
<module name="RightCurly">
<property name="option" value="same"/>
</module>
<!-- Always use braces even if optional -->
<module name="NeedBraces"/>
<!-- CLASS DESIGN -->
<!-- Classes containing only static methods should not have a public constructor -->
<module name="HideUtilityClassConstructor"/>
<!-- CODING -->
<!-- Use Java style array declarations (e.g. String[] names), not C style (e.g. String names[]) -->
<module name="ArrayTypeStyle"/>
<!-- If covariant equals defined, standard equals must also be defined -->
<module name="CovariantEquals"/>
<!-- Switch 'default' case must appear last -->
<module name="DefaultComesLast"/>
<!-- Override equals and hashCode together -->
<module name="EqualsHashCode"/>
<!-- No fall through in switch cases, even the last one -->
<module name="FallThrough">
<property name="checkLastCaseGroup" value="true"/>
</module>
<!-- Do not perform assignments embedded within expressions -->
<module name="InnerAssignment"/>
<!-- Switch statements must have a 'default' case -->
<module name="MissingSwitchDefault"/>
<!-- Do not modify the 'for' loop control variable -->
<module name="ModifiedControlVariable"/>
<!-- Each variable delcaration must be on a separate line -->
<module name="MultipleVariableDeclarations"/>
<!-- Each statement (i.e. code terminated by a semicolon) must be on a separate line -->
<module name="OneStatementPerLine"/>
<!-- Classes must have an explicit package declaration -->
<module name="PackageDeclaration"/>
<!-- Do not test boolean expressions against the values true or false -->
<module name="SimplifyBooleanExpression"/>
<!-- Do not test for boolean conditions and return the values true or false -->
<module name="SimplifyBooleanReturn"/>
<!-- Do not use '==' to compare string against a literal; use 'equals' -->
<module name="StringLiteralEquality"/>
<!-- Use 'L' with long literals -->
<module name="UpperEll"/>
<!-- Do not use prefix increment, decrement in for loop iterator -->
<module name="DescendantToken">
<property name="tokens" value="FOR_ITERATOR"/>
<property name="limitedTokens" value="INC,DEC"/>
<property name="maximumNumber" value="0"/>
</module>
<!-- IMPORTS -->
<!-- No imports statements using '*' notation except static imports -->
<module name="AvoidStarImport">
<property name="allowStaticMemberImports" value="true"/>
</module>
<!-- no static imports except in tests -->
<module name="AvoidStaticImport">
<property name="excludes"
value="com.google.common.base.Preconditions.*,
java.lang.Math.*,
java.lang.Character.*,
java.lang.invoke.MethodHandles.*,
java.lang.invoke.MethodType.*,
java.nio.charset.StandardCharsets.*,
java.util.Locale.*,
java.util.Objects.*,
java.util.concurrent.TimeUnit.*,
org.apache.pinot.common.request.context.FilterContext.Type.*,
org.apache.pinot.common.request.context.predicate.Predicate.Type.*,
org.apache.pinot.common.segment.generation.SegmentGenerationUtils.*,
org.apache.pinot.controller.recommender.realtime.provisioning.MemoryEstimator.*,
org.apache.pinot.controller.recommender.rules.io.params.RecommenderConstants.*,
org.apache.pinot.controller.recommender.rules.io.params.RecommenderConstants.FlagQueryRuleParams.*,
org.apache.pinot.controller.recommender.rules.io.params.RecommenderConstants.InvertedSortedIndexJointRule.*,
org.apache.pinot.controller.recommender.rules.io.params.RecommenderConstants.NoDictionaryOnHeapDictionaryJointRule.*,
org.apache.pinot.controller.recommender.rules.io.params.RecommenderConstants.PartitionRule.*,
org.apache.pinot.controller.recommender.rules.io.params.RecommenderConstants.RulesToExecute.*,
org.apache.pinot.controller.recommender.rules.utils.PredicateParseResult.*,
org.apache.pinot.client.utils.Constants.*,
org.apache.pinot.common.utils.PinotDataType.*,
org.apache.pinot.segment.local.startree.StarTreeBuilderUtils.*,
org.apache.pinot.segment.local.startree.v2.store.StarTreeIndexMapUtils.*,
org.apache.pinot.segment.local.utils.GeometryType.*,
org.apache.pinot.segment.spi.AggregationFunctionType.*,
org.apache.pinot.segment.spi.Constants.*,
org.apache.pinot.segment.spi.V1Constants.Indexes.*,
org.apache.pinot.segment.spi.V1Constants.MetadataKeys.Column.*,
org.apache.pinot.segment.spi.V1Constants.MetadataKeys.Segment.*,
org.apache.pinot.segment.spi.creator.SegmentVersion.*,
org.apache.pinot.segment.spi.index.startree.StarTreeV2Constants.*,
org.apache.pinot.spi.data.FieldSpec.*,
org.apache.pinot.spi.data.FieldSpec.DataType,
org.apache.pinot.spi.data.FieldSpec.DataType.*,
org.apache.pinot.spi.data.FieldSpec.FieldType.*,
org.apache.pinot.spi.plugin.PluginManager.*,
org.apache.pinot.spi.utils.CommonConstants.*,
org.apache.pinot.spi.utils.CommonConstants.Broker.*,
org.apache.pinot.spi.utils.CommonConstants.Broker.Request.*,
org.apache.pinot.spi.utils.CommonConstants.Controller.*,
org.apache.pinot.spi.utils.CommonConstants.Helix.*,
org.apache.pinot.spi.utils.CommonConstants.Segment.*,
org.apache.pinot.spi.utils.CommonConstants.Server.*,
org.apache.pinot.spi.utils.CommonConstants.Server.SegmentCompletionProtocol.*,
org.apache.pinot.spi.utils.EqualityUtils.*,
org.apache.pinot.tools.Quickstart.*"/>
</module>
<!-- Do not import 'sun' packages -->
<module name="IllegalImport"/>
<!-- Do not duplicate import statements -->
<module name="RedundantImport"/>
<!-- Eliminate unused imports -->
<module name="UnusedImports"/>
<!-- JAVADOC COMMENTS -->
<!-- If you have a Javadoc comment, make sure it is properly formed -->
<module name="JavadocStyle">
<property name="checkFirstSentence" value="false"/>
</module>
<!-- NAMING CONVENTIONS -->
<!-- Generic parameters for a class must be uppercase letters (e.g. <T>, <OLD>) -->
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z]+$"/>
</module>
<!-- Constants must be all uppercase letters separated by underscores -->
<module name="ConstantName">
<property name="format" value="^(_?log)|([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)$"/>
</module>
<!-- Local variables must be camel case starting with lowercase letter -->
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<!-- Member variables must be camel case starting with an underscore and lowercase letter -->
<module name="MemberName">
<property name="format" value="^_[a-z][a-zA-Z0-9]*$"/>
</module>
<!-- Method name must be camel case starting with a lowercase letter -->
<module name="MethodName"/>
<!-- Generic parameters for a method must be uppercase letters (e.g. <V>, <NEW>) -->
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z]+$"/>
</module>
<!-- Package name must be all lowercase letters separated by periods -->
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<!-- Parameters must be camel case starting with a lowercase letter -->
<module name="ParameterName"/>
<!-- Static variables must be camel case starting with an underscore and lowercase letter -->
<module name="StaticVariableName">
<property name="format" value="^_[a-z][a-zA-Z0-9]*$"/>
</module>
<!-- Type names must be camel case starting with an uppercase letter -->
<module name="TypeName"/>
<!-- WHITESPACE -->
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad">
<property name="tokens" value="RPAREN,TYPECAST"/>
</module>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<module name="SingleSpaceSeparator"/>
<!-- Allow Checkstyle warnings to be suppressed using trailing comments -->
<module name="SuppressWithNearbyCommentFilter"/>
<!-- Allow Checkstyle warnings to be suppressed using block comments -->
<module name="SuppressionCommentFilter"/>
</module>
<!-- Do not allow tab characters in source files -->
<module name="FileTabCharacter"/>
<!-- Ensure parameter and exception names are present on @param and @throws tags -->
<module name="RegexpSingleline">
<property name="format" value="\*[\s]*@(throws|param)[\s]*$"/>
<property name="message" value="Missing parameter or exception name"/>
</module>
<!-- IDE generated code must be reviewed by developer -->
<module name="RegexpSingleline">
<property name="format" value="\/\/[\s]*TODO[\s]+Auto-generated"/>
<property name="message" value="Replace IDE generated code with real implementation"/>
</module>
<!-- Detect commonly misspelled Javadoc tags -->
<module name="RegexpSingleline">
<property name="format" value="\*[\s]*@(params|throw|returns)[\s]+"/>
<property name="message" value="Correct misspelled Javadoc tag"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="this\._"/>
<property name="message" value="Do not qualify member variables with this"/>
</module>
<!-- Read checker suppressions from a file -->
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf" />
</module>
<module name="RegexpMultiline">
<property name="format" value="\r" />
<property name="message" value="Line contains carriage return" />
</module>
<module name="RegexpMultiline">
<property name="format" value=" \n" />
<property name="message" value="Line has trailing whitespace" />
</module>
<module name="RegexpMultiline">
<property name="format" value="\n\n\Z" />
<property name="message" value="Blank line before end of file" />
</module>
<module name="RegexpMultiline">
<property name="format" value="\n\n\s*\}" />
<property name="message" value="Blank line before closing brace" />
</module>
</module>