Skip to content

fix: evaluate full SPDX license expressions - #98

Merged
chrisknvidia merged 7 commits into
NVIDIA:mainfrom
mimran-khan:fix/spdx-or-expression-truncated
Sep 3, 2026
Merged

chrisknvidia merged 7 commits into
NVIDIA:mainfrom
mimran-khan:fix/spdx-or-expression-truncated

Conversation

@mimran-khan

Copy link
Copy Markdown
Contributor

Summary

SPDX headers like MIT OR GPL-3.0 were truncated to MIT, so the copyleft half never ran and the license check passed. A plain GPL-3.0 header was already blocked.

I capture the full expression and fail closed if any symbol is on the blocklist. MIT OR MIT-0 still passes. Fixes #86.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Release Impact

  • Updated CHANGELOG.md

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 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/skillevaluator/constants.py Resolved
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]>
@mimran-khan

Copy link
Copy Markdown
Contributor Author

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.
@chrisknvidia

Copy link
Copy Markdown
Collaborator

@mimran-khan : Please resolve the merge conflicts.

@mimran-khan

Copy link
Copy Markdown
Contributor Author

Merged latest main and pushed the inline SPDX terminator fix. Ready for another look when you have time.

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@chrisknvidia
chrisknvidia dismissed rng1995’s stale review September 3, 2026 07:52

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.

@chrisknvidia
chrisknvidia merged commit 7ddcafb into NVIDIA:main Sep 3, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: SPDX-License-Identifier "MIT OR GPL-3.0" is truncated to MIT and allowed

3 participants