<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
        "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
        "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
    <!-- Root Checks -->
    <module name="RegexpHeader">
        <property name="headerFile" value="${checkstyle.header.file}"/>
        <property name="fileExtensions" value="java"/>
    </module>
    <module name="NewlineAtEndOfFile">
        <property name="lineSeparator" value="lf"/>
    </module>

    <module name="TreeWalker">

        <!-- Annotations -->
        <module name="AnnotationUseStyle">
            <property name="elementStyle" value="compact"/>
        </module>
        <module name="MissingOverride"/>
        <module name="PackageAnnotation"/>
        <module name="AnnotationLocation">
            <property name="allowSamelineSingleParameterlessAnnotation"
                      value="false"/>
        </module>

        <!-- Block Checks -->
        <module name="EmptyBlock">
            <property name="option" value="text"/>
        </module>
        <!--
        <module name="LeftCurly"/>
        <module name="RightCurly">
            <property name="option" value="alone"/>
        </module>
        <module name="NeedBraces"/>
        <module name="AvoidNestedBlocks"/>
        -->

        <!-- tabs instead of spaces -->
        <module name="RegexpSinglelineJava">
            <property name="format" value="^\t* "/>
            <property name="message" value="Indent must use tab characters"/>
            <property name="ignoreComments" value="true"/>
        </module>

        <!-- Class Design -->
        <!--
        <module name="FinalClass"/>
        <module name="InterfaceIsType"/>
        <module name="MutableException"/>
        <module name="InnerTypeLast"/>
        <module name="OneTopLevelClass"/>
        -->

        <!-- Coding -->
        <!--
        <module name="CovariantEquals"/>
        <module name="EmptyStatement"/>
        <module name="EqualsHashCode"/>
        <module name="InnerAssignment"/>
        <module name="SimplifyBooleanExpression"/>
        <module name="SimplifyBooleanReturn"/>
        <module name="StringLiteralEquality"/>
        <module name="NestedForDepth">
            <property name="max" value="3"/>
        </module>
        <module name="NestedIfDepth">
            <property name="max" value="3"/>
        </module>
        <module name="NestedTryDepth">
            <property name="max" value="3"/>
        </module>
        <module name="MultipleVariableDeclarations"/>
        <module name="RequireThis">
            <property name="checkMethods" value="false"/>
        </module>
        <module name="OneStatementPerLine"/>
        <module name="ExplicitInitialization"/>

        <module name="ParameterAssignment"/>
        -->
        <!-- Imports -->
        <module name="AvoidStarImport"/>
        <module name="AvoidStaticImport">
            <property name="excludes"
                      value="org.junit.Assert.*,
                      org.mockito.Mockito.*,
                      org.mockito.BDDMockito.*,
                      org.mockito.ArgumentMatchers.*,
                      org.hamcrest.Matchers.*,
                      org.assertj.core.api.Assertions.*"/>
        </module>
        <module name="FallThrough"/>
        <module name="ImportOrder">
            <property name="groups" value="java,/^javax?\./,*,org.springframework"/>
            <property name="ordered" value="true"/>
            <property name="separated" value="true"/>
            <property name="option" value="bottom"/>
            <property name="sortStaticImportsAlphabetically" value="true"/>
        </module>
        <module name="IllegalImport">
            <property name="illegalPkgs" value="org.slf4j"/>
        </module>
        <module name="RedundantImport"/>
        <module name="ReturnCount">
            <property name="max" value="1"/>
            <property name="tokens" value="LAMBDA"/>
        </module>
        <module name="ReturnCount">
            <property name="max" value="1"/>
            <property name="tokens" value="CTOR_DEF"/>
        </module>

        <!--
        <module name="ReturnCount">
            <property name="max" value="3"/>
            <property name="tokens" value="METHOD_DEF"/>
        </module>
        -->
        <module name="UnusedImports"/>

        <!-- Miscellaneous -->
        <module name="CommentsIndentation"/>
        <module name="UpperEll"/>
        <module name="ArrayTypeStyle"/>
        <module name="OuterTypeFilename"/>

        <!-- Modifiers -->
        <module name="RedundantModifier"/>

        <!-- Regexp -->
        <module name="RegexpSinglelineJava">
            <property name="format" value="^\t* +\t*\S"/>
            <property name="message"
                      value="Line has leading space characters; indentation should be performed with tabs only."/>
            <property name="ignoreComments" value="true"/>
        </module>
        <!--
        <module name="Regexp">
            <property name="format" value="[ \t]+$"/>
            <property name="illegalPattern" value="true"/>
            <property name="message" value="Trailing whitespace"/>
        </module>

        <module name="RegexpSinglelineJava">
            <property name="maximum" value="0"/>
            <property name="format" value="org\.junit\.Assert\.assert"/>
            <property name="message"
                      value="Please use AssertJ imports."/>
            <property name="ignoreComments" value="true"/>
        </module>
        -->

        <!-- Whitespace -->
        <!--
        <module name="GenericWhitespace"/>
        <module name="MethodParamPad"/>
        <module name="NoWhitespaceAfter">
            <property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS, ARRAY_DECLARATOR"/>
        </module>
        <module name="NoWhitespaceBefore"/>
        <module name="ParenPad"/>
        <module name="TypecastParenPad"/>
        <module name="WhitespaceAfter"/>
        <module name="WhitespaceAround"/>
        -->
    </module>
</module>
