<?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="charset" value="UTF-8" />
  <property name="severity" value="warning" />
  <property name="fileExtensions" value="java" />
  <module name="TreeWalker">
    <!-- Modules for the Google Java Style guide (expect those covered by google-java-format). -->
    <module name="OuterTypeFilename" />
    <module name="IllegalTokenText">
      <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL" />
      <property name="format"
        value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)" />
      <property name="message"
        value="Use special escape sequence instead of octal value or Unicode escaped value." />
    </module>
    <module name="AvoidEscapedUnicodeCharacters">
      <property name="allowEscapesForControlCharacters" value="true" />
      <property name="allowByTailComment" value="true" />
      <property name="allowNonPrintableEscapes" value="true" />
    </module>
    <module name="AvoidStarImport" />
    <module name="OneTopLevelClass" />
    <module name="EmptyBlock">
      <property name="option" value="TEXT" />
      <property name="tokens"
        value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH" />
    </module>
    <module name="NeedBraces" />
    <module name="MultipleVariableDeclarations" />
    <module name="ArrayTypeStyle" />
    <module name="MissingSwitchDefault" />
    <module name="FallThrough" />
    <module name="UpperEll" />
    <module name="PackageName">
      <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$" />
    </module>
    <module name="TypeName" />
    <module name="MemberName">
      <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$" />
    </module>
    <module name="ParameterName">
      <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
    </module>
    <module name="LambdaParameterName">
      <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
    </module>
    <module name="CatchParameterName">
      <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
    </module>
    <module name="LocalVariableName">
      <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
    </module>
    <module name="ClassTypeParameterName">
      <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
    </module>
    <module name="MethodTypeParameterName">
      <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
    </module>
    <module name="InterfaceTypeParameterName">
      <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
    </module>
    <module name="NoFinalizer" />
    <module name="AbbreviationAsWordInName">
      <property name="ignoreFinal" value="false" />
      <property name="allowedAbbreviationLength" value="1" />
    </module>
    <module name="OverloadMethodsDeclarationOrder" />
    <module name="VariableDeclarationUsageDistance">
      <property name="allowedDistance" value="4" />
    </module>
    <module name="NonEmptyAtclauseDescription" />
    <module name="SummaryJavadoc">
      <property name="forbiddenSummaryFragments"
        value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )" />
    </module>
    <module name="JavadocParagraph" />
    <module name="AtclauseOrder">
      <property name="tagOrder" value="@param, @return, @throws, @deprecated" />
      <property name="target"
        value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF" />
    </module>
    <module name="JavadocMethod">
      <property name="accessModifiers" value="public" />
      <property name="allowMissingParamTags" value="true" />
      <property name="allowMissingReturnTag" value="true" />
      <property name="allowedAnnotations"
        value="Override,BeforeEach,Test,ParameterizedTest,Setup,Benchmark" />
    </module>
    <module name="MethodName">
      <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$" />
    </module>
    <module name="SingleLineJavadoc">
      <property name="ignoredTags" value="@code,@link,@literal" />
      <property name="ignoreInlineTags" value="false" />
    </module>
    <module name="EmptyCatchBlock">
      <property name="exceptionVariableName" value="expected" />
    </module>

    <!-- Additional modules, not related to the Google Java Style guide. -->
    <module name="AvoidNestedBlocks">
      <property name="allowInSwitchCase" value="true" />
    </module>
    <module name="HideUtilityClassConstructor" />
    <module name="InnerTypeLast" />
    <module name="InterfaceIsType" />
    <module name="MutableException" />
    <module name="ThrowsCount" />
    <module name="CovariantEquals" />
    <module name="DeclarationOrder">
      <property name="ignoreModifiers" value="true" />
    </module>
    <module name="DefaultComesLast" />
    <module name="EmptyStatement" />
    <module name="EqualsHashCode" />
    <module name="ExplicitInitialization" />
    <module name="IllegalCatch" />
    <module name="IllegalThrows" />
    <module name="IllegalType">
      <property name="illegalClassNames"
        value="ArrayList,LinkedList,HashSet,TreeSet,LinkedHashSet,HashMap,TreeMap,LinkedHashMap" />
      <property name="memberModifiers" value="LITERAL_PUBLIC,LITERAL_PROTECTED" />
    </module>
    <module name="JavadocStyle" />
    <module name="ModifiedControlVariable" />
    <module name="NoClone" />
    <module name="SimplifyBooleanExpression" />
    <module name="SimplifyBooleanReturn" />
    <module name="StringLiteralEquality" />
    <module name="FinalClass" />
    <module name="FinalParameters" />

    <!-- Module allowing to suppress warnings with DontCheck(...) comments. -->
    <module name="SuppressWithNearbyCommentFilter">
      <property name="commentFormat" value="DontCheck\((\w+)\)" />
      <property name="checkFormat" value="$1" />
      <property name="influenceFormat" value="1" />
    </module>
    <module name="SuppressWithNearbyCommentFilter">
      <property name="commentFormat" value="DontCheck\(IllegalCatch\)" />
      <property name="checkFormat" value="IllegalCatch" />
      <property name="influenceFormat" value="-1" />
    </module>
  </module>
</module>
