icard-codestyle.xml
3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0"?>
<!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="charset" value="UTF-8" />
<property name="severity" value="warning"/>
<module name="FileLength">
<property name="max" value="2000"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="System\.(out)|(err)\.print(ln)?\("/>
</module>
<module name="TreeWalker">
<!-- 检测header -->
<!-- <module name="Header">
<property name="header"
value="// Copyright (C) 2014 DiLi All rights reserved" />
</module> -->
<property name="tabWidth" value="4"/>
<!-- 检测import -->
<module name="AvoidStarImport"/>
<module name="UnusedImports"/>
<!-- 代码块级别检测 -->
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="LeftCurly">
<property name="option" value="nl"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF"/>
</module>
<module name="RightCurly"/>
<module name="NeedBraces"/>
<!-- naming -->
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<module name="TypeName"/>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
</module>
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<!-- annotation -->
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<!-- coding -->
<module name="DeclarationOrder"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="MagicNumber">
<property name="tokens" value="NUM_DOUBLE, NUM_FLOAT"/>
<property name="ignoreNumbers" value="-1,0,1,2,4,8,16,32"/>
<property name="ignoreAnnotation" value="true"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="ModifierOrder"/>
<!-- size -->
<module name="LineLength">
<property name="max" value="140"/>
</module>
<!-- 空格检测 -->
<module name="GenericWhitespace"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA"/>
</module>
<module name="MethodParamPad"/>
<module name="TypecastParenPad"/>
<!-- 代码缩进 -->
<module name="Indentation"/>
<!-- other -->
<module name="UncommentedMain"/>
<module name="ArrayTypeStyle" />
<module name="UpperEll" />
</module>
</module>