Enable 1 line comment checkstyle suppression
- See http://checkstyle.sourceforge.net/config.html#SuppressWithNearbyCommentFilter
Change-Id: I2c46c94cb118775423ea0b25bc28a02659c77536
diff --git a/conf/checkstyle/sun_checks.xml b/conf/checkstyle/sun_checks.xml
index 5858af8..d585dac 100644
--- a/conf/checkstyle/sun_checks.xml
+++ b/conf/checkstyle/sun_checks.xml
@@ -95,6 +95,20 @@
<property name="offCommentFormat" value="(CHECKSTYLE\:OFF|Generated by the protocol buffer compiler.)"/>
<property name="onCommentFormat" value="CHECKSTYLE:ON"/>
</module>
+
+ <module name="SuppressWithNearbyCommentFilter">
+ <property name="commentFormat" value="CHECKSTYLE IGNORE THIS LINE" />
+ <property name="checkFormat" value=".*" />
+ <property name="influenceFormat" value="0" />
+ </module>
+
+ <!-- Example: // CHECKSTYLE IGNORE FinalClass FOR NEXT 1 LINES -->
+ <module name="SuppressWithNearbyCommentFilter">
+ <property name="commentFormat" value="CHECKSTYLE IGNORE (\w+) FOR NEXT (\d+) LINES"/>
+ <property name="checkFormat" value="$1"/>
+ <property name="influenceFormat" value="$2"/>
+ </module>
+
<module name="TreeWalker">
<module name="FileContentsHolder"/>
@@ -114,7 +128,6 @@
</module>
<module name="JavadocStyle"/>
-
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName">
diff --git a/src/test/java/net/onrc/onos/core/util/ImmutableClassCheckerTest.java b/src/test/java/net/onrc/onos/core/util/ImmutableClassCheckerTest.java
index 7471a07..db5cf58 100644
--- a/src/test/java/net/onrc/onos/core/util/ImmutableClassCheckerTest.java
+++ b/src/test/java/net/onrc/onos/core/util/ImmutableClassCheckerTest.java
@@ -12,14 +12,13 @@
* checker.
*/
public class ImmutableClassCheckerTest {
- // CHECKSTYLE:OFF test data intentionally not final
/**
* Test class for non final class check.
*/
+ // CHECKSTYLE IGNORE FinalClass FOR NEXT 1 LINES
static class NonFinal {
private NonFinal() { }
}
- // CHECKSTYLE:ON
/**
* Check that a non final class correctly produces an error.