Skip to content

Commit 149af9c

Browse files
authored
ci: add Checkstyle properties file (#216)
* ci: add Checkstyle properties file
1 parent 5dd2ce0 commit 149af9c

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
<!--Refer http://checkstyle.sourceforge.net/reports/google-java-style.html#s2.2-file-encoding -->
6+
<module name="Checker">
7+
8+
<property name="localeLanguage" value="en"/>
9+
10+
<!--To configure the check to report on the first instance in each file-->
11+
<module name="FileTabCharacter"/>
12+
13+
14+
<module name="RegexpSingleline">
15+
<property name="format" value="System\.out\.println"/>
16+
<property name="message" value="Prohibit invoking System.out.println in source code !"/>
17+
</module>
18+
19+
<module name="RegexpSingleline">
20+
<property name="format" value="//FIXME"/>
21+
<property name="message" value="Recommended fix FIXME task !"/>
22+
</module>
23+
24+
<module name="RegexpSingleline">
25+
<property name="format" value="//TODO"/>
26+
<property name="message" value="Recommended fix TODO task !"/>
27+
</module>
28+
29+
<module name="RegexpSingleline">
30+
<property name="format" value="@taobao"/>
31+
<property name="message" value="Recommended remove @taobao keyword!"/>
32+
</module>
33+
34+
<module name="RegexpSingleline">
35+
<property name="format"
36+
value=".*[\u3400-\u4DB5\u4E00-\u9FA5\u9FA6-\u9FBB\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9\uFF00-\uFFEF\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF]+.*"/>
37+
<property name="message" value="Not allow chinese character !"/>
38+
</module>
39+
40+
<module name="FileLength">
41+
<property name="max" value="3000"/>
42+
</module>
43+
44+
<module name="TreeWalker">
45+
<module name="RedundantImport"/>
46+
47+
<!--<module name="IllegalImport" />-->
48+
49+
<!--Checks that classes that override equals() also override hashCode()-->
50+
<module name="EqualsHashCode"/>
51+
<!--Checks for over-complicated boolean expressions. Currently finds code like if (topic == true), topic || true, !false, etc.-->
52+
<module name="SimplifyBooleanExpression"/>
53+
<module name="OneStatementPerLine"/>
54+
<module name="UnnecessaryParentheses"/>
55+
<!--Checks for over-complicated boolean return statements. For example the following code-->
56+
<module name="SimplifyBooleanReturn"/>
57+
58+
<!--Check that the default is after all the cases in producerGroup switch statement-->
59+
<module name="DefaultComesLast"/>
60+
<!--Detects empty statements (standalone ";" semicolon)-->
61+
<module name="EmptyStatement"/>
62+
<!--Checks that long constants are defined with an upper ell-->
63+
<module name="UpperEll"/>
64+
<module name="ConstantName">
65+
<property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)|(^log$)"/>
66+
</module>
67+
<!--Checks that local, non-final variable names conform to producerGroup format specified by the format property-->
68+
<module name="LocalVariableName"/>
69+
<!--Validates identifiers for local, final variables, including catch parameters-->
70+
<module name="LocalFinalVariableName"/>
71+
<!--Validates identifiers for non-static fields-->
72+
<module name="MemberName"/>
73+
<!--Validates identifiers for class type parameters-->
74+
<module name="ClassTypeParameterName">
75+
<property name="format" value="^[A-Z0-9]*$"/>
76+
</module>
77+
<!--Validates identifiers for method type parameters-->
78+
<module name="MethodTypeParameterName">
79+
<property name="format" value="^[A-Z0-9]*$"/>
80+
</module>
81+
<module name="PackageName"/>
82+
<module name="ParameterName"/>
83+
<module name="StaticVariableName">
84+
<property name="format" value="^[a-zA-Z0-9_]*$"/>
85+
</module>
86+
<module name="TypeName"/>
87+
<!--Checks that there are no import statements that use the * notation-->
88+
<module name="AvoidStarImport"/>
89+
<!-- unused imports -->
90+
<module name="UnusedImports"/>
91+
92+
<!--whitespace-->
93+
<module name="GenericWhitespace"/>
94+
<!--<module name="NoWhitespaceBefore"/>-->
95+
<!--<module name="NoWhitespaceAfter"/>-->
96+
<module name="WhitespaceAround">
97+
<property name="allowEmptyConstructors" value="true"/>
98+
<property name="allowEmptyMethods" value="true"/>
99+
</module>
100+
<module name="Indentation"/>
101+
<module name="MethodParamPad"/>
102+
<module name="ParenPad"/>
103+
<module name="TypecastParenPad"/>
104+
</module>
105+
</module>

0 commit comments

Comments
 (0)