Repository navigation
fix: evaluate full SPDX license expressions - #98
Conversation
The header regex stopped at the first identifier, so MIT OR GPL-3.0 was recorded as MIT and allowed. Capture the whole expression and fail closed if any symbol is blocked. Fixes NVIDIA#86 Signed-off-by: mimran-khan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
The focused license suite passes (28 tests), with Ruff and diff checks clean, but compound SPDX headers still pass in common block/HTML comment forms. Blocking reproduction is inline. The shared Gitleaks failure is from non-ancestor commits on an unrelated branch.
A JS or HTML SPDX header captured `MIT OR GPL-3.0 */` (or `-->`), so the GPL half looked unknown and default validation warned instead of blocking. Drop `*/` and `-->` before splitting the expression. Fixes NVIDIA#86 Signed-off-by: mimran-khan <[email protected]>
# Conflicts: # CHANGELOG.md
|
Merged main and the SPDX comment-terminator fix is still on branch. Ready for re-review. |
Stop SPDX extraction at the first */ or --> anywhere in the captured line, not only when the terminator is at the end. Add a regression for inline block comments that share a line with trailing source code.
|
@mimran-khan : Please resolve the merge conflicts. |
|
Merged latest main and pushed the inline SPDX terminator fix. Ready for another look when you have time. |
Stale review: the requested SPDX block and HTML comment terminator handling is addressed at current head 2954bf9; required checks are green, the thread is resolved, and the current head has maintainer approval.
Summary
SPDX headers like
MIT OR GPL-3.0were truncated toMIT, so the copyleft half never ran and the license check passed. A plainGPL-3.0header was already blocked.I capture the full expression and fail closed if any symbol is on the blocklist.
MIT OR MIT-0still passes. Fixes #86.Verification
make lintmake testmake buildRelease Impact
CHANGELOG.md