Skip to content

Commit f38062b

Browse files
pbludovromani
authored andcommitted
Issue #329: config to validate imports
1 parent 44c5bff commit f38062b

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5+
6+
<module name="Checker">
7+
<property name="charset" value="UTF-8"/>
8+
9+
<!-- do not change severity to 'error', as that will hide errors caused by exceptions -->
10+
<property name="severity" value="warning"/>
11+
12+
<!-- BeforeExecutionFileFilters is required for sources of java9 -->
13+
<module name="BeforeExecutionExclusionFileFilter">
14+
<property name="fileNamePattern" value="module\-info\.java$" />
15+
</module>
16+
17+
<module name="TreeWalker">
18+
<module name="ImportOrder">
19+
<property name="caseSensitive" value="true" />
20+
<property name="groups" value="" />
21+
<property name="option" value="top" />
22+
<property name="ordered" value="true" />
23+
<property name="separated" value="true" />
24+
<property name="sortStaticImportsAlphabetically" value="true" />
25+
<property name="staticGroups" value="" />
26+
<property name="useContainerOrderingForStatic" value="false" />
27+
</module>
28+
<module name="CustomImportOrder">
29+
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE" />
30+
<property name="standardPackageRegExp" value="^(java|javax)\." />
31+
<property name="thirdPartyPackageRegExp" value=".*" />
32+
<property name="specialImportsRegExp" value="^$" />
33+
<property name="separateLineBetweenGroups" value="true" />
34+
<property name="sortImportsInGroupAlphabetically" value="true" />
35+
</module>
36+
</module>
37+
</module>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5+
6+
<module name="Checker">
7+
<property name="charset" value="UTF-8"/>
8+
9+
<!-- do not change severity to 'error', as that will hide errors caused by exceptions -->
10+
<property name="severity" value="warning"/>
11+
12+
<!-- BeforeExecutionFileFilters is required for sources of java9 -->
13+
<module name="BeforeExecutionExclusionFileFilter">
14+
<property name="fileNamePattern" value="module\-info\.java$" />
15+
</module>
16+
17+
<module name="TreeWalker">
18+
<module name="ImportOrder">
19+
<property name="caseSensitive" value="true" />
20+
<property name="groups" value="org,java" />
21+
<property name="option" value="top" />
22+
<property name="ordered" value="true" />
23+
<property name="separated" value="true" />
24+
<property name="sortStaticImportsAlphabetically" value="true" />
25+
<property name="staticGroups" value="" />
26+
<property name="useContainerOrderingForStatic" value="false" />
27+
</module>
28+
<module name="CustomImportOrder">
29+
<property name="customImportOrderRules"
30+
value="STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE" />
31+
<property name="standardPackageRegExp" value="^(org|java)\." />
32+
<property name="thirdPartyPackageRegExp" value=".*" />
33+
<property name="specialImportsRegExp" value="^$" />
34+
<property name="separateLineBetweenGroups" value="true" />
35+
<property name="sortImportsInGroupAlphabetically" value="true" />
36+
</module>
37+
</module>
38+
</module>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# List of GIT repositories to clone / pull for checking with Checkstyle
2+
# File format: REPO_NAME|[github|git|hg]|REPO_GIT_URL|[COMMIT_ID]|[EXCLUDE FOLDERS]
3+
# Please note that bash comments works in this file
4+
5+
# option=TOP separated=true
6+
guava|git|https://github.com/google/guava|v25.0|guava/guava-gwt/test/com/google/common/GwtTestSuite.java|
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# List of GIT repositories to clone / pull for checking with Checkstyle
2+
# File format: REPO_NAME|[github|git|hg]|REPO_GIT_URL|[COMMIT_ID]|[EXCLUDE FOLDERS]
3+
# Please note that bash comments works in this file
4+
5+
# option=TOP separated=true groups=org,java staticGroups=org,java
6+
java-design-patterns|git|https://github.com/iluwatar/java-design-patterns|dd855a376bc025aa61f6816584f79eb9854fe5d7||

0 commit comments

Comments
 (0)