ChestCommands/checkstyle/checkstyle.xml
2020-08-31 20:32:51 +02:00

200 lines
8.0 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="fileExtensions" value="java, xml"/>
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<module name="SuppressionFilter">
<property name="file" value="checkstyle/suppressions.xml"/>
</module>
<!-- Check that Java source files have the correct header -->
<module name="Header">
<property name="severity" value="error"/>
<property name="fileExtensions" value="java"/>
<property name="headerFile" value="checkstyle/header.txt"/>
</module>
<!-- Check that files don't contain tabs -->
<module name="FileTabCharacter">
<property name="severity" value="error"/>
<property name="eachLine" value="true"/>
</module>
<!-- Trailing spaces -->
<module name="RegexpSingleline">
<property name="format" value="[^\s\*]\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<!-- Limit maximum lines in a single file -->
<module name="FileLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="600"/>
</module>
<!-- Limit maximum line length for readability -->
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="160"/> <!-- TODO ideal limit is 120/140 -->
<property name="ignorePattern" value="^package.*|^import.*"/>
</module>
<module name="TreeWalker">
<!-- Blocks -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignore"/>
</module>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<!-- Class design -->
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>
<module name="ThrowsCount"/>
<!-- Coding -->
<!-- <module name="AvoidDoubleBraceInitialization"/> Only since Checkstyle v8.30 -->
<module name="AvoidNoArgumentSuperConstructorCall"/>
<module name="CovariantEquals"/>
<module name="DeclarationOrder">
<property name="ignoreConstructors" value="true"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="FallThrough"/>
<module name="IllegalCatch"/>
<module name="IllegalThrows"/>
<module name="IllegalToken"/>
<module name="IllegalType"/>
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault"/>
<module name="ModifiedControlVariable">
<property name="skipEnhancedForLoopVariable" value="true"/>
</module>
<module name="NestedForDepth">
<property name="max" value="3"/>
</module>
<module name="NestedIfDepth">
<property name="max" value="3"/>
</module>
<module name="NestedTryDepth"/>
<module name="NoFinalizer"/>
<module name="OneStatementPerLine"/>
<module name="PackageDeclaration"/>
<module name="RequireThis"/>
<module name="SimplifyBooleanExpression"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessaryParentheses">
<property name="tokens" value="EXPR, IDENT, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, STRING_LITERAL,
LITERAL_NULL, LITERAL_FALSE, LITERAL_TRUE, ASSIGN, BAND_ASSIGN, BOR_ASSIGN, BSR_ASSIGN,
BXOR_ASSIGN, DIV_ASSIGN, MINUS_ASSIGN, MOD_ASSIGN, PLUS_ASSIGN, SL_ASSIGN, SR_ASSIGN,
STAR_ASSIGN"/>
</module>
<!-- <module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/> Only since Checkstyle v8.31 -->
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<!-- Imports -->
<module name="AvoidStarImport"/>
<module name="AvoidStaticImport"/>
<module name="IllegalImport">
<property name="illegalPkgs" value="sun"/>
<property name="illegalClasses" value="
com.google.common.base.Optional,
com.google.common.base.Function,
com.google.common.base.Supplier"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Javadoc -->
<module name="AtclauseOrder"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocBlockTagLocation"/>
<module name="JavadocContentLocation"/>
<module name="JavadocMethod"/>
<!-- <module name="JavadocMissingWhitespaceAfterAsterisk"/> Only since Checkstyle v8.32 -->
<module name="JavadocStyle"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="JavadocType"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="SingleLineJavadoc"/>
<module name="SummaryJavadoc"/>
<!-- Miscellaneous -->
<module name="ArrayTypeStyle"/>
<module name="AvoidEscapedUnicodeCharacters"/>
<module name="CommentsIndentation"/>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="8"/>
<property name="lineWrappingIndentation" value="8"/>
<property name="arrayInitIndent" value="4"/>
</module>
<module name="OuterTypeFilename"/>
<module name="UpperEll"/>
<!-- Modifiers -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Naming -->
<module name="ClassTypeParameterName"/>
<module name="InterfaceTypeParameterName"/>
<module name="MethodTypeParameterName"/>
<module name="LambdaParameterName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<!-- Size -->
<module name="MethodCount"/>
<module name="OuterTypeNumber"/>
<module name="ParameterNumber"/>
<!-- Whitespace -->
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="tokens" value="IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT,
INSTANCE_INIT, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoLineWrap"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="SingleSpaceSeparator"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyCatches" value="true"/>
<property name="ignoreEnhancedForColon" value="false"/>
</module>
</module>
</module>