ci(rat): enforce the ASF licence header on .gitignore files#847
Merged
Conversation
RAT's parsed-scm GIT exclusion self-excludes the tracked .gitignore files, so the headers stamped by add-license-headers were not actually enforced in CI. Add `--input-include '**/.gitignore'` to override that exclusion so RAT scans (and requires an approved header on) every tracked .gitignore. Verified locally with apache-rat 0.18: +8 .gitignore files move into scope, all Approved (0 unapproved); a headerless .gitignore is reported Unapproved and fails the check. `.git/` stays excluded as a hidden dir, and .apache-magpie-overrides/.gitignore stays excluded under its hidden dir.
8b13d04 to
54cb335
Compare
Member
|
a git ignore is is just a list of files aand as such is can't have copyright - I suggest no header is needed |
Member
Author
Yeah. Currently RAT will flag them - unfortunately - at least the RAT run in ATR - there are some flags that exclude those files. For next version I will just add them to .rat-excludes |
Member
Author
|
(but it's not blocking the release I guess) |
Member
Author
|
Reversed in #849: dropped the headers and excluded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
RAT already runs in CI, but it was not scanning
.gitignorefiles — its--input-exclude-parsed-scm GITreads the.gitignorefiles and self-excludesthem, so the ASF headers stamped by the prek
add-license-headershook (addedin #846) were not actually enforced. A future headerless
.gitignorewouldslip through CI.
What
Add
--input-include '**/.gitignore'to the RAT invocation in.github/workflows/rat.yml.--input-includeoverrides the SCM/stdexclusions for exactly the tracked
.gitignorefiles, so RAT scans them andrequires an approved header.
Verification (apache-rat 0.18, run locally)
.gitignorefiles move into scope (Standards2292 → 2300), all Approved,
Unapproved: 0..gitignorewith no header is reported Unapproved andfails the check.
.git/stays excluded as a hidden dir;.apache-magpie-overrides/.gitignorestays excluded under its hidden dir (no behaviour change there).
Follow-up to #846
#846 (headers + prek stamper) is merged; this PR is rebased onto it, so the
diff is just the one-line workflow change.