<?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, properties, xml"/>

    <module name="NewlineAtEndOfFile"/>
    <module name="Translation"/>
    <module name="FileLength"/>
    <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="RegexpMultiline">
        <property name="format" value="^([^\n ]+ )*(class|interface|enum) [^{]*\{\n[^\n}]"/>
        <property name="message" value="Leave empty row after class/interface/enum definition!"/>
        <property name="severity" value="error"/>
        <property name="fileExtensions" value="groovy,java"/>
    </module>
    <module name="RegexpMultiline">
        <property name="format" value="System\.(out|err)\.print"/>
    </module>
    <module name="LineLength">
        <property name="max" value="120"/>
        <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|@see|//"/>
    </module>
    <module name="SuppressWarningsFilter"/>
    <module name="TreeWalker">
        <module name="Indentation">
            <property name="lineWrappingIndentation" value="8"/>
            <property name="arrayInitIndent" value="8"/>
            <property name="forceStrictCondition" value="false"/>
        </module>
        <module name="EmptyLineSeparator">
            <property name="allowNoEmptyLineBetweenFields" value="true"/>
            <property name="allowMultipleEmptyLines" value="false"/>
            <property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
        </module>
        <module name="NoLineWrap"/>
        <module name="NeedBraces"/>
        <module name="ConstantName">
            <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*|(.*?)[l,L]ogger)$"/>
        </module>
        <module name="FinalLocalVariable">
            <property name="tokens" value="VARIABLE_DEF"/>
        </module>
        <module name="LocalFinalVariableName"/>
        <module name="LocalVariableName"/>
        <module name="MemberName"/>
        <module name="MethodName"/>
        <module name="MultipleVariableDeclarations"/>
        <module name="PackageName"/>
        <module name="ParameterName"/>
        <module name="StaticVariableName"/>
        <module name="TypeName"/>
        <module name="AvoidStarImport"/>
        <module name="AvoidStaticImport"/>
        <module name="IllegalImport">
            <!-- Avoids shaded imports if IDE autosuggests them. Avoid lang in favor of lang3. -->
            <property name="illegalPkgs" value="
                        autovalue.shaded.com.google,
                        org.inferred.freebuilder.shaded.com.google,
                        org.apache.commons.lang"/>
        </module>
        <module name="RedundantImport"/>
        <module name="UnusedImports">
            <property name="processJavadoc" value="true"/>
        </module>
        <module name="ImportOrder">
            <property name="option" value="bottom"/>
            <property name="groups" value="*,/^java/"/>
            <property name="ordered" value="false"/>
            <property name="separated" value="true"/>
            <property name="caseSensitive" value="true"/>
            <property name="sortStaticImportsAlphabetically" value="true"/>
            <property name="useContainerOrderingForStatic" value="false"/>
        </module>
        <module name="MethodLength"/>
        <module name="EmptyForIteratorPad">
            <property name="option" value="space"/>
        </module>
        <module name="GenericWhitespace"/>
        <module name="MethodParamPad">
            <property name="allowLineBreaks" value="false"/>
        </module>
        <module name="NoWhitespaceAfter">
            <property name="tokens" value="INC,DEC,UNARY_MINUS,UNARY_PLUS,BNOT,LNOT,DOT,ARRAY_DECLARATOR,INDEX_OP"/>
            <property name="allowLineBreaks" value="true"/>
        </module>
        <module name="NoWhitespaceBefore"/>
        <module name="OperatorWrap"/>
        <module name="ParenPad"/>
        <module name="TypecastParenPad"/>
        <module name="WhitespaceAfter"/>
        <module name="WhitespaceAround"/>
        <module name="AnnotationLocation">
            <property name="allowSamelineMultipleAnnotations" value="false"/>
            <property name="allowSamelineSingleParameterlessAnnotation" value="false"/>
        </module>
        <module name="ModifierOrder"/>
        <module name="RedundantModifier"/>
        <module name="AvoidNestedBlocks"/>
        <module name="EmptyBlock"/>
        <module name="LeftCurly"/>
        <module name="RightCurly"/>
        <module name="RightCurly">
            <property name="option" value="alone"/>
            <property name="tokens" value="METHOD_DEF"/>
        </module>
        <module name="EmptyStatement"/>
        <module name="EqualsHashCode"/>
        <module name="IllegalInstantiation"/>
        <module name="InnerAssignment"/>
        <module name="MissingOverride"/>
        <module name="SimplifyBooleanExpression"/>
        <module name="SimplifyBooleanReturn"/>
        <module name="HideUtilityClassConstructor"/>
        <module name="ArrayTypeStyle"/>
        <module name="CommentsIndentation"/>
        <module name="UpperEll"/>
        <module name="IllegalThrows"/>
        <module name="OneStatementPerLine"/>
        <module name="OuterTypeFilename"/>
        <module name="OverloadMethodsDeclarationOrder"/>
        <module name="SeparatorWrap">
            <property name="option" value="nl"/>
            <property name="tokens" value="DOT"/>
        </module>
        <module name="SeparatorWrap">
            <property name="option" value="eol"/>
            <property name="tokens" value="COMMA"/>
        </module>
        <module name="SimplifyBooleanExpression"/>
        <module name="SimplifyBooleanReturn"/>
        <module name="SingleSpaceSeparator"/>
        <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, LAMBDA,
                      TEXT_BLOCK_LITERAL_BEGIN,
                      LITERAL_INSTANCEOF,
                      GT, LT, GE, LE, EQUAL, NOT_EQUAL,
                      UNARY_MINUS, UNARY_PLUS, INC, DEC, LNOT, BNOT, POST_INC, POST_DEC"/>
            <!-- All default values are present except LAND, LOR.-->
        </module>
        <module name="SuppressWarningsHolder"/>

        <!--
        TODO schernysh 11.21.2019:
        Ban usage of Vert.x Json object as it's being deprecated since Vert.x 3.8 branch.
        This enforcement could be removed in a while when everyone feels comfortable without Json.
        Suggested date of removal: 02.01.2020
        Enforced by:
        - "IllegalImport" just below
        - "SuppressionSingleFilter" targeted at "BanVertxJsonImport" in the outer module
        -->
        <module name="IllegalImport">
            <property name="id" value="BanVertxJsonImport"/>
            <property name="illegalClasses" value="io.vertx.core.json.Json"/>
        </module>
    </module>
    <module name="SuppressionSingleFilter">
        <property name="id" value="BanVertxJsonImport"/>
        <property name="files" value="src/main/java/org/prebid/server/json/ObjectMapperProvider\.java"/>
    </module>

    <module name="SuppressionSingleFilter">
        <property name="checks" value="AvoidStaticImport"/>
        <property name="files" value=".*Test\.java"/>
    </module>
    <module name="SuppressionSingleFilter">
        <property name="checks" value="FileLength"/>
        <property name="files" value=".*Test\.java"/>
    </module>
</module>
