rambleraptor opened a new pull request, #1888:
URL: https://github.com/apache/iceberg-go/pull/1888

   ### Problem
   
   Running `dev/check-license` from a **git worktree** fails with a false 
positive:
   
   ```
   Could not find Apache license headers in the following files:
    !????? /path/to/worktree/.git
   ```
   
   In a worktree, `.git` is a small text file (`gitdir: …`) rather than a 
directory. RAT's built-in SCM exclusion only skips `.git` when it is a 
*directory*, so the pointer file gets scanned as source and flagged. CI never 
sees this because `actions/checkout` produces a full clone.
   
   ### Fix
   
   Adopt the invocation iceberg-python already uses 
([`dev/check-license`](https://github.com/apache/iceberg-python/blob/main/dev/check-license)):
 RAT 0.17 with `--input-exclude-std GIT`, which skips `.git` either way plus 
anything matched by `.gitignore`.
   
   Two things come along with the upgrade:
   
   - Pass/fail now comes from RAT's own exit code instead of grepping `"??"` 
out of a full report, so the `build/rat-results.txt` scratch file goes away.
   - Exclusion patterns are matched against paths rather than bare filenames. 
RAT 0.15 matched names only, which meant the `puffin/testdata/*` entry in 
`rat_exclude_files.txt` had never matched anything (those files passed only 
because RAT classified them as binary). No change to `rat_exclude_files.txt` is 
needed — every existing entry still resolves.
   
   `dev/release/run_rat.sh` is untouched; it already runs 0.16.1 against the 
release tarball.
   
   ### Testing
   
   - Clean run in a git worktree (previously failed) and in a full clone: both 
pass.
   - Negative test — a file with no header is still reported and the script 
exits 1:
     ```
     Files with missing headers:
       /zz_noheader.go
     ```
   - A `.gitignore`d file with no header is correctly skipped.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to