[
https://issues.apache.org/jira/browse/RAT-509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18034755#comment-18034755
]
Claude Warren commented on RAT-509:
-----------------------------------
I have put forward a proposal for 1.0.0 and 0.18 development. [1] I propose
this ticked for 0.18.
I think the simplest solution for this ticket is to create a shim or adapter
that converts the standard MatcherSet into a single sided Matcher set where the
excludes calls the original excluded and not the included. (see NotPredicate
for DocumentName). So the resulting output matches what would be excluded
without explicitly declaring what is included. Thus the black box aspect of
the gitignore processor (and other similar processors is achieved). With
proper implementation we should still be able to verify that the gitignore
processor implements the gitignore process, and the same for other ignore
processors. While still preserving the space for the .ratignore or other
processors that should contribute to the include processing.
[1] https://lists.apache.org/thread/5d9cx2wzll2h0g7y9sybp68m7whxcd9h
> Gitignore rules are mixed with Rat exclude rules
> ------------------------------------------------
>
> Key: RAT-509
> URL: https://issues.apache.org/jira/browse/RAT-509
> Project: Apache RAT
> Issue Type: Bug
> Components: Client - maven
> Affects Versions: 0.17
> Reporter: Niels Basjes
> Priority: Major
>
> Assume the following simplified example:
> A pom.xml with the rat plugin and the config
> {code:java}
> <configuration>
> <consoleOutput>true</consoleOutput>
> <excludes>
> <exclude>**/*.log</exclude>
> </excludes>
> </configuration>{code}
> A .gitignore with
> {code:java}
> target
> *.log
> !demo.log {code}
> A demo.log file with any content that is not a valid license (i.e. "Hello
> World")
> Now do mvn validate using plugin version 0.16.1 and it all passed, do the
> same with plugin version 0.17 and it fails.
> My assesment is that the full set of rules in the .gitignore files are merged
> to a combined list with the license check rules. This is incorrect, these two
> rules sets have a conceptually different meaning and should not be merged.
> Although the check "Is this file ignored by version control" should be used,
> the individual rules in there should not be merged.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)