Skip to content

Commit 75ce7d3

Browse files
committed
Add checkstyle suppressions, allow empty blocks with text.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/trunk@1439955 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1b1ac53 commit 75ce7d3

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
<configLocation>${basedir}/src/conf/checkstyle.xml</configLocation>
221221
<enableRulesSummary>false</enableRulesSummary>
222222
<headerLocation>${basedir}/src/conf/HEADER.txt</headerLocation>
223+
<suppressionsLocation>${basedir}/src/conf/checkstyle-suppressions.xml</suppressionsLocation>
223224
</configuration>
224225
<reportSets>
225226
<reportSet>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
3+
4+
<suppressions>
5+
6+
<!-- Suppress visibility check of some member fields as they have to be kept
7+
for backwards compatibility reasons -->
8+
<suppress checks="VisibilityModifier" files="HelpFormatter.java" />
9+
10+
</suppressions>

src/conf/checkstyle.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ limitations under the License.
4747
</module>
4848

4949
<!-- Exceptions -->
50-
<!--
5150
<module name="SuppressionFilter">
52-
<property name="file" value="conf/checkstyle-suppressions.xml"/>
51+
<property name="file" value="${checkstyle.suppressions.file}"/>
5352
</module>
54-
-->
5553

5654
<module name="FileTabCharacter">
5755
<property name="eachLine" value="true"/>
@@ -117,18 +115,17 @@ limitations under the License.
117115
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"/>
118116
</module>
119117

120-
121-
122118
<!-- Modifier Checks -->
123119
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
124120
<module name="ModifierOrder"/>
125121
<module name="RedundantModifier"/>
126122

127-
128123
<!-- Checks for blocks. You know, those {}'s -->
129124
<!-- See http://checkstyle.sf.net/config_blocks.html -->
130125
<module name="AvoidNestedBlocks"/>
131-
<module name="EmptyBlock"/>
126+
<module name="EmptyBlock">
127+
<property name="option" value="text"/>
128+
</module>
132129
<module name="LeftCurly">
133130
<property name="option" value="nl"/>
134131
</module>
@@ -137,7 +134,6 @@ limitations under the License.
137134
<property name="option" value="alone"/>
138135
</module>
139136

140-
141137
<!-- Checks for common coding problems -->
142138
<!-- See http://checkstyle.sf.net/config_coding.html -->
143139
<module name="CovariantEquals"/>
@@ -172,8 +168,6 @@ limitations under the License.
172168
<property name="protectedAllowed" value="true"/>
173169
</module>
174170

175-
176-
177171
<!-- Miscellaneous other checks. -->
178172
<!-- See http://checkstyle.sf.net/config_misc.html -->
179173
<module name="ArrayTypeStyle"/>

0 commit comments

Comments
 (0)