• JAVA开发CHECK STYLE


      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
      3 
      4 <module name="Checker">
      5 <module name="SuppressionCommentFilter"/>
      6 
      7 <!-- Size Violations Begin-->
      8 <!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
      9 <module name="FileLength">
     10 <property name="severity" value="warning"/>
     11 <property name="max" value="1500"/><!-- Default 2000 -->
     12 <property name="fileExtensions" value="java"/>
     13 </module>
     14 <!-- Size Violations End-->
     15 
     16 <module name="TreeWalker">
     17 <module name="FileContentsHolder"/>
     18 
     19 <!-- Javadoc Comments Begin -->
     20 <!-- See http://checkstyle.sf.net/config_javadoc.html -->
     21 <module name="JavadocMethod">
     22 <property name="allowMissingParamTags" value="true"/>
     23 <property name="allowMissingThrowsTags" value="true"/>
     24 <property name="allowMissingReturnTag" value="true"/>
     25 <property name="allowMissingJavadoc" value="true"/>
     26 <property name="logLoadErrors" value="true"/>
     27 <property name="suppressLoadErrors" value="true"/>
     28 </module>
     29 <!-- Javadoc Comments End -->
     30 
     31 
     32 <!-- Naming Conventions Begin -->
     33 <!-- See http://checkstyle.sourceforge.net/config_naming.html -->
     34 <module name="ConstantName"/>
     35 <module name="LocalFinalVariableName"/>
     36 <module name="LocalVariableName"/>
     37 <module name="MemberName"/>
     38 <module name="MethodName"/>
     39 <module name="PackageName"/>
     40 <module name="ParameterName"/>
     41 <module name="StaticVariableName"/>
     42 <!-- Naming Conventions End -->
     43 
     44 
     45 <!-- Imports Begin -->
     46 <!-- See http://checkstyle.sourceforge.net/config_imports.html#UnusedImports -->
     47 <module name="UnusedImports"/>
     48 <module name="AvoidStarImport">
     49 <!-- <property name="excludes" value="java.io,java.net,java.lang.Math"/>-->
     50 <property name="allowClassImports" value="false"/>
     51 <property name="allowStaticMemberImports" value="false"/>
     52 </module>
     53 <module name="IllegalImport">
     54 <!--<property name="illegalPkgs" value="java.io, java.sql"/>--><!-- defaults to sun.* packages -->
     55 </module>
     56 <module name="RedundantImport"/>
     57 <!-- Imports End -->
     58 
     59 
     60 <!-- Size Violations Begin-->
     61 <!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
     62 <!--<module name="AnonInnerLength">
     63 <property name="severity" value="warning"/>
     64 <property name="max" value="50"/>
     65 </module>--><!-- Default 20 -->
     66 <module name="MethodLength">
     67 <property name="max" value="150"/><!-- Default 150 -->
     68 <property name="countEmpty" value="false"/>
     69 </module>
     70 <!--<module name="ParameterNumber">
     71 <property name="severity" value="warning"/>
     72 <property name="max" value="7"/>
     73 </module>--><!-- Default 7 -->
     74 <!-- Size Violations End-->
     75 
     76 
     77 <!-- Whitespace Begin-->
     78 <!-- See http://checkstyle.sf.net/config_whitespace.html -->
     79 <module name="EmptyForIteratorPad"/>
     80 <module name="MethodParamPad"/>
     81 <module name="NoWhitespaceAfter"/>
     82 <module name="NoWhitespaceBefore"/>
     83 <module name="OperatorWrap"/>
     84 <module name="ParenPad"/>
     85 <module name="TypecastParenPad"/>
     86 <module name="WhitespaceAfter"/>
     87 <module name="WhitespaceAround"/>
     88 <!-- Whitespace End-->
     89 
     90 
     91 <!-- Modifiers Begin -->
     92 <!-- See http://checkstyle.sourceforge.net/config_modifier.html#ModifierOrder -->
     93 <!--<module name="ModifierOrder">
     94 <property name="severity" value="info"/>
     95 </module>-->
     96 <module name="RedundantModifier"/>
     97 <!-- Modifiers End -->
     98 
     99 
    100 <!-- Blocks Begin -->
    101 <!-- See checkstyle.sourceforge.net/config_blocks.html#AvoidNestedBlocks -->
    102 <module name="AvoidNestedBlocks"/>
    103 <module name="NeedBraces"/>
    104 <module name="EmptyBlock"/>    
    105 <module name="LeftCurly">
    106 <property name="option" value="eol"/><!-- Default eol --><!-- The brace must always be on the end of the line. -->
    107 </module>
    108 <module name="RightCurly"/>    
    109 <!-- Blocks End -->
    110 
    111 
    112 <!-- Coding Begin -->
    113 <!-- See http://checkstyle.sourceforge.net/config_coding.html -->
    114 <module name="DefaultComesLast"/>
    115 <module name="DeclarationOrder"/>
    116 <module name="EmptyStatement"/>
    117 <module name="EqualsAvoidNull"/>
    118 <module name="EqualsHashCode"/>
    119 <module name="HiddenField">
    120 <property name="tokens" value="VARIABLE_DEF"/>
    121 <property name="ignoreConstructorParameter" value="true"/>
    122 <property name="ignoreSetter" value="true"/>
    123 <property name="ignoreAbstractMethods" value="true"/>
    124 </module>
    125 <module name="IllegalInstantiation"/>
    126 <module name="IllegalThrows">
    127 <property name="illegalClassNames" value="java.lang.Error, java.lang.RuntimeException"/>
    128 </module>
    129 <module name="InnerAssignment"/>
    130 <module name="ModifiedControlVariable"/>
    131 <module name="NestedIfDepth">
    132 <property name="max" value="4"/>
    133 </module>
    134 <!--<module name="NestedTryDepth">
    135 <property name="severity" value="warning"/>
    136 <property name="max" value="1"/>
    137 </module>--><!-- Default 1 -->
    138 <!--<module name="ParameterAssignment"/>-->
    139 <module name="SimplifyBooleanExpression"/>
    140 <module name="SimplifyBooleanReturn"/>
    141 <module name="NestedForDepth">
    142 <property name="max" value="3"/>
    143 </module><!-- Default 1 -->
    144 <module name="UnnecessaryParentheses"/>
    145 <module name="OneStatementPerLine"/>
    146 <!-- Coding End -->
    147 
    148 
    149 <!-- Class Design Begin -->
    150 <!-- See http://checkstyle.sourceforge.net/config_design.html -->
    151 <module name="FinalClass"/>
    152 <module name="VisibilityModifier">
    153 <property name="protectedAllowed" value="true"/>
    154 </module>
    155 <!-- Class Design End -->
    156 <!-- Metrics Begin -->
    157 <!-- See http://checkstyle.sourceforge.net/config_metrics.html -->
    158 <!--<module name="BooleanExpressionComplexity">
    159 <property name="severity" value="warning"/>
    160 <property name="max" value="3"/>
    161 </module>--><!-- Default 3 -->
    162 <!--<module name="CyclomaticComplexity">
    163 <property name="severity" value="warning"/>
    164 <property name="max" value="7"/>
    165 </module>--><!-- Default 10 -->
    166 <!-- Metrics End -->    
    167 
    168 
    169 <!-- Miscellaneous Begin -->
    170 <module name="ArrayTypeStyle">
    171 <property name="javaStyle" value="true"/>
    172 </module>
    173 <!-- Miscellaneous End -->
    174 </module>
    175 </module>
  • 相关阅读:
    正则表达式
    前端开发工程师
    前端开发工程师
    Java开发工程师(Web方向)
    Java开发工程师(Web方向)
    Java开发工程师(Web方向)
    Java开发工程师(Web方向)
    Java开发工程师(Web方向)
    前端开发工程师
    前端开发工程师
  • 原文地址:https://www.cnblogs.com/liugang/p/6083722.html
Copyright © 2020-2023  润新知