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/11/17 23:16:08 UTC
[PR] Rat 259: implement and verify solution in jira ticket [creadur-rat]
Claudenw opened a new pull request, #397:
URL: https://github.com/apache/creadur-rat/pull/397
Implements "--input-source", refactored how the configuration stores the files/walkers to process.
Should be cleaner to implement other walkers now.
--
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-259: implement and verify solution in jira ticket [creadur-rat]
Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #397:
URL: https://github.com/apache/creadur-rat/pull/397#discussion_r1861956810
##########
apache-rat-core/src/main/java/org/apache/rat/document/DocumentNameMatcher.java:
##########
@@ -20,17 +20,206 @@
import java.io.File;
import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.function.Predicate;
-@FunctionalInterface
-public interface DocumentNameMatcher {
- boolean matches(DocumentName documentName);
+import org.apache.rat.config.exclusion.plexus.MatchPattern;
+import org.apache.rat.config.exclusion.plexus.MatchPatterns;
+
+import static java.lang.String.format;
+
+/**
+ * Matches document names.
+ */
+public final class DocumentNameMatcher {
+
+ /** The environment variable to set to enable tracing for the PatternMatcher execution */
+ public static final String ENV_VAR = DocumentNameMatcher.class.getName();
Review Comment:
Shouldn't there be a reference to this ENV_VAR if it is used to indicate or change something?
--
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-259: implement and verify solution in jira ticket [creadur-rat]
Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on code in PR #397:
URL: https://github.com/apache/creadur-rat/pull/397#discussion_r1862000269
##########
apache-rat-core/src/main/java/org/apache/rat/ReportConfiguration.java:
##########
@@ -159,6 +169,55 @@ public ReportConfiguration() {
dryRun = false;
exclusionProcessor = new ExclusionProcessor();
claimValidator = new ClaimValidator();
+ sources = new ArrayList<>();
+ reportables = new ArrayList<>();
+ }
+
+ /**
+ * Adds a file as a source of files to scan.
+ * The file must be a text file that lists files to be included.
+ * File within the file must be in linux format with a
+ * "/" file separator.
+ * @param file the file to process.
+ */
+ public void addSource(final File file) {
Review Comment:
The parameter may have backslashes if it is on a Windows box. But the contents for the file identified by the parameter should use "/" as the separator. Failure to do so may or may not work depending on a lot of other conditions. I don't think we can/should check for the presence of the backslash as it might be a valid character in a file name. OK that is a stretch, but I think we should leave 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-259: implement and verify solution in jira ticket [creadur-rat]
Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #397:
URL: https://github.com/apache/creadur-rat/pull/397#discussion_r1862006701
##########
apache-rat-core/src/main/java/org/apache/rat/ReportConfiguration.java:
##########
@@ -159,6 +169,55 @@ public ReportConfiguration() {
dryRun = false;
exclusionProcessor = new ExclusionProcessor();
claimValidator = new ClaimValidator();
+ sources = new ArrayList<>();
+ reportables = new ArrayList<>();
+ }
+
+ /**
+ * Adds a file as a source of files to scan.
+ * The file must be a text file that lists files to be included.
+ * File within the file must be in linux format with a
+ * "/" file separator.
+ * @param file the file to process.
+ */
+ public void addSource(final File file) {
Review Comment:
ok, I just thought of it, when I read the Javadocs.
--
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-259: implement and verify solution in jira ticket [creadur-rat]
Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw merged PR #397:
URL: https://github.com/apache/creadur-rat/pull/397
--
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-259: implement and verify solution in jira ticket [creadur-rat]
Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #397:
URL: https://github.com/apache/creadur-rat/pull/397#discussion_r1861862350
##########
apache-rat-core/src/main/java/org/apache/rat/ReportConfiguration.java:
##########
@@ -159,6 +169,55 @@ public ReportConfiguration() {
dryRun = false;
exclusionProcessor = new ExclusionProcessor();
claimValidator = new ClaimValidator();
+ sources = new ArrayList<>();
+ reportables = new ArrayList<>();
+ }
+
+ /**
+ * Adds a file as a source of files to scan.
+ * The file must be a text file that lists files to be included.
+ * File within the file must be in linux format with a
+ * "/" file separator.
+ * @param file the file to process.
+ */
+ public void addSource(final File file) {
Review Comment:
Should we add a check here that ensures no backslashes are provided as parameter?
--
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-259: implement and verify solution in jira ticket [creadur-rat]
Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on code in PR #397:
URL: https://github.com/apache/creadur-rat/pull/397#discussion_r1861988962
##########
apache-rat-core/src/test/java/org/apache/rat/config/exclusion/FileProcessorTest.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rat.config.exclusion;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+import org.apache.rat.document.DocumentName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+
+public class FileProcessorTest {
+
+ FileProcessor underTest = new FileProcessor(){
Review Comment:
object is never used?
--
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