<?xml version="1.0"?>
<!--
 * 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">

<module name="Checker">
    <module name="SuppressionFilter">
        <property name="file" value="dev/checkstyle/suppressions.xml"/>
    </module>

    <module name="TreeWalker">
        <!-- XPath-based suppressions (target specific AST patterns) -->
        <module name="SuppressionXpathFilter">
            <property name="file" value="dev/checkstyle/suppressions-xpath.xml"/>
        </module>

        <module name="UnusedImports"/>
        <module name="RedundantImport"/>
        <module name="AvoidStarImport"/>
        <module name="IllegalImport"/>
        <module name="PackageName"/>
        <module name="TypeName"/>
        <!-- 1) Private fields must be _lowerCamelCase -->
        <!--<module name="MemberName">
            <property name="applyToPublic" value="false"/>
            <property name="applyToProtected" value="false"/>
            <property name="applyToPackage" value="false"/>
            <property name="applyToPrivate" value="true"/>

            <property name="format" value="^_[a-z][a-zA-Z0-9]*$"/>
        </module>-->
        <!-- 2) Non-private fields must be lowerCamelCase (no leading underscore) -->
        <!--<module name="MemberName">
            <property name="applyToPublic" value="true"/>
            <property name="applyToProtected" value="false"/>
            <property name="applyToPackage" value="true"/>
            <property name="applyToPrivate" value="false"/>
            <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
        </module>-->
        <module name="MethodName"/>
        <!--<module name="ParameterName"/>-->
        <module name="LocalVariableName">
            <property name="format"
                      value="^[a-zA-Z][a-zA-Z0-9_]*$"/>
        </module>
    </module>

    <!-- to detect leading spaces (should be tabs) -->
    <module name="RegexpMultiline">
        <property name="format"
                  value="(?m)^( +)(?!\*)(?!//)(?!/\*)\S"/>
        <property name="message"
                  value="Indentation must use tabs (no leading spaces)."/>
    </module>
</module>
