Checkstyle suppressions XML to completely avoid checking target/ 15/48715/1
authorMichael Vorburger <vorburger@redhat.com>
Fri, 25 Nov 2016 19:43:46 +0000 (20:43 +0100)
committerMichael Vorburger <vorburger@redhat.com>
Fri, 25 Nov 2016 19:43:46 +0000 (20:43 +0100)
This is the only reliably way that I found to avoid checking generated
code and resources.  See also e.g.
http://stackoverflow.com/questions/2362652/excluding-classes-in-maven-checkstyle-plugin-reports
and my comment on that page.

Change-Id: I8b2ec5ee6d46dc108e781031996a1022b8c5330a
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
checkstyle/src/main/resources/checkstyle-suppressions.xml [new file with mode: 0644]
checkstyle/src/main/resources/odl_checks.xml
odlparent/pom.xml

diff --git a/checkstyle/src/main/resources/checkstyle-suppressions.xml b/checkstyle/src/main/resources/checkstyle-suppressions.xml
new file mode 100644 (file)
index 0000000..4d2bad0
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE suppressions PUBLIC
+    "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+    "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+<!--
+ Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<suppressions>
+
+    <suppress files="[/\\]target[/\\]" checks=".*"/>
+
+</suppressions>
index a84bee2891f280906b78c6e193e68b7e8b9bb219..e51057a634f46a847c92e3f0ef3289d6dad06b91 100644 (file)
@@ -19,6 +19,9 @@
         <property name="format" value="(\r\n|\r)"/>
         <property name="message" value="Line has Windows line delimiter."/>
     </module>
+    <module name="SuppressionFilter">
+        <property name="file" value="${checkstyle.suppressions.file}" />
+    </module>
     <module name="SuppressWarningsFilter"/>
     <module name="TreeWalker">
         <module name="RegexpSinglelineJava">
index cef88d9317bb5eb820d54da3491fda8849b79b00..9717bb52f263907343fa5403c3a95198ca37f13c 100644 (file)
           </dependencies>
           <configuration>
             <configLocation>odl_checks.xml</configLocation>
+            <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
             <!-- <sourceDirectory> is needed so that checkstyle ignores the
                  generated sources directory -->
             <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>