aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-08-22 14:02:14 -0400
committerPamela Dragosh <pdragosh@research.att.com>2018-08-23 14:25:55 -0400
commitf133be23c3fab4609e969a89ad64869bc8a7c38f (patch)
tree4e67fe1d8d7d1584696321c4119af0f860435ce3
parent99b3ae8b86863672ebe410303182d21daeabd0d1 (diff)
Make checkstyle warnings fail
For this repo, we add an suppression filter for some abbreviation names. It is far too cumbersome to rename these checkstyle issues at this time. We will do so post-Casablanca release. We copy the oparent checkstyle pom settings and set to fail on any warnings. Change-Id: Icfbd005819a3289acd30796693be85c2ea460212 Issue-ID: POLICY-881 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
-rw-r--r--checkstyle-suppressions.xml11
-rw-r--r--pom.xml37
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java2
3 files changed, 49 insertions, 1 deletions
diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
new file mode 100644
index 00000000..2e03c646
--- /dev/null
+++ b/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 checks="AbbreviationAsWordInName"
+ files="SystemOutLoggerTest.java|Logger4JTest.java|EelfLoggerTest.java|PolicyLoggerTest.java|DroolsPDPMDCInfoTest.java|EventTrackInfoTest.java|DbDAOTest.java|HttpClientTest.java"
+ lines="1-9999"/>
+</suppressions>
diff --git a/pom.xml b/pom.xml
index 96632383..076eb3f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -252,6 +252,43 @@
</dependency>
</dependencies>
</plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>onap-java-style</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <!-- Use Google Java Style Guide:
+ https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
+ with minor changes -->
+ <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
+ <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
+ <sourceDirectory>${project.build.sourceDirectory}/src/main/java</sourceDirectory>
+ <includeResources>true</includeResources>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <includeTestResources>true</includeTestResources>
+ <excludes>
+ </excludes>
+ <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
+ <consoleOutput>true</consoleOutput>
+ <failOnViolation>true</failOnViolation>
+ <violationSeverity>warning</violationSeverity>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>${oparent.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
<reporting>
diff --git a/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java b/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java
index 653fe484..46003bae 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/properties/PropertyConfiguration.java
@@ -336,7 +336,7 @@ public class PropertyConfiguration {
*
* @param props properties from which to get the value
* @param propnm name of the property of interest
- * @return
+ * @return the raw property value
*/
protected String getRawPropertyValue(Properties props, String propnm) {
return props.getProperty(propnm);