rmannibucau opened a new pull request, #746:
URL: https://github.com/apache/creadur-rat/pull/746
Support the git configuration option `core.excludesFile` (including
`[include] path` directives) when processing global gitignore files.
## Changes
- New `GitConfig` class in `apache-rat-core` that parses the git global
configuration files (`$XDG_CONFIG_HOME/git/config` and `~/.gitconfig`) with git
semantics:
- `core.excludesFile` key (case-insensitive), last value wins
- quoted values with escape sequences
- comments (`#` / `;`) and line continuations
- `~/ ` expansion, relative `excludesFile` paths resolved against the
current working directory
- `[include] path` recursively, relative to the including file, with cycle
detection (depth limit 10 like git)
- `includeIf` and `/etc/gitconfig` are not supported (out of scope)
- `GitIgnoreBuilder.globalGitIgnore()` now consults `GitConfig` first, then
falls back to the default XDG location
- When `core.excludesFile` is configured but the file is missing, no
fallback occurs (matching git behavior)
- `RAT_NO_GIT_GLOBAL_IGNORE` still disables all global gitignore processing
## Tests
- New `GitConfigTest` (16 tests): parsing, case-insensitivity, quoting,
comments, precedence XDG vs `~/.gitconfig`, `~/` expansion, relative paths,
includes (simple/relative/tilde/recursive/cycle), subsections, missing files,
default fallback
- New `test_global_gitignore_from_config` integration test in
`GitIgnoreBuilderTest`
- Full module build passes: 1147 tests, checkstyle clean
## Verification
`mvn -pl apache-rat-core test` → BUILD SUCCESS (checkstyle included)
--
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]