-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathcheckstyle.xml
144 lines (120 loc) · 4.44 KB
/
checkstyle.xml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?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"/>
<!-- Checks that files end with a newline -->
<module name="NewlineAtEndOfFile">
<!-- Only accept Unix line separator -->
<property name="lineSeparator" value="lf"/>
</module>
<!-- Check for whitespace at the end of lines -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing whitespace"/>
</module>
<!-- Check for spaces before tabs -->
<module name="RegexpSingleline">
<property name="format" value=" +.*\t+"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has tabs after spaces"/>
</module>
<!-- Try to check for spaces before the end of array initializers -->
<module name="RegexpSingleline">
<!-- Only matches one line initializers -->
<property name="format" value="\{.*\s+\}"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has whitespace before end of array initializer"/>
</module>
<module name="RegexpSingleline">
<!-- Only matches one line initializers -->
<property name="format" value="(if|for|while)\s+\("/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Whitespace between for/if/while and ("/>
</module>
<module name="RegexpSingleline">
<!--
Match case conversion without a Locale. Use with Locale.getDefault() if you
really want to use the default locale.
-->
<property name="format" value="(toUpperCase|toLowerCase)\(\)"/>
</module>
<module name="RegexpSingleline">
<!--
Attempt to match SimpleDateFormat created with the default locale. This will
miss cases where the pattern includes a comma.
-->
<property name="format" value="new SimpleDateFormat(\(\)|\([^,]*\))"/>
</module>
<module name="RegexpSingleline">
<!--
Match getBytes() that uses the default charset. Use Charset.defaultCharset()
if you really want to use the default charset.
-->
<property name="format" value="getBytes\(\)"/>
</module>
<module name="TreeWalker">
<!-- Check for a few simple import problems -->
<module name="AvoidStarImport">
<property name="excludes" value="org.junit.Assert.*"/>
</module>
<module name="UnusedImports"/>
<!-- Avoid static imports except from some classes -->
<module name="AvoidStaticImport">
<property name="excludes" value="org.junit.Assert.*"/>
</module>
<!-- Blacklist for imports -->
<module name="IllegalImport">
<!--
sun.* - Sun implementation specific stuff
com.sun.* -
junit.* - jUnit 3 stuff, import from org.junit instead
-->
<property name="illegalPkgs" value="sun, com.sun, junit"/>
</module>
<!-- Whitespace checks -->
<module name="GenericWhitespace"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<!-- No whitespace before ; if for initializer is empty -->
<module name="EmptyForInitializerPad"/>
<!-- Force space after ; if for iterator is empty -->
<module name="EmptyForIteratorPad">
<property name="option" value="space"/>
</module>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA,SEMI"/>
</module>
<!--Check modifier order -->
<module name="ModifierOrder"/>
<!-- Check parameter count -->
<module name="ParameterNumber">
<property name="max" value="7"/>
</module>
<!-- Check for more than 1 outer type per file -->
<module name="OuterTypeNumber"/>
<!-- Check method count -->
<module name="MethodCount"/>
<!-- Check for equals(SomethingNotObject) without equals(Object) -->
<module name="CovariantEquals"/>
<!-- Check for empty statements -->
<module name="EmptyStatement"/>
<!-- Check that classes that override equals() also override hashCode() -->
<module name="EqualsHashCode"/>
<!-- Various code checks -->
<module name="IllegalInstantiation"/>
<module name="IllegalTokenText"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
</module>
</module>