| <?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"> |
| |
| <!-- |
| Checkstyle configuration for Apache Iggy. |
| |
| This configuration focuses on semantic code quality checks. |
| Formatting checks are handled by Spotless (Palantir Java Format). |
| --> |
| |
| <module name="Checker"> |
| <property name="fileExtensions" value="java, properties, xml"/> |
| |
| <module name="SuppressWarningsFilter"/> |
| |
| <!-- Suppressions file for skipping specific checks --> |
| <module name="SuppressionFilter"> |
| <property name="file" value="${config_loc}/suppressions.xml"/> |
| <property name="optional" value="false"/> |
| </module> |
| |
| <!-- Checks that property files contain the same keys. --> |
| <module name="Translation"/> |
| |
| <!-- Checks for Size Violations. --> |
| <module name="FileLength"/> |
| |
| <!-- Enforce logger variable name to be 'log' --> |
| <module name="RegexpSingleline"> |
| <property name="format" value="private\s+(static\s+)?(final\s+)?Logger\s+(?!log\s*[;=])"/> |
| <property name="message" value="Logger variable must be named 'log'"/> |
| </module> |
| |
| <module name="TreeWalker"> |
| <module name="SuppressWarningsHolder"/> |
| <module name="SuppressionCommentFilter"/> |
| <module name="SuppressWithNearbyCommentFilter"/> |
| |
| <!-- Checks for Javadoc comments. --> |
| <!-- |
| <module name="JavadocMethod"> |
| <property name="accessModifiers" value="public"/> |
| </module> |
| <module name="JavadocType"> |
| <property name="scope" value="public"/> |
| </module> |
| <module name="JavadocStyle"/> |
| <module name="MissingJavadocType"> |
| <property name="scope" value="public"/> |
| </module> |
| <module name="MissingJavadocMethod"> |
| <property name="scope" value="public"/> |
| </module> |
| --> |
| |
| <!-- Checks for Naming Conventions. --> |
| <module name="ConstantName"> |
| <property name="format" value="^log$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/> |
| </module> |
| <module name="LocalFinalVariableName"/> |
| <module name="LocalVariableName"> |
| <property name="format" value="^(_?[a-z][a-zA-Z0-9]*|_)$"/> |
| </module> |
| <module name="MemberName"/> |
| <module name="MethodName"/> |
| <module name="PackageName"/> |
| <module name="ParameterName"/> |
| <module name="StaticVariableName"/> |
| <module name="TypeName"/> |
| |
| <!-- Checks for imports --> |
| <module name="IllegalImport"/> |
| |
| <!-- Checks for Size Violations. --> |
| <module name="MethodLength"/> |
| <module name="ParameterNumber"> |
| <property name="ignoreOverriddenMethods" value="true"/> |
| </module> |
| |
| <!-- Complexity checks --> |
| <module name="CyclomaticComplexity"> |
| <property name="max" value="10"/> |
| </module> |
| <module name="NPathComplexity"> |
| <property name="max" value="200"/> |
| </module> |
| |
| <!-- Modifier Checks --> |
| <module name="ModifierOrder"/> |
| |
| <!-- Checks for blocks. --> |
| <module name="AvoidNestedBlocks"/> |
| <module name="EmptyBlock"/> |
| <module name="NeedBraces"/> |
| |
| <!-- Checks for common coding problems --> |
| <module name="AvoidDoubleBraceInitialization"/> |
| <module name="CovariantEquals"/> |
| <module name="DefaultComesLast"/> |
| <module name="EmptyStatement"/> |
| <module name="EqualsAvoidNull"/> |
| <module name="EqualsHashCode"/> |
| <module name="FallThrough"/> |
| <module name="HiddenField"> |
| <property name="ignoreConstructorParameter" value="true"/> |
| <property name="ignoreSetter" value="true"/> |
| <property name="setterCanReturnItsClass" value="true"/> |
| <property name="tokens" value="VARIABLE_DEF"/> |
| </module> |
| <module name="IllegalCatch"> |
| <property name="illegalClassNames" value="Exception, Throwable"/> |
| </module> |
| <module name="IllegalInstantiation"/> |
| <module name="IllegalThrows"> |
| <property name="illegalClassNames" value="Exception, Throwable"/> |
| </module> |
| <module name="MissingOverride"/> |
| <module name="MissingSwitchDefault"/> |
| <module name="MultipleVariableDeclarations"/> |
| <module name="NoClone"/> |
| <module name="NoFinalizer"/> |
| <module name="OneStatementPerLine"/> |
| <module name="SimplifyBooleanExpression"/> |
| <module name="SimplifyBooleanReturn"/> |
| <module name="StringLiteralEquality"/> |
| <module name="UnnecessarySemicolonInEnumeration"/> |
| |
| <!-- Checks for class design --> |
| <module name="FinalClass"/> |
| <module name="HideUtilityClassConstructor"/> |
| <module name="InnerTypeLast"/> |
| <module name="InterfaceIsType"/> |
| <module name="VisibilityModifier"/> |
| |
| <!-- Code organization --> |
| <module name="DeclarationOrder"/> |
| <module name="OuterTypeFilename"/> |
| <module name="OverloadMethodsDeclarationOrder"/> |
| <module name="PackageDeclaration"/> |
| |
| <!-- Miscellaneous other checks. --> |
| <module name="ArrayTypeStyle"/> |
| <module name="UpperEll"/> |
| |
| </module> |
| |
| </module> |