Skip to content

Accept LicenseRef exceptions in ParseSyntax - #37

Merged
andrew merged 1 commit into
mainfrom
fix/parse-syntax-reference-exceptions
Nov 2, 2026
Merged

andrew merged 1 commit into
mainfrom
fix/parse-syntax-reference-exceptions

Conversation

@andrew

@andrew andrew commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ParseSyntax rejects ScanCode exception identifiers such as GPL-2.0-only WITH LicenseRef-scancode-cygwin-exception-2.0 before checking their syntax.

Accept well-formed LicenseRef-* identifiers after WITH in ParseSyntax for ScanCode compatibility. Preserve the identifier in License.Exception and keep strict parsing unchanged. Add regression coverage for reference syntax, compound expressions and identifier rewriting.

Closes #36

Copilot AI balanced review requested due to automatic review settings November 2, 2026 13:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change adding syntax-only support for LicenseRef-* exception identifiers.

No open issues 🎉

What changed in this PR

Updates ParseSyntax to accept well-formed LicenseRef-* exception identifiers after WITH, addressing ScanCode compatibility in issue #36 while preserving strict parsing behavior.

Changes:

  • Accept and validate exception references, preserving their text in License.Exception.
  • Document the compatibility behavior.
  • Add regression coverage for malformed references, compound expressions, identifier rewriting, and strict-parser rejection.
File Description
parse.go Accepts and validates exception references in syntax-only parsing and documents support.
parse_syntax_test.go Tests reference acceptance, rejection, AST preservation, and rewriting.

Review effort: Balanced

@andrew
andrew merged commit 9075e8f into main Nov 2, 2026
6 checks passed
@andrew
andrew deleted the fix/parse-syntax-reference-exceptions branch November 2, 2026 14:44
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.

spdx.ParseSyntax fails for LicenseRef-scancode- exceptions

2 participants