All Downloads are FREE. Search and download functionalities are using the official Maven repository.

checkstyle.checkstyle-rules.xml Maven / Gradle / Ivy

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

<module name="Checker">
  <property name="severity" value="error" />
  <module name="SuppressWarningsFilter" />
  <module name="TreeWalker">
    <module name="SuppressWarningsHolder" />
    <!--  See https://github.com/checkstyle/checkstyle/issues/5132
    <module name="FileContentsHolder"/>
    -->
    
    <!--  TODO Enforce Javadoc
    <module name="JavadocType">
      <property name="scope" value="protected" />
      <property name="authorFormat" value="^[a-zA-Z ]+" />
    </module>
    <module name="JavadocMethod">
      <property name="scope" value="protected" />
    </module>
    <module name="JavadocVariable">
      <property name="scope" value="protected" />
    </module>
    <module name="JavadocStyle">
      <property name="scope" value="public" />
      <property name="checkEmptyJavadoc" value="false" />
    </module>
    <module name="ConstantName">
      <property name="format" value="^[a-zA-Z](_?[a-zA-Z0-9]+)*$" />
    </module>
     -->
     
     
    <!-- Variable naming conventions are rather silly because mathematics need to be done with
    	variables. Mathematics should not be done with verbose variable names.
    <module name="LocalFinalVariableName">
      <property name="format" value="^(my[A-Z][a-zA-Z0-9]*|is[A-Z][a-zA-Z0-9]*|i|j|k|iter|ex)$" />
    </module>
    <module name="LocalVariableName">
      <property name="format"
        value="^(my[A-Z][a-zA-Z0-9]*|is[A-Z][a-zA-Z0-9]*|i|j|k|iter|ex)$" />
    </module>
    <module name="MemberName">
      <property name="format" value="^(the|is)[A-Z][a-zA-Z0-9]*$" />
    </module>
    -->
    <module name="MethodName">
    </module>
    <module name="PackageName">
      <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*_?)*$" />
    </module>
	<!--
    <module name="ParameterName">
      <property name="format" value="^(a|an|some|is)[A-Z][a-zA-Z0-9]*$" />
    </module>
    -->
    <module name="StaticVariableName">
      <property name="format" value="^(sole)[A-Z][a-zA-Z0-9]*$" />
    </module>
    <module name="TypeName">
      <property name="tokens" value="CLASS_DEF" />
    </module>
    <module name="TypeName">
      <property name="format" value="^I[A-Z][a-zA-Z0-9]*$" />
      <property name="tokens" value="INTERFACE_DEF" />
    </module>
    <module name="AvoidStarImport">
    </module>
    <module name="RedundantImport">
    </module>
    <module name="UnusedImports">
    </module>
    <module name="ExecutableStatementCount">
      <property name="severity" value="warning" />
      <property name="tokens" value="INSTANCE_INIT,STATIC_INIT,METHOD_DEF,CTOR_DEF" />
      <property name="max" value="30" />
    </module>
    <module name="ExecutableStatementCount">
      <property name="max" value="50" />
    </module>
    <!--  checkstyle 3.1.1 this is not allowed here
    <module name="LineLength">
      <property name="ignorePattern" value="@see " />
      <property name="max" value="120" />
    </module>
    -->
    <module name="MethodLength">
      <property name="severity" value="warning" />
      <property name="max" value="75" />
      <property name="countEmpty" value="false" />
    </module>
    <module name="MethodLength">
      <property name="max" value="100" />
      <property name="countEmpty" value="false" />
    </module>
    <module name="AnonInnerLength">
      <property name="max" value="100" />
    </module>
    <module name="ParameterNumber">
      <property name="severity" value="warning" />
      <property name="max" value="7" />
    </module>
    <module name="ParameterNumber">
      <property name="max" value="8" />
    </module>
    <module name="EmptyForInitializerPad">
    </module>
    <module name="EmptyForIteratorPad">
    </module>
    <module name="NoWhitespaceBefore">
    </module>
    <module name="OperatorWrap">
    </module>
    <module name="ParenPad">
    </module>
    <module name="TypecastParenPad">
    </module>
     <!-- 
	   <module name="WhitespaceAfter">
	      <property name="tokens" value="COMMA, SEMI" />
	    </module>
     <module name="WhitespaceAround">
      <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"/>
    </module>
    <module name="RedundantModifier">
    </module>
    -->
    <module name="ModifierOrder">
    </module>
    <module name="EmptyBlock">
    </module>
    <!--
    <module name="LeftCurly">
      <property name="option" value="nl" />
    </module>
    <module name="NeedBraces">
    </module>
    <module name="RightCurly">
      <property name="option" value="alone" />
    </module>
    -->
    <module name="AvoidNestedBlocks">
    </module>
    <module name="ArrayTrailingComma">
    </module>
    <module name="CovariantEquals">
    </module>
    <module name="EmptyStatement">
    </module>
    <module name="EqualsHashCode">
    </module>
    <module name="HiddenField">
      <property name="tokens" value="VARIABLE_DEF" />
    </module>
    <module name="IllegalInstantiation">
      <property name="classes" value="java.lang.Boolean,java.util.Date,java.sql.Date,java.util.GregorianCalendar,java.sql.Time,java.sql.Timestamp" />
    </module>
    <module name="InnerAssignment">
    </module>
    <module name="MissingSwitchDefault">
    </module>
    <module name="ModifiedControlVariable">
    </module>
    <module name="SimplifyBooleanExpression">
    </module>
    <module name="SimplifyBooleanReturn">
    </module>
    <module name="StringLiteralEquality">
    </module>
    <module name="NestedIfDepth">
      <property name="max" value="4" />
    </module>
    <module name="NestedTryDepth">
      <property name="max" value="2" />
    </module>
    <module name="SuperClone">
    </module>
    <module name="SuperFinalize">
    </module>
    <module name="PackageDeclaration">
    </module>
    <module name="ReturnCount">
      <property name="max" value="5" />
    </module>
    <module name="DeclarationOrder">
    </module>
    <module name="DefaultComesLast">
    </module>
   <module name="FallThrough">
    </module>
    <module name="MultipleStringLiterals">
      <property name="allowedDuplicates" value="32" />
    </module>
    <module name="MultipleVariableDeclarations">
    </module>
    <!-- 
    <module name="IllegalCatch">
    </module>
    <module name="MissingCtor">
    </module>
     <module name="VisibilityModifier">
    </module>
    -->
    <module name="FinalClass">
    </module>
    <module name="InterfaceIsType">
    </module>
    <module name="HideUtilityClassConstructor">
    </module>
    <module name="MutableException">
    </module>
    <module name="ThrowsCount">
      <property name="max" value="4" />
    </module>
    <module name="BooleanExpressionComplexity">
    </module>
    <module name="ClassDataAbstractionCoupling">
      <property name="severity" value="warning" />
      <property name="max" value="100" />
    </module>
    <module name="ClassDataAbstractionCoupling">
      <property name="max" value="30" />
    </module>
    <module name="ClassFanOutComplexity">
      <property name="severity" value="warning" />
      <property name="max" value="30" />
    </module>
    <module name="ClassFanOutComplexity">
      <property name="max" value="50" />
    </module>
    <module name="CyclomaticComplexity">
      <property name="severity" value="warning" />
      <property name="max" value="32" />
    </module>
    <module name="CyclomaticComplexity">
      <property name="max" value="64" />
    </module>
    <module name="NPathComplexity">
      <property name="severity" value="warning" />
      <property name="max" value="500" />
    </module>
    <module name="NPathComplexity">
      <property name="max" value="5000" />
    </module>
    <module name="JavaNCSS">
      <property name="severity" value="warning" />
      <property name="methodMaximum" value="50" />
    </module>
    <module name="JavaNCSS">
      <property name="methodMaximum" value="75" />
    </module>
    <module name="Regexp">
      <property name="format" value="printStackTrace\(\)" />
      <property name="message" value="Do not print the stack trace of exceptions to standard out, use the standard exception handling framework." />      
      <property name="illegalPattern" value="true" />
      <property name="ignoreComments" value="true" />
    </module>
    <module name="Regexp">
      <property name="format" value="[^Smart]Calendar.*\n*.*\..*\n*.*getInstance" />
      <property name="message" value="Do not use Calendar.getInstance(), use CurrentDateTime.getCurrentCalendar() instead" />
      <property name="illegalPattern" value="true" />
      <property name="ignoreComments" value="true" />
    </module>
    <module name="Regexp">
      <property name="format" value="GregorianCalendar.*\n*.*\..*\n*.*getInstance" />
      <property name="message" value="Do not use GregorianCalendar.getInstance(), use CurrentDateTime.getCurrentGregorianCalendar() instead" />
      <property name="illegalPattern" value="true" />
      <property name="ignoreComments" value="true" />
    </module>
    <module name="Regexp">
      <property name="format" value="new\s+Date\s*\(" />
      <property name="message" value="Do not construct a Date object, use CurrentDateTime.getCurrentDate() instead" />
      <property name="illegalPattern" value="true" />
      <property name="ignoreComments" value="true" />
    </module>
    <module name="Regexp">
      <property name="format" value="new\s+GregorianCalendar\s*\(" />
      <property name="message" value="Do not construct a GregorianCalendar object, use CurrentDateTime.getCurrentGregorianCalendar() instead" />
      <property name="illegalPattern" value="true" />
      <property name="ignoreComments" value="true" />
    </module>
    <module name="UpperEll">
    </module>
    <module name="ArrayTypeStyle">
    </module>
  </module>
  <!-- 
   <module name="GenericWhitespace"/>
   <module name="SuppressionFilter">
    <property name="file" value="${checkstyle.suppressions.file}" />
  </module>
  <module name="RegexpHeader">
    <property name="headerFile" value="${checkstyle.header.file}" />
  </module>
   -->
  <module name="FileLength">
    <property name="severity" value="warning" />
    <property name="max" value="1500" />
  </module>
  <module name="FileLength">
    <property name="max" value="2000" />
  </module>
  <!--  
  <module name="FileTabCharacter">
  </module>
  -->
</module>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy