Inconsistent Case-Sensitivity for WITH Operator

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
cli

Research direction

Start with the parser or validation path used by the ./spdx-validate entry point and reproduce both expressions from the issue. Compare operator handling in simple and parenthesized expressions, then confirm that lowercase "with" is rejected consistently according to the SPDX case-sensitivity rule.

Written by the indexing model from the issue text.

Description

Description

There is a discrepancy in how license expressions are validated based on their complexity. Simple expressions using the WITH operator are validated case-insensitively (allowing lowercase with), whereas complex expressions (using parentheses or multiple operators) require strict uppercase WITH.

This leads to a confusing user experience where MIT with Bison-exception-2.2 passes validation, but the same expression fails when wrapped in a compound statement.

Steps to Reproduce

Simple expression (lowercase 'with'):

printf "GPL-2.0 with Bison-exception-2.2" | ./spdx-validate
# Result: Success (Exit code 0)

Complex Expression (lowercase 'with'):

printf "AFL-1.1 OR (GPL-2.0 with Bison-exception-2.2)" | ./spdx-validate
# line 1: invalid SPDX expression: "AFL-1.1 OR (GPL-2.0 with Bison-exception-2.2)"
# no valid expressions found

Desired Behavior

GPL-2.0 with Bison-exception-2.2 fails as well. According to the spec, "License expression operators (AND, OR and WITH) should be matched in a case-sensitive manner." (Source: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/ D2: Case Sensitivity section).

Dominant language
Go
Stars
53
Forks
16
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/go-spdx

All issues in github/go-spdx

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.