blob: 1afa13ddace3d3feb4d94ce7bb74ce80ab58b226 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
/***********************************************************************************************************************
* Copyright (c) 2008 empolis GmbH and brox IT Solutions GmbH. All rights reserved. This program and the accompanying
* materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Ralf Rausch (brox IT Solutions GmbH) - initial creator
**********************************************************************************************************************/
-->
<!-- Brox Code Convention Checks -->
<!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="warning"/>
<property name="localeCountry" value="EN"/>
<property name="localeLanguage" value="en"/>
<module name="SuppressionCommentFilter" />
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<!-- Any source files and text files in general should end with a newline character. -->
<module name="NewlineAtEndOfFile" />
<!-- Classes over 1500 lines will be marked for review. -->
<module name="FileLength">
<property name="max" value="1500" />
</module>
<!-- Special characters like TAB and page break must be avoided. -->
<module name="FileTabCharacter" />
<module name="TreeWalker">
<module name="FileContentsHolder" />
<!-- ========== Naming Conventions ========== -->
<!-- Names representing constants (final variables) must be all uppercase using underscore to separate words -->
<module name="ConstantName" />
<!-- Variable names must be in mixed case starting with lower case. -->
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<!-- Names representing methods must be verbs and written in mixed case starting with lower case.
Test checkstyle: allow '_' for type names -->
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="ParameterName" />
<!-- (last part) Static private variables should have prefix s_. -->
<module name="StaticVariableName">
<property name="format" value="^s_[a-z][a-zA-Z0-9]*$" />
</module>
<!-- Names representing types must be nouns and written in mixed case starting with upper case.
Test checkstyle: allow '_' for type names -->
<module name="TypeName">
<property name="format" value="^[A-Z][a-zA-Z0-9_]*$"/>
</module>
<!-- Names representing packages should be in all lower case, using a reverse domain name. -->
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$" />
</module>
<!-- (first part) Member/class variables should have underscore prefix. -->
<module name="MemberName">
<property name="applyToPublic" value="true" />
<property name="applyToProtected" value="true" />
<property name="applyToPackage" value="true" />
<property name="applyToPrivate" value="true" />
<property name="format" value="^_[a-z][a-zA-Z0-9]*$" />
</module>
<!-- Files -->
<!-- The incompleteness of split lines must be made obvious. (partially) -->
<module name="OperatorWrap">
<property name="option" value="nl" />
</module>
<!-- ========== Methods and Statements ========== -->
<!-- Checks for imports -->
<!-- Package and Import Statements, 1. The package statement must be the first statement of the file. All files should belong to a specific package. -->
<module name="PackageDeclaration" />
<!-- Package and Import Statements, 3. Imported classes should always be listed explicitly -->
<module name="AvoidStarImport" />
<module name="IllegalImport" /><!-- defaults to sun.* packages -->
<module name="RedundantImport" />
<module name="UnusedImports" />
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifier.html -->
<!-- Methods, 1. Method modifiers should be given in the following order:
<access> static abstract synchronized <unusual> final native
The <access> modifier (if present) must be the first modifier. -->
<module name="ModifierOrder" />
<module name="RedundantModifier" />
<!-- Types, Array specifiers must be attached to the type not the variable -->
<module name="ArrayTypeStyle" />
<!-- deactivated for test checkstyle -->
<!--<module name="MagicNumber" />-->
<!-- Classes and Interfaces, 1. Class and Interface declarations should be organized in the following manner: [skip] -->
<module name="DeclarationOrder" />
<!-- Miscellaneous, Floating point constants should always be written with decimal point and at least one decimal. -->
<module name="IllegalTokenText">
<property name="tokens" value="NUM_FLOAT,NUM_DOUBLE" />
<property name="format" value="^\." />
<property name="ignoreCase" value="true" />
<property name="message" value="Floating point constants should always be written with a digit before the decimal point." />
</module>
<!-- ========== Layout ========== -->
<!-- Basic indentation should be 2. -->
<module name="Indentation">
<property name="basicOffset" value="2" />
<property name="braceAdjustment" value="0" />
<property name="caseIndent" value="2" />
</module>
<!-- Checks for Block layout -->
<module name="AvoidNestedBlocks" />
<module name="EmptyBlock">
<property name="tokens"
value="LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF, LITERAL_TRY, LITERAL_WHILE" />
</module>
<module name="LeftCurly" />
<module name="RightCurly" />
<module name="NeedBraces" />
<!-- Checks for switch statement -->
<module name="FallThrough">
<property name="reliefPattern" value="Fallthrough" />
</module>
<module name="MissingSwitchDefault" />
<module name="DefaultComesLast" />
<!-- Checks for white spaces -->
<module name="MethodParamPad" />
<module name="ParenPad" />
<module name="TypecastParenPad" />
<module name="NoWhitespaceAfter">
<!-- Default tokens and additional GENERIC_START -->
<property name="tokens"
value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS, GENERIC_START" />
</module>
<module name="NoWhitespaceBefore">
<!-- Default tokens and additional GENERIC_START
and GENERIC_END -->
<property name="tokens"
value="SEMI, POST_DEC, POST_INC, GENERIC_START, GENERIC_END" />
</module>
<module name="WhitespaceAfter">
<!-- Default tokens and additional GENERIC_END -->
<property name="tokens"
value="COMMA, SEMI, TYPECAST, GENERIC_END" />
</module>
<module name="WhitespaceAround">
<!-- Default tokens without GENERIC_START and
GENERIC_END -->
<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>
<!-- Checks for Size Violations. -->
<!-- Methods and constructors should not exceed 7 parameters, including variable arguments. (Reduce with accessors). -->
<module name="ParameterNumber" />
<!-- Maximum line length is 120 -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<!-- ========== Javadoc Comments ========== -->
<!-- see http://checkstyle.sourceforge.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="logLoadErrors" value="true"/>
<property name="suppressLoadErrors" value="true"/>
<property name="scope" value="private"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="JavadocType"/>
<!-- deactivated for test checkstyle -->
<!--<module name="JavadocVariable"/>-->
<module name="JavadocStyle"/>
<!-- ========== Coding problems ========== -->
<!-- see http://checkstyle.sourceforge.net/config_coding.html -->
<module name="CovariantEquals" />
<module name="EqualsHashCode" />
<module name="FinalLocalVariable" />
<module name="HiddenField" />
<module name="IllegalInstantiation">
<property name="classes" value="java.lang.Boolean" />
</module>
<module name="InnerAssignment" />
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<module name="SuperClone" />
<module name="SuperFinalize" />
<module name="IllegalThrows" />
<module name="ExplicitInitialization" />
<module name="MultipleVariableDeclarations" />
<!-- ========== Class design ========== -->
<!-- see http://checkstyle.sourceforge.net/config_design.html -->
<module name="FinalClass" />
<module name="HideUtilityClassConstructor" />
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module>
<!-- ========== Metrics ========== -->
<!-- http://checkstyle.sourceforge.net/config_metrics.html -->
<!-- deactivated for test checkstyle -->
<!--
<module name="CyclomaticComplexity">
<property name="max" value="12"/>
</module>
<module name="NPathComplexity">
<property name="max" value="200"/>
</module>
-->
</module>
</module>