<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
    "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
    "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">

<!-- Checkstyle properties for Cactus projects -->
<module name="Checker">
  

<module name="NewlineAtEndOfFile">
    <property name="lineSeparator" value="lf"/>
</module>

  <module name="TreeWalker">
    
    <!-- General file checks -->
    <module name="FileLength"/>
    <module name="Header">
      <property name="headerFile" value="${checkstyle.header.file}"/>
      <property name="ignoreLines" value="4"/>
    </module>
    <module name="LineLength">
      <property name="ignorePattern" value="(@version|@see|^import)"/>
    </module>
    <module name="TabCharacter"/>
    
    <!-- Imports -->
    <module name="AvoidStarImport"/>
    <module name="IllegalImport"/>
    <module name="RedundantImport"/>
    <module name="UnusedImports"/>
    
    <!-- Naming conventions -->
    <module name="ConstantName"/>
    <module name="MemberName"/>
    <module name="MethodName"/>
    <module name="LocalFinalVariableName"/>
    <module name="LocalVariableName"/>
    <module name="PackageName"/>
    <module name="ParameterName">
      <property name="format" value="^(the|is|has)[A-Z][a-zA-Z0-9]*$"/>
    </module>
    <module name="StaticVariableName"/>
    <module name="TypeName"/>
    
    <!-- Code formatting -->
    <module name="EmptyBlock">
      <property name="tokens" value="LITERAL_CATCH"/>
      <property name="option" value="text"/>
    </module>
    <module name="NeedBraces"/>
    <module name="NoWhitespaceAfter"/>
    <module name="NoWhitespaceBefore"/>
    <module name="NoWhitespaceAfter">
      <property name="tokens" value="DOT"/>
      <property name="allowLineBreaks" value="true"/>
    </module>
    <module name="NoWhitespaceBefore">
      <property name="tokens" value="DOT"/>
      <property name="allowLineBreaks" value="true"/>
    </module>
    <module name="OperatorWrap"/>
    <module name="LeftCurly">
      <property name="option" value="nl"/>
    </module>
    <module name="RightCurly">
      <property name="option" value="alone"/>
    </module>
    <module name="WhitespaceAfter"/>
    <module name="WhitespaceAround"/>
    
    <!-- Coding style -->
    <module name="EqualsHashCode"/>
    <module name="IllegalInstantiation">
      <property name="classes" value="java.lang.Boolean, java.lang.String"/>
    </module>
    <module name="InnerAssignment"/>
    <module name="MethodLength"/>
    <module name="MissingSwitchDefault"/>
    <module name="ModifierOrder"/>
    <module name="ParameterNumber"/>
    <module name="ParenPad"/>
    <module name="RedundantModifier"/>
    <module name="SimplifyBooleanExpression"/>
    <module name="SimplifyBooleanReturn"/>
    <module name="UpperEll"/>
    <module name="VisibilityModifier">
      <property name="protectedAllowed" value="true"/>
      <property name="publicMemberPattern" value="^[a-z][a-zA-Z0-9]*$"/>
    </module>
    <module name="FinalClass"/>

    <!-- Avoid finalizers (this will not find violations that contain 
         linebreaks) -->
    <module name="GenericIllegalRegexp">
      <property name="format"
          value="((public)|(protected))\s+void\s+finalize\(\s*\)"/>
      <property name="message" value="Avoid finalizers"/>
    </module>

    <!-- No direct printing to System.out or System.err -->
    <module name="GenericIllegalRegexp">
      <property name="format" value="System\.(out|err)\."/>
      <property name="message"
          value="Don't write directly to System.out our System.err"/>
    </module>

    <!-- No @author tags -->
    <module name="GenericIllegalRegexp">
      <property name="format" value="@author"/>
      <property name="message"
          value="No @author tag allowed"/>
    </module>

    <!-- Javadoc related checks -->
    <module name="JavadocType">
      <property name="scope" value="private"/>
      <!--property name="authorFormat" value=""/-->
      <property name="versionFormat" value="\$Id.*\$"/>
    </module>
    <module name="JavadocMethod">
      <property name="scope" value="private"/>
      <property name="allowUndeclaredRTE" value="true"/>
    </module>
    <module name="JavadocVariable">
      <property name="scope" value="private"/>
    </module>
    
  </module>
  
</module>
