Skip to content

Commit

Permalink
Include XML files in checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Nov 27, 2014
1 parent 3f6d94c commit 135bb9e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 6 deletions.
24 changes: 21 additions & 3 deletions pom.xml
Expand Up @@ -37,6 +37,8 @@
<checkstyle.plugin.version>2.12.1</checkstyle.plugin.version>
<checkstyleConsoleOutput>true</checkstyleConsoleOutput>
<checkstyleFailOnError>true</checkstyleFailOnError>
<!-- the default value pointing at suppressions.xml in the dependency -->
<checkstyle.suppressions.file>rhq-checkstyle/suppressions.xml</checkstyle.suppressions.file>
<wildfly.checkstyle-config.version>1.0.2.Final</wildfly.checkstyle-config.version>
</properties>

Expand Down Expand Up @@ -116,6 +118,11 @@
<artifactId>wildfly-checkstyle-config</artifactId>
<version>${wildfly.checkstyle-config.version}</version>
</dependency>
<dependency>
<groupId>org.rhq.checkstyle</groupId>
<artifactId>rhq-checkstyle-config</artifactId>
<version>1.0.0.Final-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -299,13 +306,19 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<configuration>
<configLocation>wildfly-checkstyle/checkstyle.xml</configLocation>
<configLocation>rhq-checkstyle/checkstyle.xml</configLocation>
<consoleOutput>${checkstyleConsoleOutput}</consoleOutput>
<failsOnError>${checkstyleFailOnError}</failsOnError>
<!-- Make includes relative to ${basedir} -->
<sourceDirectory>${basedir}</sourceDirectory>
<!-- The following should include both main and test classes -->
<includes>src/**/*.java,</includes>
<!-- For *.java, the following setup should include both main and test classes.
For *.xml it should include pom.xml and all *.xml files under src directory.
using just **/*.xml would pull in also the XML files from all submodules
which we do not want here. -->
<includes>src/**/*.java,*.xml,src/**/*.xml</includes>
<!-- to override in a submodule, just redefine the checkstyle.suppressions.file property
in the given submodule's pom -->
<suppressionsLocation>${checkstyle.suppressions.file}</suppressionsLocation>
<useFile />
</configuration>
<dependencies>
Expand All @@ -314,6 +327,11 @@
<artifactId>wildfly-checkstyle-config</artifactId>
<version>${wildfly.checkstyle-config.version}</version>
</dependency>
<dependency>
<groupId>org.rhq.checkstyle</groupId>
<artifactId>rhq-checkstyle-config</artifactId>
<version>1.0.0.Final-SNAPSHOT</version>
</dependency>
</dependencies>
<executions>
<execution>
Expand Down
6 changes: 3 additions & 3 deletions test-utils/pom.xml
Expand Up @@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.rhq.metrics</groupId>
<artifactId>rhq-metrics-parent</artifactId>
Expand All @@ -20,13 +20,13 @@
</dependency>

<dependency>
<groupId>joda-time</groupId>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda.time.version}</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
</dependencies>
Expand Down
1 change: 1 addition & 0 deletions ui/console/pom.xml
Expand Up @@ -16,6 +16,7 @@
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<checkstyle.suppressions.file>${basedir}/src/main/build/rhq-checkstyle/suppressions.xml</checkstyle.suppressions.file>
</properties>

<build>
Expand Down
11 changes: 11 additions & 0 deletions ui/console/src/main/build/rhq-checkstyle/suppressions.xml
@@ -0,0 +1,11 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">

<suppressions>
<suppress files="[\\/]src[\\/]main[\\/]webapp[\\/]bower_components[\\/]" checks=".*"/>
<suppress files="[\\/]src[\\/]main[\\/]webapp[\\/]node_modules[\\/]" checks=".*"/>
<suppress files="[\\/]src[\\/]main[\\/]webapp[\\/]node[\\/]" checks=".*"/>
</suppressions>
1 change: 1 addition & 0 deletions ui/explorer/pom.xml
Expand Up @@ -17,6 +17,7 @@
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<checkstyle.suppressions.file>${basedir}/src/main/build/rhq-checkstyle/suppressions.xml</checkstyle.suppressions.file>
</properties>

<build>
Expand Down
11 changes: 11 additions & 0 deletions ui/explorer/src/main/build/rhq-checkstyle/suppressions.xml
@@ -0,0 +1,11 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">

<suppressions>
<suppress files="[\\/]src[\\/]main[\\/]webapp[\\/]bower_components[\\/]" checks=".*"/>
<suppress files="[\\/]src[\\/]main[\\/]webapp[\\/]node_modules[\\/]" checks=".*"/>
<suppress files="[\\/]src[\\/]main[\\/]webapp[\\/]node[\\/]" checks=".*"/>
</suppressions>

0 comments on commit 135bb9e

Please sign in to comment.