You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@creadur.apache.org by "Claudenw (via GitHub)" <gi...@apache.org> on 2024/06/08 08:29:44 UTC

[PR] RAT-323: harmonize - Part 2 [creadur-rat]

Claudenw opened a new pull request, #268:
URL: https://github.com/apache/creadur-rat/pull/268

   ** DO NOT MERGE **
   This change required harmonize Part 1.
   
   Fix for RAT-380 refactor commons cli usage.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667451477


##########
apache-rat-core/src/main/java/org/apache/rat/OptionCollection.java:
##########
@@ -581,7 +560,7 @@ static Optional<IOFileFilter> parseExclusions(final Log log, final List<String>
         if (ignoredLines > 0) {
             log.info("Ignored " + ignoredLines + " lines in your exclusion files as comments or empty lines.");
         }
-        return orFilter.getFileFilters().isEmpty() ? Optional.empty() : Optional.of(orFilter);
+        return orFilter.getFileFilters().isEmpty() ? Optional.empty() : Optional.of(new NotFileFilter(orFilter));

Review Comment:
   Somehow this line is odd to read .....
   OrFilter does not look similar to NotFileFilter to me.
   
   Has there been a semantic change in newer apache-commons-versions? or should the variable be renamed to notFileFilter here?
   
   Or does the change invert the logics of the CLI option (then we should add a big note to the webpage ;))
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667733235


##########
apache-rat-core/src/test/java/org/apache/rat/OptionCollectionTest.java:
##########
@@ -118,27 +121,44 @@ public void testDeprecatedUseLogged() throws IOException {
         TestingLog log = new TestingLog();
         try {
             DefaultLog.setInstance(log);
-            String[] args = {longOpt(OptionCollection.DIR), "foo", "-a"};
-            ReportConfiguration config = OptionCollection.parseCommands(args, (o) -> {
-            }, true);
-
+            String[] args = {longOpt(OptionCollection.DIR), "target", "-a"};
+            ReportConfiguration config = OptionCollection.parseCommands(args, o -> fail("Help printed"), true);
         } finally {
             DefaultLog.setInstance(null);
         }
         log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);
         log.assertContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'");
+        log.assertNotContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'", 1);
+    }
+
+    @Test
+    public void testDirOptionCapturesDirectoryToScan() throws IOException {
+        TestingLog log = new TestingLog();
+        ReportConfiguration config = null;
+        try {
+            DefaultLog.setInstance(log);
+            String[] args = {longOpt(OptionCollection.DIR), "foo"};
+            config = OptionCollection.parseCommands(args, (o) -> {
+            }, true);
+        } finally {
+            DefaultLog.setInstance(null);
+        }
+        assertThat(config).isNotNull();
+        log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);

Review Comment:
   Is the semantics of both lines supposed to be doesNotContainStringMoreThanExactlyOnce? Rading it one by one seems a bit confusing to me ..... sry



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667449000


##########
apache-rat-core/src/main/java/org/apache/rat/ReportConfiguration.java:
##########
@@ -766,21 +704,17 @@ public NoCloseOutputStream(final OutputStream delegate) {
         }
 
         @Override
