这是indexloc提供的服务,不要输入任何密码
Skip to content

Case senstivity of License Expression Operators #111

@deo002

Description

@deo002

Hi, thanks for this wonderful tool!

Description

The API ValidateLicenses is used to determine if any of the provided license expressions is invalid.

There's a slight issue with the casing of license expression operators in this API.

Case 1:

valid, invalidLicenses := ValidateLicenses([]string{"MIT AND APACHE-2.0"})
assert.True(valid) // works

Case 2:

valid, invalidLicenses := ValidateLicenses([]string{"MIT and APACHE-2.0"})
assert.True(valid) // doesn't work

According to the SPDX specification, "License expression operators (AND, and, OR, or, WITH and with) should be matched in a case-sensitive manner, i.e., letters must be all upper case or all lower case." Ref: https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/.
Thus, Case 2 should have been valid too.

Desired Behaviour

The API ValidateLicenses accepts license expressions with all lowercase operators too(and, or, with).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions