gnodet opened a new pull request, #773: URL: https://github.com/apache/creadur-rat/pull/773
## Summary `AbstractFileProcessorBuilder.checkDirectory()` recursively walks the entire directory tree to find SCM ignore files (e.g. `.gitignore`). This walk does not respect any exclusion patterns or the `HIDDEN_DIR` default exclusion, causing severe performance issues when hidden directories contain large trees. A common scenario is git worktrees stored under directories like `.worktrees/` or `.claude/worktrees/`. Each worktree is a full checkout of the project, so the walk traverses hundreds of thousands of files before the actual license scan even begins. In the Apache Maven project for example, 27 worktrees under `.claude/worktrees/` result in ~370,000 files being traversed during the `.gitignore` discovery phase alone, causing RAT to hang. Since hidden directories are excluded by default via `HIDDEN_DIR`, their contents will never be scanned for license headers. Therefore, any SCM ignore files inside them are irrelevant and processing them is wasted work. ## Changes - Modified `checkDirectory()` to skip directories with names starting with `.` (hidden directories), consistent with the `HIDDEN_DIR` default exclusion behavior - Added test `hiddenDirectoriesAreSkippedDuringWalk` verifying that `.gitignore` files inside hidden directories are not processed ## Test plan - [x] New test verifies hidden directory `.gitignore` files are skipped - [x] All existing `GitIgnoreBuilderTest` tests pass - [ ] Manual testing with a project containing worktrees in hidden directories confirms RAT no longer hangs _Claude Code on behalf of Guillaume Nodet_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
