build-tools.checkstyle.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!-- Codehaus Cargo, copyright 2004-2011 Vincent Massol, 2012-2024 Ali Tokmen. Licensed 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 "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd"> <!-- Checkstyle properties for Codehaus Cargo --> <module name="Checker"> <!-- ====================================================================================== Checks that do not require a TreeWalker (sorted alphabetically) ====================================================================================== --> <module name="FileLength"> <property name="max" value="4242"/> </module> <module name="FileTabCharacter"/> <!-- For some reason, this check goes crazy like: Missing a header - not enough lines in file <module name="Header"> <property name="headerFile" value="${checkstyle.header.file}"/> <property name="multiLines" value="4,5,6"/> </module> --> <module name="LineLength"> <property name="ignorePattern" value="(@version|@see|^import)"/> <property name="max" value="100"/> </module> <!-- Do not allow trailing spaces --> <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> <!-- Avoid finalizers (this will not find violations that contain linebreaks) --> <module name="RegexpMultiline"> <property name="format" value="((public)|(protected))\s+void\s+finalize\(\s*\)"/> <property name="message" value="Avoid finalizers"/> </module> <!-- No direct printing to System.out or System.err --> <module name="RegexpMultiline"> <property name="format" value="System\.(out|err)\."/> <property name="message" value="Don't write directly to System.out our System.err"/> </module> <!-- Require the use of generics --> <module name="RegexpMultiline"> <property name="format" value="(((public|private|protected|final|\s)\s(abstract\s)?(static\s)?(final\s)?)|\(|(,\s*))(Collection|Hashtable|Iterator|List|Map|Map\.Entry|Set)\s"/> <property name="message" value="Use generics in attributes and parameters when available"/> </module> <module name="RegexpMultiline"> <property name="format" value="new\s\w*(Hashtable|List|Map)\s*\("/> <property name="message" value="Use generics in variables when available"/> </module> <!-- No printStackTrace --> <module name="RegexpMultiline"> <property name="format" value="\.printStackTrace\(\s*\)"/> <property name="message" value="Don't printStackTrace, use a logger instead"/> </module> <!-- No @author tags --> <module name="RegexpMultiline"> <property name="format" value="@author"/> <property name="message" value="No @author tag allowed"/> </module> <!-- Other modules --> <module name="SuppressionFilter"> <property name="file" value="${checkstyle.suppressions.file}"/> </module> <module name="Translation"/> <!-- ====================================================================================== Checks that require a TreeWalker (sorted alphabetically) ====================================================================================== --> <module name="TreeWalker"> <!-- Note: for some checks we have defined a warning severity instead of the default error severity. This is because we'd like to make the build fail on error for these checks but there are errors to fix first --> <module name="AbstractClassName"> <property name="ignoreModifier" value="true"/> </module> <module name="AnonInnerLength"> <property name="max" value="60"/> </module> <!--module name="ArrayTrailingComma"/--> <module name="ArrayTypeStyle"/> <!--module name="AvoidInlineConditionals"/--> <module name="AvoidNestedBlocks"/> <module name="AvoidStarImport"/> <module name="AvoidStaticImport"/> <module name="BooleanExpressionComplexity"> <property name="max" value="7"/> </module> <!--module name="ClassDataAbstractionCoupling"/--> <module name="ClassFanOutComplexity"> <property name="severity" value="warning"/> </module> <module name="ConstantName"/> <module name="CovariantEquals"/> <module name="CyclomaticComplexity"> <property name="severity" value="warning"/> </module> <module name="DeclarationOrder"/> <module name="DefaultComesLast"/> <module name="DescendantToken"/> <!--module name="DesignForExtension"/--> <module name="EmptyBlock"> <property name="tokens" value="LITERAL_CATCH"/> <property name="option" value="text"/> </module> <module name="EmptyForInitializerPad"/> <module name="EmptyForIteratorPad"/> <module name="EmptyStatement"/> <module name="EqualsHashCode"/> <module name="ExecutableStatementCount"> <property name="severity" value="warning"/> </module> <!--module name="ExplicitInitialization"/--> <module name="FallThrough"/> <module name="FinalClass"/> <!--module name="FinalLocalVariable"/--> <!--module name="FinalParameters"/--> <!--module name="HiddenField"/--> <module name="HideUtilityClassConstructor"/> <!--module name="IllegalCatch"/--> <module name="IllegalImport"/> <module name="IllegalInstantiation"> <property name="classes" value="java.lang.Boolean"/> </module> <!--module name="IllegalThrows"/--> <!--module name="IllegalToken"/--> <module name="IllegalTokenText"/> <module name="IllegalType"> <property name="severity" value="warning"/> </module> <!--module name="ImportControl"/--> <!--module name="ImportOrder"/--> <module name="Indentation"/> <module name="InnerAssignment"/> <!--module name="InterfaceIsType"/--> <module name="JavadocMethod"/> <module name="JavadocStyle"> <property name="severity" value="warning"/> <property name="checkFirstSentence" value="false"/> </module> <module name="JavadocType"> <property name="allowMissingParamTags" value="true"/> <property name="allowUnknownTags" value="true"/> </module> <module name="JavadocVariable"/> <!--module name="JavaNCSS"/--> <!--module name="JUnitTestCase"/--> <module name="LeftCurly"> <property name="option" value="nl"/> </module> <module name="LocalFinalVariableName"/> <module name="LocalVariableName"/> <!--module name="MagicNumber"/--> <module name="MemberName"/> <module name="MethodLength"> <property name="max" value="444"/> </module> <!-- Allow for UI methods generated by idea --> <module name="MethodName"> <property name="format" value="^[a-z][a-zA-Z0-9]*$|^\$\$\$setupUI\$\$\$$"/> </module> <module name="MethodParamPad"/> <!--module name="MissingCtor"/--> <module name="MissingOverride"> <property name="javaFiveCompatibility" value="false"/> </module> <module name="MissingSwitchDefault"/> <!--module name="ModifiedControlVariable"/--> <module name="ModifierOrder"/> <!--module name="MultipleStringLiterals"/--> <module name="MultipleVariableDeclarations"/> <module name="MutableException"/> <module name="NeedBraces"/> <module name="NestedIfDepth"> <property name="max" value="4"/> </module> <module name="NestedTryDepth"> <property name="max" value="2"/> </module> <module name="NoWhitespaceAfter"/> <module name="NoWhitespaceBefore"/> <module name="NPathComplexity"> <property name="severity" value="warning"/> </module> <module name="OperatorWrap"/> <module name="PackageDeclaration"/> <module name="PackageName"/> <module name="ParameterAssignment"/> <module name="ParameterName"/> <module name="ParameterNumber"> <property name="max" value="11"/> </module> <module name="ParenPad"/> <module name="RedundantImport"/> <!--module name="RedundantThrows"> <property name="allowUnchecked" value="true"/> </module--> <module name="RedundantModifier"> <property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/> </module> <module name="ReturnCount"> <property name="max" value="7"/> <property name="maxForVoid" value="7"/> <property name="format" value="^$"/> </module> <module name="RightCurly"> <property name="option" value="alone"/> </module> <module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanReturn"/> <module name="StaticVariableName"/> <module name="StringLiteralEquality"/> <module name="SuperClone"/> <module name="SuperFinalize"/> <!--module name="ThrowsCount"/--> <module name="TodoComment"> <property name="severity" value="warning"/> </module> <module name="TrailingComment"/> <module name="TypeName"/> <module name="TypecastParenPad"/> <module name="UncommentedMain"> <property name="excludedClasses" value="Main$|ResinRun$|Uberjar$"/> </module> <module name="UnnecessaryParentheses"/> <module name="UnusedImports"/> <module name="UpperEll"/> <module name="VisibilityModifier"> <property name="protectedAllowed" value="true"/> <property name="publicMemberPattern" value="^[a-z][a-zA-Z0-9]*$"/> </module> <module name="WhitespaceAfter"/> <module name="WhitespaceAround"/> </module> </module>