RAT-240: Add change documentation and update tests
* Test comment/empty line input.
* Test input that is trimmed.
* Add changes.
git-svn-id: https://svn.apache.org/repos/asf/creadur/rat/trunk@1811618 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/apache-rat-core/src/main/java/org/apache/rat/Report.java b/apache-rat-core/src/main/java/org/apache/rat/Report.java
index 103863c..b34ffcd 100644
--- a/apache-rat-core/src/main/java/org/apache/rat/Report.java
+++ b/apache-rat-core/src/main/java/org/apache/rat/Report.java
@@ -127,10 +127,11 @@
continue;
}
- orFilter.addFileFilter(new RegexFileFilter(exclude));
- // RAT-240: verify it works properly
- orFilter.addFileFilter(new NameFileFilter(exclude));
- orFilter.addFileFilter(new WildcardFileFilter(exclude));
+ String exclusion = exclude.trim();
+ // interpret given patterns regular expression, direct file names or wildcards to give users more choices to configure exclusions
+ orFilter.addFileFilter(new RegexFileFilter(exclusion));
+ orFilter.addFileFilter(new NameFileFilter(exclusion));
+ orFilter.addFileFilter(new WildcardFileFilter(exclusion));
} catch(PatternSyntaxException e) {
System.err.println("Will skip given exclusion '" + exclude + "' due to " + e);
}
diff --git a/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java b/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
index 8468a8e..56f8bb8 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
@@ -137,7 +137,7 @@
@Test
public void parseExclusionsForCLIUsage() throws IOException {
- final FilenameFilter filter = Report.parseExclusions(Arrays.asList("foo", "foo/bar"));
+ final FilenameFilter filter = Report.parseExclusions(Arrays.asList("", " # foo/bar", "foo", "##", " ./foo/bar"));
assertNotNull(filter);
}
}
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 2765bb9..ea15922 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,7 +54,10 @@
</properties>
<body>
- <release version="0.13" date="2016-xx-xx" description="Current SNAPSHOT - to be done">
+ <release version="0.13" date="2017-xx-xx" description="Current SNAPSHOT - to be done">
+ <action issue="RAT-240" type="fix" dev="pottlinger">
+ Overhauled CLI module to allow file based exclusions with wildcards and explicit file names.
+ </action>
<action issue="RAT-233" type="add" due-to="Stefan Bodewig" dev="pottlinger">
Recognize XML-based .Net Core xproj files.
</action>