<?xml version="1.0" ?>
<!--
  ~ Copyright 2019 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed 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.2//EN"
    "https://checkstyle.org/dtds/configuration_1_2.dtd">

<module name="Checker">
  <!-- Checks for whitespace. -->
  <module name="FileTabCharacter">
    <property name="severity" value="error"/>
    <property name="eachLine" value="true"/>
  </module>
  <module name="RegexpSingleline">
    <property name="format" value="\s+$"/>
    <property name="message" value="Line contains trailing whitespace."/>
  </module>
  <module name="TreeWalker">
    <!-- Import settings: getting rid of redundant import, forbid star notation,
         defined order of imports. -->
    <module name="RedundantImport"/>
    <module name="AvoidStarImport">
      <property name="allowClassImports" value="false"/>
      <property name="allowStaticMemberImports" value="false"/>
    </module>
    <module name="CustomImportOrder">
      <property name="customImportOrderRules"
                value="STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STATIC"/>
      <property name="specialImportsRegExp" value="^javax\."/>
      <property name="standardPackageRegExp" value="^java\."/>
      <property name="sortImportsInGroupAlphabetically" value="true"/>
      <property name="separateLineBetweenGroups" value="true"/>
    </module>
    <module name="UnusedImports"/>
    <module name="NeedBraces">
      <property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
    </module>
    <module name="EqualsHashCode"/>
    <module name="LineLength">
      <property name="max" value="120"/>
      <property name="ignorePattern" value="\s*//.*"/>
    </module>
    <module name="EmptyLineSeparator">
      <property name="allowNoEmptyLineBetweenFields" value="true"/>
      <property name="allowMultipleEmptyLines" value="false"/>
      <property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
    </module>
  </module>
  <module name="RegexpHeader">
    <property name="header" value="^\/\*$\n^
\* Copyright \d\d\d\d Red Hat, Inc\. and\/or its affiliates\.$\n^
\*$\n^
\* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\);$\n^
\* you may not use this file except in compliance with the License\.$\n^
\* You may obtain a copy of the License at$\n^
\*$\n^
\*     http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0$\n^
\*$\n^
\* Unless required by applicable law or agreed to in writing, software$\n^
\* distributed under the License is distributed on an &quot;AS IS&quot; BASIS,$\n^
\* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$\n^
\* See the License for the specific language governing permissions and$\n^
\* limitations under the License\.$\n^
\*\/$"/>
    <property name="fileExtensions" value="java"/>
  </module>
</module>
