-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
import-control-test.xml
50 lines (42 loc) · 1.5 KB
/
import-control-test.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
<?xml version="1.0"?>
<!DOCTYPE import-control PUBLIC
"-//Checkstyle//DTD ImportControl Configuration 1.4//EN"
"https://checkstyle.org/dtds/import_control_1_4.dtd">
<import-control
pkg="(|
|com\.puppycrawl\.tools\.checkstyle|
|com\.google\.checkstyle\.test|
|com\.sun\.checkstyle\.test|
|org\.checkstyle.*)"
regex="true">
<!-- Disallow obsolete Junit API -->
<disallow pkg="org.junit" exact-match="true"/>
<disallow pkg="junit.framework" />
<!-- until https://github.com/checkstyle/checkstyle/issues/9142 -->
<disallow pkg="org.junit.jupiter.api.Assertions"/>
<!-- Reflection shouldn't be used in tests. -->
<disallow pkg="java\.lang\.reflect\.*" regex="true" />
<allow pkg=".*" regex="true" />
<subpackage name="api">
<file name="AutomaticBeanTest">
<!-- Catches InvocationTargetException. -->
<allow class="java.lang.reflect.InvocationTargetException" />
</file>
</subpackage>
<subpackage name="internal">
<subpackage name="utils">
<file name="CheckUtil">
<!-- Uses reflection to collect violation messages. -->
<allow class="java.lang.reflect.Field" />
</file>
<file name="TestUtil">
<!-- All reflection usage should be in this class. -->
<allow pkg="java.lang.reflect" />
</file>
</subpackage>
</subpackage>
<file name="JavaAstVisitorTest">
<!-- Uses reflection to validate method order. -->
<allow pkg="java.lang.reflect" />
</file>
</import-control>