Skip to content

Commit baa509a

Browse files
committed
CheckStyle: Add suppression filter for star imports in test classes.
Added a suppression filter that effectively allows star imports in test classes.
1 parent 4c220e1 commit baa509a

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

checkstyle.xml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,40 @@
88
-->
99
<module name="Checker">
1010
<property name="severity" value="error"/>
11+
12+
<!-- Supression filter to disable specified modules/checks for specified files -->
13+
<module name="SuppressionFilter">
14+
<property name="file" value="checkstyle_suppressions.xml"/>
15+
<property name="optional" value="false"/>
16+
</module>
17+
1118
<module name="TreeWalker">
1219

13-
<!-- Line length <= 120 characters. -->
20+
<!-- Line length <= 120 characters -->
1421
<module name="LineLength">
15-
<property name="severity" value="ignore"/> <!-- TODO: Change to "error" once the >7000 violations have been resolved. -->
22+
<property name="severity" value="ignore"/> <!-- TODO: Change to "error" once the >7000 violations have been resolved -->
1623
<property name="max" value="120"/>
1724
</module>
1825

19-
<!-- Indent must use tab characters. -->
26+
<!-- Indent must use tab characters -->
2027
<module name="RegexpSinglelineJava">
21-
<property name="format" value="^\t* ([^\*]|$)"/> <!-- Javadoc and multiline comments have a single leading whitespace, so allow " *". -->
28+
<property name="format" value="^\t* ([^\*]|$)"/> <!-- Javadoc and multiline comments have a single leading whitespace, so allow " *" -->
2229
<property name="message" value="Indent must use tab characters"/>
2330
<property name="ignoreComments" value="false"/>
2431
</module>
2532

26-
<!-- Disallow package.* imports. -->
33+
<!-- Disallow package.* imports -->
2734
<module name="AvoidStarImport"/>
2835

29-
<!-- Disallow whitespaces after '(' and before ')'. -->
36+
<!-- Disallow whitespaces after '(' and before ')' -->
3037
<module name="ParenPad"/>
3138

3239
</module>
3340

34-
<!-- Disallow trailing whitespaces/tabs. -->
41+
<!-- Disallow trailing whitespaces/tabs -->
3542
<module name="RegexpSingleline">
3643
<property name="severity" value="error"/>
37-
<property name="format" value="(?&lt;! \*)\s+$"/> <!-- Empty javadoc and multiline comment lines have a single trailing whitespace, so allow " * ". -->
44+
<property name="format" value="(?&lt;! \*)\s+$"/> <!-- Empty javadoc and multiline comment lines have a single trailing whitespace, so allow " * " -->
3845
<property name="message" value="Line has trailing whitespaces/tabs."/>
3946
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
4047
</module>

checkstyle_suppressions.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
3+
4+
<suppressions>
5+
6+
<!-- Allow star imports in "...Test.java" files -->
7+
<suppress checks="AvoidStarImport" files=".*Test\.java$"/>
8+
9+
</suppressions>

0 commit comments

Comments
 (0)