You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by po...@apache.org on 2017/10/09 22:07:04 UTC

svn commit: r1811618 - in /creadur/rat/trunk: apache-rat-core/src/main/java/org/apache/rat/Report.java apache-rat-core/src/test/java/org/apache/rat/ReportTest.java src/changes/changes.xml

Author: pottlinger
Date: Mon Oct  9 22:07:04 2017
New Revision: 1811618

URL: http://svn.apache.org/viewvc?rev=1811618&view=rev
Log:
RAT-240: Add change documentation and update tests

* Test comment/empty line input.
* Test input that is trimmed.
* Add changes.

Modified:
    creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java
    creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
    creadur/rat/trunk/src/changes/changes.xml

Modified: creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java?rev=1811618&r1=1811617&r2=1811618&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java (original)
+++ creadur/rat/trunk/apache-rat-core/src/main/java/org/apache/rat/Report.java Mon Oct  9 22:07:04 2017
@@ -127,10 +127,11 @@ public class Report {
                     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);
             }

Modified: creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java?rev=1811618&r1=1811617&r2=1811618&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java (original)
+++ creadur/rat/trunk/apache-rat-core/src/test/java/org/apache/rat/ReportTest.java Mon Oct  9 22:07:04 2017
@@ -137,7 +137,7 @@ public class ReportTest {
 
     @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);
     }
 }

Modified: creadur/rat/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/src/changes/changes.xml?rev=1811618&r1=1811617&r2=1811618&view=diff
==============================================================================
--- creadur/rat/trunk/src/changes/changes.xml (original)
+++ creadur/rat/trunk/src/changes/changes.xml Mon Oct  9 22:07:04 2017
@@ -54,7 +54,10 @@ The <action> type attribute can be add,u
   </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>