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

global-build-tools.checkstyle.xml Maven / Gradle / Ivy

There is a newer version: 31
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  wcm.io
  %%
  Copyright (C) 2014 wcm.io
  %%
  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.
  #L%
  -->

<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
  <property name="severity" value="warning"/>

  <module name="TreeWalker">
    <property name="tabWidth" value="2"/>

    <!-- Naming conventions -->
    <!-- http://checkstyle.sourceforge.net/config_naming.html -->
    <module name="MemberName">
      <property name="format" value="^[a-z][_a-zA-Z0-9]*$"/>
    </module>
    <module name="StaticVariableName">
      <property name="format" value="^[a-z][_a-zA-Z0-9]*$"/>
    </module>
    <module name="MethodName">
      <property name="format" value="^[a-z][_a-zA-Z0-9]*$"/>
    </module>
    <module name="ParameterName">
      <property name="format" value="^[a-z][_a-zA-Z0-9]*$"/>
    </module>
    <module name="LocalVariableName">
      <property name="format" value="^[a-z][_a-zA-Z0-9]*$"/>
    </module>
    <module name="ConstantName">
      <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$|^log$|^mLog$"/>
    </module>
    <module name="PackageName"/>
    <module name="TypeName">
      <property name="format" value="^[A-Z][_a-zA-Z0-9]*$"/>
    </module>
    <module name="LocalFinalVariableName">
      <property name="format" value="^[a-zA-Z][_a-zA-Z0-9]*$"/>
    </module>
    <module name="ClassTypeParameterName">
      <!-- Generic types same rules as TypeName -->
      <property name="format" value="^[A-Z][a-zA-Z0-9]*$"/>
    </module>
    <module name="MethodTypeParameterName">
      <!-- Generic types same rules as TypeName -->
      <property name="format" value="^[A-Z][a-zA-Z0-9]*$"/>
    </module>

    <!-- Imports -->
    <!-- http://checkstyle.sourceforge.net/config_imports.html -->
    <module name="IllegalImport"/>
    <module name="RedundantImport"/>

    <!-- Size Violations -->
    <!-- http://checkstyle.sourceforge.net/config_sizes.html -->
    <module name="LineLength">
      <property name="max" value="180"/>
      <property name="tabWidth" value="2"/>
    </module>
    <module name="MethodLength">
      <property name="max" value="300"/>
    </module>
    <module name="ParameterNumber">
      <property name="max" value="12"/>
    </module>
    <module name="OuterTypeNumber"/>

    <!-- Whitespaces -->
    <!-- http://checkstyle.sourceforge.net/config_whitespace.html -->
    <module name="GenericWhitespace"/>
    <module name="EmptyForIteratorPad"/>
    <module name="NoWhitespaceAfter">
      <property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS,TYPECAST"/>
    </module>
    <module name="NoWhitespaceBefore"/>
    <module name="ParenPad">
      <property name="tokens" value="CTOR_CALL,METHOD_CALL,SUPER_CTOR_CALL"/>
    </module>
    <module name="TypecastParenPad"/>
    <module name="WhitespaceAfter">
      <property name="tokens" value="SEMI"/>
    </module>
    <module name="WhitespaceAround"/>

    <!-- Modifiers -->
    <!-- http://checkstyle.sourceforge.net/config_modifier.html -->
    <module name="ModifierOrder"/>
    <module name="RedundantModifier"/>

    <!-- Block Checks -->
    <!-- http://checkstyle.sourceforge.net/config_blocks.html -->
    <module name="EmptyBlock">
      <property name="option" value="text"/>
    </module>
    <module name="LeftCurly"/>
    <module name="NeedBraces"/>
    <module name="AvoidNestedBlocks"/>

    <!-- Class design -->
    <!-- http://checkstyle.sourceforge.net/config_design.html -->
    <module name="VisibilityModifier">
      <property name="protectedAllowed" value="true"/>
    </module>
    <module name="FinalClass"/>
    <module name="InterfaceIsType"/>
    <module name="HideUtilityClassConstructor"/>
    <module name="MutableException"/>

    <!-- Misc -->
    <!-- http://checkstyle.sourceforge.net/config_misc.html -->
    <module name="UncommentedMain"/>
    <module name="UpperEll"/>
    <module name="ArrayTypeStyle"/>
    <module name="OuterTypeFilename"/>

    <!-- Common coding problems -->
    <!-- http://checkstyle.sourceforge.net/config_coding.html -->
    <module name="CovariantEquals"/>
    <module name="EmptyStatement"/>
    <module name="EqualsAvoidNull"/>
    <module name="EqualsHashCode"/>
    <module name="HiddenField">
      <property name="ignoreSetter" value="true"/>
      <property name="ignoreConstructorParameter" value="true"/>
      <property name="ignoreAbstractMethods" value="true"/>
    </module>
    <module name="IllegalInstantiation"/>
    <module name="InnerAssignment"/>
    <module name="MissingSwitchDefault"/>
    <module name="ModifiedControlVariable"/>
    <module name="SimplifyBooleanExpression"/>
    <module name="SimplifyBooleanReturn"/>
    <module name="StringLiteralEquality"/>
    <module name="NoFinalizer"/>
    <module name="SuperClone"/>
    <module name="SuperFinalize"/>
    <module name="IllegalCatch"/>
    <module name="IllegalThrows"/>
    <module name="PackageDeclaration"/>
    <module name="IllegalType">
      <property name="tokens" value="METHOD_DEF,PARAMETER_DEF"/>
    </module>
    <module name="ParameterAssignment"/>
    <module name="ExplicitInitialization"/>
    <module name="DefaultComesLast"/>
    <module name="FallThrough"/>
    <module name="MultipleVariableDeclarations"/>
    <module name="OneStatementPerLine"/>

    <!-- Annotations -->
    <!-- http://checkstyle.sourceforge.net/config_annotation.html -->
    <module name="AnnotationUseStyle"/>
    <module name="MissingDeprecated"/>
    <module name="MissingOverride"/>

    <!-- Validate and check for missing javadocs on public and protected elements -->
    <!-- http://checkstyle.sourceforge.net/config_javadoc.html -->
    <module name="JavadocType">
      <property name="scope" value="public"/>
      <property name="allowMissingParamTags" value="true"/>
    </module>
    <module name="JavadocMethod">
      <property name="scope" value="public"/>
      <property name="allowMissingPropertyJavadoc" value="true"/>
      <property name="allowMissingThrowsTags" value="true"/>
      <property name="allowUndeclaredRTE" value="true"/>
      <property name="allowMissingParamTags" value="true"/>
      <property name="allowMissingReturnTag" value="true"/>
    </module>
    <module name="JavadocVariable">
      <property name="scope" value="public"/>
    </module>

    <!-- Allow suppression of checkstyle warnings -->
    <module name="SuppressionCommentFilter"/>

  </module>

  <!-- Size Violations -->
  <!-- http://checkstyle.sourceforge.net/config_sizes.html -->
  <module name="FileLength">
    <property name="max" value="4000"/>
  </module>

  <!-- Whitespaces -->
  <!-- http://checkstyle.sourceforge.net/config_whitespace.html -->
  <module name="FileTabCharacter"/>

  <!-- Misc -->
  <!-- http://checkstyle.sourceforge.net/config_misc.html -->
  <module name="Translation"/>

  <!-- External suppressions file -->
  <module name="SuppressionFilter">
    <property name="file" value="${checkstyle.suppressions.file}"/>
  </module>

</module>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy