Currently Checkstyle returns 222 occurrences of the message "Utility classes should not have a public or default constructor." This is due to https://checkstyle.sourceforge.io/config_design.html#HideUtilityClassConstructor I don't think we need to follow the "prevents calls from subclass" suggestion there. I rather suggest to comment out the related class in checkstyle.xml: ie <!-- <module name="HideUtilityClassConstructor"/> --> Then should remain only 280 errors and hopefully most will be easy to fix. At least they will be easier to spot... Note: I'm working on something else, so I will change tasks.checkstyleMain.maxErrors from 502 to 280 later... Thanks: Suraj and Aditya for confirmation
154 lines
5.9 KiB
XML
154 lines
5.9 KiB
XML
<?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">
|
|
<!-- This configuration corresponds to the OFBiz coding conventions
|
|
which are simply “Sun Coding Standards” + “150 characters line length” -->
|
|
<module name="Checker">
|
|
<module name="BeforeExecutionExclusionFileFilter">
|
|
<property name="fileNamePattern" value="module\-info\.java$"/>
|
|
</module>
|
|
<property name="fileExtensions" value="java, properties, xml"/>
|
|
|
|
<!-- General file conventions -->
|
|
<module name="NewlineAtEndOfFile">
|
|
<property name="lineSeparator" value="lf" />
|
|
</module>
|
|
<module name="FileTabCharacter"/>
|
|
<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="LineLength">
|
|
<property name="max" value="150"/>
|
|
</module>
|
|
|
|
<module name="TreeWalker">
|
|
<!-- Naming conventions -->
|
|
<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 -->
|
|
<module name="AvoidStarImport"/>
|
|
<module name="IllegalImport"/>
|
|
<module name="RedundantImport"/>
|
|
<module name="UnusedImports">
|
|
<property name="processJavadoc" value="false"/>
|
|
</module>
|
|
|
|
<!-- Checks for Size Violations -->
|
|
<module name="MethodLength">
|
|
<property name="tokens" value="METHOD_DEF"/>
|
|
<property name="max" value="500"/>
|
|
<property name="countEmpty" value="false"/>
|
|
</module>
|
|
<module name="ParameterNumber">
|
|
<property name="max" value="10"/>
|
|
<property name="tokens" value="METHOD_DEF"/>
|
|
<property name="ignoreOverriddenMethods" value="true"/>
|
|
</module>
|
|
|
|
<!-- Checks for whitespace -->
|
|
<module name="EmptyForIteratorPad"/>
|
|
<module name="GenericWhitespace"/>
|
|
<module name="MethodParamPad"/>
|
|
<module name="NoWhitespaceAfter"/>
|
|
<module name="NoWhitespaceBefore"/>
|
|
<module name="OperatorWrap"/>
|
|
<module name="SeparatorWrap">
|
|
<property name="tokens"
|
|
value="COMMA,LPAREN,RPAREN,RBRACK,ARRAY_DECLARATOR"/>
|
|
<property name="option" value="eol"/>
|
|
</module>
|
|
<module name="SeparatorWrap">
|
|
<property name="tokens" value="DOT,METHOD_REF,ELLIPSIS,AT"/>
|
|
<property name="option" value="nl"/>
|
|
</module>
|
|
<module name="ParenPad"/>
|
|
<module name="TypecastParenPad"/>
|
|
<module name="WhitespaceAfter"/>
|
|
<module name="WhitespaceAround"/>
|
|
<module name="SingleSpaceSeparator"/>
|
|
|
|
<!-- Modifier Checks -->
|
|
<module name="ModifierOrder"/>
|
|
<module name="RedundantModifier"/>
|
|
|
|
<!-- Checks for blocks. You know, those {}'s -->
|
|
<module name="AvoidNestedBlocks"/>
|
|
<module name="EmptyBlock"/>
|
|
<module name="LeftCurly"/>
|
|
<module name="NeedBraces">
|
|
<property name="allowSingleLineStatement" value="true"/>
|
|
</module>
|
|
<module name="RightCurly"/>
|
|
|
|
<!-- Checks for common coding problems -->
|
|
<module name="EmptyStatement"/>
|
|
<module name="EqualsHashCode"/>
|
|
<module name="IllegalInstantiation"/>
|
|
<module name="InnerAssignment"/>
|
|
<module name="MultipleVariableDeclarations"/>
|
|
<module name="SimplifyBooleanExpression"/>
|
|
<module name="SimplifyBooleanReturn"/>
|
|
|
|
<!-- Checks for class design -->
|
|
<module name="DesignForExtension">
|
|
<property name="ignoredAnnotations"
|
|
value="After, AfterClass, Before, BeforeClass, Test, Property, Override"/>
|
|
</module>
|
|
<module name="FinalClass"/>
|
|
<!-- <module name="HideUtilityClassConstructor"/> -->
|
|
<module name="InterfaceIsType"/>
|
|
<module name="VisibilityModifier"/>
|
|
|
|
<!-- Miscellaneous other checks -->
|
|
<!-- module name="ArrayTypeStyle"/-->
|
|
<module name="UpperEll"/>
|
|
<module name="Indentation">
|
|
<property name="caseIndent" value="0"/>
|
|
<property name="lineWrappingIndentation" value="8"/>
|
|
</module>
|
|
|
|
<!-- Checks for annotations -->
|
|
<module name="MissingOverride"/>
|
|
|
|
<!-- Filters -->
|
|
<module name="SuppressionCommentFilter">
|
|
<!-- This is useful when having deprecated public fields
|
|
which have been superseded by public accessors. -->
|
|
<property name="offCommentFormat" value="ALLOW PUBLIC FIELDS"/>
|
|
<property name="onCommentFormat" value="FORBID PUBLIC FIELDS"/>
|
|
<property name="checkFormat" value="VisibilityModifier"/>
|
|
</module>
|
|
</module>
|
|
</module>
|