config/checkstyle/checkstyle.xml
changeset 1 831cffa9c991
equal deleted inserted replaced
0:fef46dce2812 1:831cffa9c991
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!DOCTYPE module PUBLIC
       
     3   "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
       
     4   "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
       
     5 
       
     6 <!-- This is a checkstyle configuration file. For descriptions of
       
     7 what the following rules do, please see the checkstyle configuration
       
     8 page at http://checkstyle.sourceforge.net/config.html -->
       
     9 
       
    10 <module name="Checker">
       
    11 
       
    12   <!-- Checks whether files end with a new line.                        -->
       
    13   <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
       
    14   <module name="NewlineAtEndOfFile" />
       
    15 
       
    16   <!-- Checks that property files contain the same keys.         -->
       
    17   <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
       
    18   <module name="Translation" />
       
    19 
       
    20   <!-- Checks for Size Violations.                    -->
       
    21   <!-- See http://checkstyle.sf.net/config_sizes.html -->
       
    22   <module name="FileLength" />
       
    23 
       
    24   <!-- Checks for whitespace                               -->
       
    25   <!-- See http://checkstyle.sf.net/config_whitespace.html -->
       
    26   <module name="FileTabCharacter" />
       
    27 
       
    28   <!-- Miscellaneous other checks.                   -->
       
    29   <!-- See http://checkstyle.sf.net/config_misc.html -->
       
    30   <module name="RegexpSingleline">
       
    31     <property name="format" value="\s+$" />
       
    32     <property name="minimum" value="0" />
       
    33     <property name="maximum" value="0" />
       
    34     <property name="message" value="Line has trailing spaces." />
       
    35     <property name="severity" value="info" />
       
    36   </module>
       
    37 
       
    38   <module name="SuppressWarningsFilter"/>
       
    39 
       
    40   <module name="TreeWalker">
       
    41 
       
    42     <!-- Checks for Naming Conventions.                  -->
       
    43     <!-- See http://checkstyle.sf.net/config_naming.html -->
       
    44     <module name="ConstantName" />
       
    45     <module name="LocalFinalVariableName" />
       
    46     <module name="LocalVariableName" />
       
    47     <module name="MemberName" />
       
    48     <module name="MethodName" />
       
    49     <module name="PackageName" />
       
    50     <module name="ParameterName" />
       
    51     <module name="StaticVariableName" />
       
    52     <module name="TypeName" />
       
    53 
       
    54     <module name="SuppressWarningsHolder"/>
       
    55 
       
    56     <!-- Checks for imports                              -->
       
    57     <!-- See http://checkstyle.sf.net/config_import.html -->
       
    58     <module name="AvoidStarImport">
       
    59       <property name="allowStaticMemberImports" value="true" />
       
    60     </module>
       
    61     <module name="IllegalImport" />
       
    62     <!-- defaults to sun.* packages -->
       
    63     <module name="RedundantImport" />
       
    64     <module name="UnusedImports" />
       
    65     <module name="CustomImportOrder">
       
    66         <property name="thirdPartyPackageRegExp" value=".*"/>
       
    67         <property name="specialImportsRegExp" value="com.genymobile"/>
       
    68         <property name="separateLineBetweenGroups" value="true"/>
       
    69         <property name="customImportOrderRules" value="SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"/>
       
    70     </module>
       
    71 
       
    72 
       
    73     <!-- Checks for Size Violations.                    -->
       
    74     <!-- See http://checkstyle.sf.net/config_sizes.html -->
       
    75     <module name="LineLength">
       
    76       <!-- what is a good max value? -->
       
    77       <property name="max" value="150" />
       
    78       <!-- ignore lines like "$File: //depot/... $" -->
       
    79       <property name="ignorePattern" value="\$File.*\$" />
       
    80       <property name="severity" value="info" />
       
    81     </module>
       
    82     <module name="MethodLength" />
       
    83     <module name="ParameterNumber">
       
    84       <property name="ignoreOverriddenMethods" value="true"/>
       
    85     </module>
       
    86 
       
    87 
       
    88     <!-- Checks for whitespace                               -->
       
    89     <!-- See http://checkstyle.sf.net/config_whitespace.html -->
       
    90     <module name="EmptyForIteratorPad" />
       
    91     <module name="GenericWhitespace" />
       
    92     <module name="MethodParamPad" />
       
    93     <module name="NoWhitespaceAfter" />
       
    94     <module name="NoWhitespaceBefore" />
       
    95     <module name="OperatorWrap" />
       
    96     <module name="ParenPad" />
       
    97     <module name="TypecastParenPad" />
       
    98     <module name="WhitespaceAfter" />
       
    99     <module name="WhitespaceAround" />
       
   100 
       
   101     <!-- Modifier Checks                                    -->
       
   102     <!-- See http://checkstyle.sf.net/config_modifiers.html -->
       
   103     <module name="ModifierOrder" />
       
   104     <module name="RedundantModifier" />
       
   105 
       
   106 
       
   107     <!-- Checks for blocks. You know, those {}'s         -->
       
   108     <!-- See http://checkstyle.sf.net/config_blocks.html -->
       
   109     <module name="AvoidNestedBlocks" />
       
   110     <module name="EmptyBlock">
       
   111       <property name="option" value="text" />
       
   112     </module>
       
   113     <module name="LeftCurly" />
       
   114     <module name="NeedBraces" />
       
   115     <module name="RightCurly" />
       
   116 
       
   117 
       
   118     <!-- Checks for common coding problems               -->
       
   119     <!-- See http://checkstyle.sf.net/config_coding.html -->
       
   120     <!-- <module name="AvoidInlineConditionals"/> -->
       
   121     <module name="EmptyStatement" />
       
   122     <module name="EqualsHashCode" />
       
   123     <module name="HiddenField">
       
   124       <property name="tokens" value="VARIABLE_DEF" />
       
   125       <!-- only check variables not parameters -->
       
   126       <property name="ignoreConstructorParameter" value="true" />
       
   127       <property name="ignoreSetter" value="true" />
       
   128       <property name="severity" value="warning" />
       
   129     </module>
       
   130     <module name="IllegalInstantiation" />
       
   131     <module name="InnerAssignment" />
       
   132     <module name="MagicNumber">
       
   133       <property name="severity" value="info" />
       
   134       <property name="ignoreHashCodeMethod" value="true" />
       
   135       <property name="ignoreAnnotation" value="true" />
       
   136     </module>
       
   137     <module name="MissingSwitchDefault" />
       
   138     <module name="SimplifyBooleanExpression" />
       
   139     <module name="SimplifyBooleanReturn" />
       
   140 
       
   141     <!-- Checks for class design                         -->
       
   142     <!-- See http://checkstyle.sf.net/config_design.html -->
       
   143     <!-- <module name="DesignForExtension"/> -->
       
   144     <module name="FinalClass" />
       
   145     <module name="HideUtilityClassConstructor" />
       
   146     <module name="InterfaceIsType" />
       
   147     <module name="VisibilityModifier" />
       
   148 
       
   149 
       
   150     <!-- Miscellaneous other checks.                   -->
       
   151     <!-- See http://checkstyle.sf.net/config_misc.html -->
       
   152     <module name="ArrayTypeStyle" />
       
   153     <!-- <module name="FinalParameters"/> -->
       
   154     <module name="TodoComment">
       
   155       <property name="format" value="TODO" />
       
   156       <property name="severity" value="info" />
       
   157     </module>
       
   158     <module name="UpperEll" />
       
   159 
       
   160     <module name="FileContentsHolder" />
       
   161     <!-- Required by comment suppression filters -->
       
   162 
       
   163   </module>
       
   164 
       
   165   <module name="SuppressionFilter">
       
   166     <!--<property name="file" value="team-props/checkstyle/checkstyle-suppressions.xml" />-->
       
   167   </module>
       
   168 
       
   169   <!-- Enable suppression comments -->
       
   170   <module name="SuppressionCommentFilter">
       
   171     <property name="offCommentFormat" value="CHECKSTYLE IGNORE\s+(\S+)" />
       
   172     <property name="onCommentFormat" value="CHECKSTYLE END IGNORE\s+(\S+)" />
       
   173     <property name="checkFormat" value="$1" />
       
   174   </module>
       
   175   <module name="SuppressWithNearbyCommentFilter">
       
   176     <!-- Syntax is "SUPPRESS CHECKSTYLE name" -->
       
   177     <property name="commentFormat" value="SUPPRESS CHECKSTYLE (\w+)" />
       
   178     <property name="checkFormat" value="$1" />
       
   179     <property name="influenceFormat" value="1" />
       
   180   </module>
       
   181 
       
   182 </module>