You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@creadur.apache.org by "arturobernalg (via GitHub)" <gi...@apache.org> on 2026/10/20 09:45:58 UTC
[PR] RAT-569: Apply the configured excluder to resources added via a ResourceCollection [creadur-rat]
arturobernalg opened a new pull request, #757:
URL: https://github.com/apache/creadur-rat/pull/757
## What
`inputExcludeSize`, and in fact every exclusion mechanism RAT itself offers (patterns, standard collections, etc.), has no effect on a file that reaches RAT through an Ant `ResourceCollection` rather than RAT's own directory walk. That includes the common case of a `<fileset>` nested inside `<rat:report>`, a `<file>` element, and an externally-resolved `ResourceCollection` such as a Gradle `fileTree` handed to the Ant task via `FileCollection.AntType.ResourceCollection` (the way Apache Solr's build wires RAT).
## Why
`DirectoryWalker` applies the configured `DocumentNameMatcher` to every child it finds while walking a directory (see `FileDocument#listChildren()`), wrapping an excluded child as an `IgnoredDocument`. That is the only place in the codebase that ever calls the matcher.
`ResourceCollectionContainer` (used by the Ant `<rat:report>` task for every resource it receives, exclusively) never walks a directory: Ant, or whatever tool resolved the `ResourceCollection`, has already produced the final file list. `ResourceCollectionContainer#run()` built a `DocumentNameMatcher` for each file but never called it, so nothing ever excluded anything reached this way — the option is parsed and registered correctly (confirmed by the existing `ReportOptionTest` coverage), it is just never consulted.
## How
Each resource is now checked against its excluder before being reported, mirroring `DirectoryWalker`'s own `FileFilter` logic: an excluded resource is wrapped as an `IgnoredDocument` instead of a `FileDocument`, the same representation already used for an excluded child during a directory walk.
## Tests
- `ReportTest#testTinyUnlicensedFileControl`: a baseline control confirming a small, unlicensed file added via `<file>` is reachable and normally reported as unapproved.
- `ReportTest#testInputExcludeSizeExcludesSmallFile`: the same file, with `inputExcludeSize` set above its size, now correctly excluded. This test fails on unfixed code with the exact reported symptom (the file is still flagged unapproved) and passes with the fix.
- Full `apache-rat-tasks` suite: 115 tests, 0 failures. Checkstyle and spotbugs clean.
https://claude.ai/code/session_01ReVkpYAznRPFBkHQFwYWcK
--
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-569: Apply the configured excluder to resources added via a ResourceCollection [creadur-rat]
Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger merged PR #757:
URL: https://github.com/apache/creadur-rat/pull/757
--
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-569: Apply the configured excluder to resources added via a ResourceCollection [creadur-rat]
Posted by "Claudenw (via GitHub)" <gi...@apache.org>.
Claudenw commented on PR #757:
URL: https://github.com/apache/creadur-rat/pull/757#issuecomment-6345541424
@ottlinger Do you want to do your change log magic here plz.
--
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-569: Apply the configured excluder to resources added via a ResourceCollection [creadur-rat]
Posted by "ottlinger (via GitHub)" <gi...@apache.org>.
ottlinger commented on PR #757:
URL: https://github.com/apache/creadur-rat/pull/757#issuecomment-6350268765
Thanks @arturobernalg for fixing another bug in RAT and your contribution.
--
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