-        public void write(final int arg0) throws IOException {
+        public void write(int arg0) throws IOException {
             delegate.write(arg0);
         }
 
-        /**

Review Comment:
   This javadoc seems helpful to me as I do not have to have a look into the source in order to see what is special about this class ..... I'd want to keep it here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1676777920


##########
apache-rat-plugin/pom.xml:
##########
@@ -157,6 +157,7 @@
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>build-helper-maven-plugin</artifactId>
+          <version>3.2.0</version>

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667448780


##########
apache-rat-core/src/main/java/org/apache/rat/ReportConfiguration.java:
##########
@@ -57,129 +58,51 @@
  */
 public class ReportConfiguration {
 
-    /**
-     * The styles of processing for various categories of documents.
-     */
     public enum Processing {
-        /**
-         * List file as present only
-         */
+        /** List file as present only */
         NOTIFICATION("List file as present"),
-        /**
-         * List all present licenses
-         */
+        /** List all present licenses */
         PRESENCE("List any licenses found"),
-        /**
-         * List all present licenses and unknown licenses
-         */
+        /** List all present licenses and unknown licenses */
         ABSENCE("List licenses found and any unknown licences");
 
-        /**
-         * the description of the processing.
-         */
-        private final String description;
-
-
-        Processing(final String description) {
-            this.description = description;
-        }
-
-        /**
-         * Gets the description of the processing type.
-         * @return
-         */
-        public String desc() {
-            return description;
-        }
+    private final String description;
+    Processing(String description) {
+        this.description = description;
+    }
+    public String desc() { return description; }
     }
 
-    /**
-     * The set of defined families.
-     */
+
     private final ReportingSet<ILicenseFamily> families;
-    /**
-     * The set of defined licenses
-     */
     private final ReportingSet<ILicense> licenses;
-    /**
-     * The set of approved license family categories.
-     */
     private final SortedSet<String> approvedLicenseCategories;
-    /**
-     * The set of license categories that have are to be removed from consideration.
-     */
     private final SortedSet<String> removedLicenseCategories;
-    /**
-     * {@code true} if we are adding license headers to the files.
-     */
     private boolean addingLicenses;
-    /**
-     * {@code true} if we are adding license headers in place (no *.new files)
-     */
     private boolean addingLicensesForced;
-    /**
-     * The copyright message to add if we are adding headers.  Will be null if we are not
-     * adding copyright messages.
-     */
     private String copyrightMessage;
-    /**
-     * The IOSupplier that provides the output stream to write the report to.
-     */
     private IOSupplier<OutputStream> out;
-    /**
-     * {@code true} if the report should be styled.  {@code false} if XML should be produced.
-     */
     private boolean styleReport;
-    /**
-     * The IOSupplier that provides the stylesheet to style the XML output.
-     */
     private IOSupplier<InputStream> styleSheet;
-    /**
-     * The Reportable instance that provides the documents to process.
-     */
     private IReportable reportable;
-    /**
-     * A file filter that matches files to ignore.
-     */
     private IOFileFilter filesToIgnore;
-    /**
-     * A file filter that matches directories to ignore.
-     */
     private IOFileFilter directoriesToIgnore;
-    /**
-     * the log to write messages to.
-     */
     private final Log log;
-    /**
-     * The default filter for displaying families.
-     */
     private LicenseFilter listFamilies;
-    /**
-     * The default filter for displaying licenses.
-     */
     private LicenseFilter listLicenses;
-    /**
-     * {@code true} if this is a dry run and no processing is to take place.
-     */
     private boolean dryRun;
-    /**
-     * How to process ARCHIVE document types.
-     */
     private Processing archiveProcessing;
-    /**
-     * How to process STANDARD document types.
-     */
     private Processing standardProcessing;
     /**
      * Constructor
      * @param log The Log implementation that messages will be written to.
      */
-    public ReportConfiguration(final Log log) {
+    public ReportConfiguration(Log log) {

Review Comment:
   is this final removal due to a differnt formatter or intended?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667448896


##########
apache-rat-core/src/main/java/org/apache/rat/ReportConfiguration.java:
##########
@@ -337,36 +256,33 @@ public IOFileFilter getDirectoriesToIgnore() {
      * @param directoriesToIgnore the filter that defines the directories to ignore.
      * @see Defaults#DIRECTORIES_TO_IGNORE
      */
-    public void setDirectoriesToIgnore(final IOFileFilter directoriesToIgnore) {
+    public void setDirectoriesToIgnore(IOFileFilter directoriesToIgnore) {
         this.directoriesToIgnore = directoriesToIgnore == null ? FalseFileFilter.FALSE : directoriesToIgnore;
     }
 
     /**
      * Adds a directory filter to the directories to ignore.
      * @param directoryToIgnore the directory filter to add.
      */
-    public void addDirectoryToIgnore(final IOFileFilter directoryToIgnore) {
+    public void addDirectoryToIgnore(IOFileFilter directoryToIgnore) {
         this.directoriesToIgnore = this.directoriesToIgnore.or(directoryToIgnore);
     }
 
     /**
-     * Gets the reportable object.
      * @return the thing being reported on.
      */
     public IReportable getReportable() {
         return reportable;
     }
 
     /**
-     * Sets the reportable object.
      * @param reportable the thing being reported on.
      */
-    public void setReportable(final IReportable reportable) {
+    public void setReportable(IReportable reportable) {
         this.reportable = reportable;
     }
 
     /**
-     * Gets the IOSupplier with the style sheet.

Review Comment:
   If I'm not too mistaken this will result in more javadoc warnings about missing javadocs? Is that intended?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667734278


##########
apache-rat-plugin/src/it/it4_RAT-168/verify.groovy:
##########
@@ -21,10 +21,9 @@ assert content.contains( 'BUILD SUCCESS' )
 /*
  * [WARNING] No resources included
  */
-assert ! content.contains( '[WARNING]' )
+assert ! content.contains( '[WARNING] No resources' )

Review Comment:
   comment not matching assertion as mentioned above



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1677207698


##########
apache-rat-core/src/main/java/org/apache/rat/DeprecationReporter.java:
##########
@@ -83,18 +83,6 @@ public static void logDeprecated(final Class<?> clazz) {
         }
     }
 
-    /**
-     * Log deprecated options
-     * @param log The log to write to.
-     * @param option potentially deprecated option to log.
-     */
-    // TODO remove this when commons-cli 1.7.1 or higher is available
-    public static void logDeprecated(final Log log, final Option option) {
-        if (option.isDeprecated()) {
-            getLogReporter(log).accept(option);
-        }
-    }
-

Review Comment:
   Thanks for the clarification. I added a changelog entry on the branch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#issuecomment-2227493239

   @Claudenw not sure what is wrong with the branch. Locally I do not see the conflict and tried to merge in origin/master. Hopefully your merge is more successful. Thanks for all your work and the cool new features.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1676778396


##########
apache-rat-plugin/src/it/RAT-314/verify.groovy:
##########
@@ -21,7 +21,7 @@ assert content.contains( 'BUILD SUCCESS' )
 /*
  * [WARNING] No resources included
  */
-assert ! content.contains( '[WARNING]' )
+assert ! content.contains( '[WARNING] No resources' )

Review Comment:
   Fixed.



##########
apache-rat-plugin/src/it/it4_RAT-168/verify.groovy:
##########
@@ -21,10 +21,9 @@ assert content.contains( 'BUILD SUCCESS' )
 /*
  * [WARNING] No resources included
  */
-assert ! content.contains( '[WARNING]' )
+assert ! content.contains( '[WARNING] No resources' )

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667440124


##########
apache-rat-core/src/main/java/org/apache/rat/Defaults.java:
##########
@@ -143,10 +114,10 @@ public static void init() {
     /**
      * Builder constructs instances.
      * @param log The log to write messages to.
-     * @param uris The set of URIs to read.
+     * @param urls The set of URLs to read.
      */
-    private Defaults(final Log log, final Set<URI> uris) {
-        this.setFactory = Defaults.readConfigFiles(log, uris);
+    private Defaults(final Log log, final Set<URI> urls) {

Review Comment:
   I thought the other merge part 1 already fixed this and changed it into uris instead of urls? Is that a sideeffect of the forced push you did on the branch8es)? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667449173


##########
apache-rat-core/src/test/java/org/apache/rat/IOptionsProvider.java:
##########
@@ -20,88 +20,40 @@
 
 /**
  * A list of methods that an OptionsProvider in a test case must support.
- * Use of this interface ensures consistent testing across the UIs.  Each method
+ * Use of this interface can ensures consistent testing across the UIs.  Each method
  * tests an Option from OptionCollection that must be implemented in the UI.
  * Each method in this interface tests an Option in OptionCollection.
  */
 public interface IOptionsProvider {
-    /**

Review Comment:
   Why is all the javadoc gone here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667733329


##########
apache-rat-core/src/test/java/org/apache/rat/OptionCollectionTest.java:
##########
@@ -118,27 +121,44 @@ public void testDeprecatedUseLogged() throws IOException {
         TestingLog log = new TestingLog();
         try {
             DefaultLog.setInstance(log);
-            String[] args = {longOpt(OptionCollection.DIR), "foo", "-a"};
-            ReportConfiguration config = OptionCollection.parseCommands(args, (o) -> {
-            }, true);
-
+            String[] args = {longOpt(OptionCollection.DIR), "target", "-a"};
+            ReportConfiguration config = OptionCollection.parseCommands(args, o -> fail("Help printed"), true);
         } finally {
             DefaultLog.setInstance(null);
         }
         log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);
         log.assertContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'");
+        log.assertNotContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'", 1);
+    }
+
+    @Test
+    public void testDirOptionCapturesDirectoryToScan() throws IOException {
+        TestingLog log = new TestingLog();
+        ReportConfiguration config = null;
+        try {
+            DefaultLog.setInstance(log);
+            String[] args = {longOpt(OptionCollection.DIR), "foo"};
+            config = OptionCollection.parseCommands(args, (o) -> {
+            }, true);
+        } finally {
+            DefaultLog.setInstance(null);
+        }
+        assertThat(config).isNotNull();
+        log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);

Review Comment:
   Should we merge both assertions into one or only use exactly one?



##########
apache-rat-core/src/test/java/org/apache/rat/OptionCollectionTest.java:
##########
@@ -118,27 +121,44 @@ public void testDeprecatedUseLogged() throws IOException {
         TestingLog log = new TestingLog();
         try {
             DefaultLog.setInstance(log);
-            String[] args = {longOpt(OptionCollection.DIR), "foo", "-a"};
-            ReportConfiguration config = OptionCollection.parseCommands(args, (o) -> {
-            }, true);
-
+            String[] args = {longOpt(OptionCollection.DIR), "target", "-a"};
+            ReportConfiguration config = OptionCollection.parseCommands(args, o -> fail("Help printed"), true);
         } finally {
             DefaultLog.setInstance(null);
         }
         log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);
         log.assertContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'");
+        log.assertNotContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'", 1);
+    }
+
+    @Test
+    public void testDirOptionCapturesDirectoryToScan() throws IOException {
+        TestingLog log = new TestingLog();
+        ReportConfiguration config = null;
+        try {
+            DefaultLog.setInstance(log);
+            String[] args = {longOpt(OptionCollection.DIR), "foo"};
+            config = OptionCollection.parseCommands(args, (o) -> {
+            }, true);
+        } finally {
+            DefaultLog.setInstance(null);
+        }
+        assertThat(config).isNotNull();
+        log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);

Review Comment:
   Is the semantics of both lines supposed to be doesNotContainStringMoreThanExactlyOnce? Reading it one by one seems a bit confusing to me ..... sry



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667448214


##########
apache-rat-core/src/main/java/org/apache/rat/OptionCollection.java:
##########
@@ -209,23 +209,22 @@ private OptionCollection() {
             .converter(s -> ReportConfiguration.Processing.valueOf(s.toUpperCase()))
             .build();
 
-
-    /** TODO rework when commons-cli 1.7.1 or higher is available. */
-    static final DeprecatedAttributes DIR_ATTRIBUTES = DeprecatedAttributes.builder().setForRemoval(true).setSince("0.17")
-            .setDescription("Use '--'").get();
     /**
      * Ths option to signal the end of an argument list and the start of the directory/archive arguments.
      */
+    // TODO rework when commons-cli 1.7.1 or higher is available.

Review Comment:
   What is the stuff that needs reworking with the new CLI version? I thought part2 contains the changes that come in with the new commonscliversion? Could you add this context to the PR? Thx



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667449140


##########
apache-rat-core/src/test/java/org/apache/rat/IOptionsProvider.java:
##########
@@ -20,88 +20,40 @@
 
 /**
  * A list of methods that an OptionsProvider in a test case must support.
- * Use of this interface ensures consistent testing across the UIs.  Each method
+ * Use of this interface can ensures consistent testing across the UIs.  Each method

Review Comment:
   forced push - unfortunately the original part1 PR is closed already .....



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667451915


##########
pom.xml:
##########
@@ -292,7 +292,7 @@ agnostic home for software distribution comprehension and audit tools.
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-project-info-reports-plugin</artifactId>
-        <version>3.6.1</version>

Review Comment:
   Pls merge the current master into the branch in order to get the same versions as master.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#issuecomment-2212516527

   @Claudenw how would a changelog entry look like for part2??
   -bugfix for exclusion
   -usage of newer commons-cli
   
   ??? not sure what else


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667671677


##########
apache-rat-core/src/test/java/org/apache/rat/IOptionsProvider.java:
##########
@@ -20,88 +20,40 @@
 
 /**
  * A list of methods that an OptionsProvider in a test case must support.
- * Use of this interface ensures consistent testing across the UIs.  Each method
+ * Use of this interface can ensures consistent testing across the UIs.  Each method
  * tests an Option from OptionCollection that must be implemented in the UI.
  * Each method in this interface tests an Option in OptionCollection.
  */
 public interface IOptionsProvider {
-    /**

Review Comment:
   Because I errored.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#issuecomment-2212414839

   @ottlinger 
   There was a significant error in my merge attempt.  I think I have corrected it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1669937539


##########
apache-rat-core/src/main/java/org/apache/rat/DeprecationReporter.java:
##########
@@ -83,18 +83,6 @@ public static void logDeprecated(final Class<?> clazz) {
         }
     }
 
-    /**
-     * Log deprecated options
-     * @param log The log to write to.
-     * @param option potentially deprecated option to log.
-     */
-    // TODO remove this when commons-cli 1.7.1 or higher is available
-    public static void logDeprecated(final Log log, final Option option) {
-        if (option.isDeprecated()) {
-            getLogReporter(log).accept(option);
-        }
-    }
-

Review Comment:
   Could you clarify how the new commons-cli is related to RAT's deprecated options? or is there no connection .....



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667734014


##########
apache-rat-plugin/pom.xml:
##########
@@ -195,25 +196,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>

Review Comment:
   Did you intentionally remove the checkstyle config here? or is it a merging issue?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-380, RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw merged PR #268:
URL: https://github.com/apache/creadur-rat/pull/268


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1676800742


##########
apache-rat-core/src/main/java/org/apache/rat/DeprecationReporter.java:
##########
@@ -83,18 +83,6 @@ public static void logDeprecated(final Class<?> clazz) {
         }
     }
 
-    /**
-     * Log deprecated options
-     * @param log The log to write to.
-     * @param option potentially deprecated option to log.
-     */
-    // TODO remove this when commons-cli 1.7.1 or higher is available
-    public static void logDeprecated(final Log log, final Option option) {
-        if (option.isDeprecated()) {
-            getLogReporter(log).accept(option);
-        }
-    }
-

Review Comment:
   @ottlinger  
   commons-cli implemented deprecated options in 1.7.0 but there was a bug with it not reporting usage if the string was not used to lookup the usage.  1.8.0 solved that problem.
   
   While we were using 1.7.0 there was code to explicitly check if the options were deprecated.  With commons-cli 1.8.0 this this is no longer needed and is moved.



##########
apache-rat-core/src/test/java/org/apache/rat/OptionCollectionTest.java:
##########
@@ -118,27 +121,44 @@ public void testDeprecatedUseLogged() throws IOException {
         TestingLog log = new TestingLog();
         try {
             DefaultLog.setInstance(log);
-            String[] args = {longOpt(OptionCollection.DIR), "foo", "-a"};
-            ReportConfiguration config = OptionCollection.parseCommands(args, (o) -> {
-            }, true);
-
+            String[] args = {longOpt(OptionCollection.DIR), "target", "-a"};
+            ReportConfiguration config = OptionCollection.parseCommands(args, o -> fail("Help printed"), true);
         } finally {
             DefaultLog.setInstance(null);
         }
         log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);
         log.assertContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'");
+        log.assertNotContains("WARN: Option [-a] used.  Deprecated for removal since 0.17: Use '-A' or '--addLicense'", 1);
+    }
+
+    @Test
+    public void testDirOptionCapturesDirectoryToScan() throws IOException {
+        TestingLog log = new TestingLog();
+        ReportConfiguration config = null;
+        try {
+            DefaultLog.setInstance(log);
+            String[] args = {longOpt(OptionCollection.DIR), "foo"};
+            config = OptionCollection.parseCommands(args, (o) -> {
+            }, true);
+        } finally {
+            DefaultLog.setInstance(null);
+        }
+        assertThat(config).isNotNull();
+        log.assertContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'");
+        log.assertNotContains("WARN: Option [-d, --dir] used.  Deprecated for removal since 0.17: Use '--'", 1);

Review Comment:
   Good catch.  I have reworked the test and the utility classes to have methods 
   
   - contains( expected )
   - containsExactly( times, expected )
   - notContains( unexpected )



##########
apache-rat-core/src/test/java/org/apache/rat/testhelpers/TextUtils.java:
##########
@@ -78,4 +94,23 @@ public static void assertNotContains(final String find, final String target) {
         assertFalse(
                 target.contains(find), () -> "Target does contain the text: " + find + "\n" + target);
     }
+

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667449041


##########
apache-rat-core/src/main/java/org/apache/rat/utils/CasedString.java:
##########
@@ -114,21 +114,21 @@ public enum StringCase {
          * @param segments the segments to create the CasedString from.
          * @return a CasedString
          */
-        public String assemble(final String[] segments) {
+        public String assemble(String[] segments) {
             return segments.length == 0 ? null : this.joiner.apply(segments);
         }
 
         /**
          * Returns an array of each of the segments in this CasedString.  Segments are defined as the strings between
-         * the separators in the CasedString. For the CAMEL case the segments are determined by the presence of a capital letter.

Review Comment:
   forced push change reverted again



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667448430


##########
apache-rat-core/src/main/java/org/apache/rat/OptionCollection.java:
##########
@@ -393,11 +395,11 @@ public static ReportConfiguration parseCommands(final String[] args, final Consu
      * @param exception the parse exception to log
      * @param opt the option being processed
      * @param cl the command line being processed
-     * @param defaultValue The default value the option is being set to.

Review Comment:
   This change seems to be gone due to the forced push as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667734186


##########
apache-rat-plugin/src/it/RAT-314/verify.groovy:
##########
@@ -21,7 +21,7 @@ assert content.contains( 'BUILD SUCCESS' )
 /*
  * [WARNING] No resources included
  */
-assert ! content.contains( '[WARNING]' )
+assert ! content.contains( '[WARNING] No resources' )

Review Comment:
   Would we want to check for "[WARNING] No resources included" as stated in the comment above the assertion? or change the comment?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667449071


##########
apache-rat-core/src/main/java/org/apache/rat/utils/CasedString.java:
##########
@@ -157,14 +157,14 @@ public String[] getSegments(final String string) {
      * @param stringCase The {@code StringCase} that the {@code string} argument is in.
      * @param string The string.
      */
-    public CasedString(final StringCase stringCase, final String string) {
+    public CasedString(StringCase stringCase, String string) {
         this.string = string == null ? null : stringCase.assemble(stringCase.getSegments(string.trim()));
         this.stringCase = stringCase;
     }
 
     /**
      * Returns an array of each of the segments in this CasedString.  Segments are defined as the strings between
-     * the separators in the CasedString.  For the CAMEL case the segments are determined by the presence of a capital letter.
+     * the separators in the CasedString.  for the CAMEL case the segments are determined by the presence of a capital letter.

Review Comment:
   forced push side effect again



##########
apache-rat-core/src/main/java/org/apache/rat/utils/CasedString.java:
##########
@@ -174,10 +174,10 @@ public String[] getSegments() {
     /**
      * Converts this cased string into a {@code String} of another format.
      * The upper/lower case of the characters within the string are not modified.
-     * @param stringCase The format to convert to.

Review Comment:
   forced push side effect



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667458933


##########
apache-rat-tasks/pom.xml:
##########
@@ -179,25 +185,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>

Review Comment:
   forced push removed the changes from part1 - can you try merging in master to see if the changes come in?!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667671564


##########
apache-rat-core/src/main/java/org/apache/rat/OptionCollection.java:
##########
@@ -581,7 +560,7 @@ static Optional<IOFileFilter> parseExclusions(final Log log, final List<String>
         if (ignoredLines > 0) {
             log.info("Ignored " + ignoredLines + " lines in your exclusion files as comments or empty lines.");
         }
-        return orFilter.getFileFilters().isEmpty() ? Optional.empty() : Optional.of(orFilter);
+        return orFilter.getFileFilters().isEmpty() ? Optional.empty() : Optional.of(new NotFileFilter(orFilter));

Review Comment:
   This stuff is really messy.  Testing found a bug the result was we needed to use a Not filter because we were listing all the files to ignore.  so when constructing the filter for ignoring files we have to "not" the list of files that was provided.
   
   This is all going to change in the near future when we pull the Maven file matching and exclusion code up to core.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667733404


##########
apache-rat-core/src/test/java/org/apache/rat/testhelpers/TextUtils.java:
##########
@@ -69,6 +69,22 @@ public static void assertContains(final String find, final String target) {
                 target.contains(find), () -> "Target does not contain the text: " + find + "\n" + target);
     }
 
+    /**

Review Comment:
   Would you mind reformatting this block?



##########
apache-rat-core/src/test/java/org/apache/rat/testhelpers/TextUtils.java:
##########
@@ -78,4 +94,23 @@ public static void assertNotContains(final String find, final String target) {
         assertFalse(
                 target.contains(find), () -> "Target does contain the text: " + find + "\n" + target);
     }
+

Review Comment:
   Would you mind reformatting this block?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RAT-323: harmonize - Part 2 [creadur-rat]

Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #268:
URL: https://github.com/apache/creadur-rat/pull/268#discussion_r1667733912


##########
apache-rat-plugin/pom.xml:
##########
@@ -157,6 +157,7 @@
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>build-helper-maven-plugin</artifactId>
+          <version>3.2.0</version>

Review Comment:
   This seems redundant as we define the version in the main pom under pluginManagement and use 3.6.0 in master branch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@creadur.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org