Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide mixed-case SPDX license identifier in response (e.g., as a 'spdx' value) #72

Closed
david-a-wheeler opened this issue Nov 5, 2015 · 9 comments

Comments

@david-a-wheeler
Copy link

It'd be great if this provided the SPDX 2.0 license name... or even better, a SPDX license expression where there are multiple licenses in a LICENSE{.md} file.

@benbalter
Copy link
Contributor

For now, it does not support multiple licenses (see #57). That said, all license names are outputted as their SPDX name and ID. Without multiple license support, is there need to support expressions?

@david-a-wheeler
Copy link
Author

I don't think it currently provides exactly the SPDX name. The 'key' is close, but it's all lower case. As I understand it, SDPX names are case-sensitive, and include 'MIT', 'GPL-2.0', and 'Intel'. Upcasing works for 'mit' and 'gpl-2.0', but not for other licenses like 'Intel'.

Can the key be exactly the SPDX name? If not, can you add a SPDX value as a result?

BTW, I'm planning to use the GitHub license API, knowing it's still in flux, to get this data from GitHub.

Of course it'd be WAY better if it could support multiple licenses :-). But just outputting SPDX values for single-license repos would be a big help.

Thanks!

@benbalter
Copy link
Contributor

As I understand it, SDPX names are case-sensitiv

Going off of the License Expression FAQ:

Is the License Expression Syntax Case Sensitive?

No. One can use both upper or lower case.

Is there another standard/place we should be looking? (I thought I went down this path when I first spec'd things out, the reason their down cased is because they are filenames on disk, and Git).

@david-a-wheeler
Copy link
Author

The license expression syntax is case-insensitive (e.g., and, or). But I don't know that the license identifiers are case-insensitive.

@david-a-wheeler
Copy link
Author

Downcasing for use as a key is perfectly sensible. But the SPDX 2.0 spec seems to be very precise about the upper/lower case value of license identifiers, so I'd really like to use the "official" names. I think you could just add that as a field that can be returned.

@david-a-wheeler david-a-wheeler changed the title Provide SPDX license expressions Provide mixed-case SPDX license identifier in response (e.g., as a 'spdx' value) Nov 19, 2015
@david-a-wheeler
Copy link
Author

Per http://wiki.spdx.org/view/Legal_Team/Minutes/2014-09-18 the license IDs are case-insensitive, but "best practice would be to display with precise capitalization". Can licensee provide a field (such as "spdx") with the mixed-case exact license ID name?

@benbalter
Copy link
Contributor

This is now exposed as the spdx-id license metadata field.

@david-a-wheeler
Copy link
Author

Awesome! Thanks.

wking added a commit to wking/choosealicense.com that referenced this issue Jan 3, 2018
The previous case-insensitive matching was removed in e5f46fa (test
required spdx-ids against data from spdx, 2016-05-25, github#418).  That
commit was designed [1] to allow case-sensitive matching as discussed
in [2].  But while I'm in favor of case-sensitive keys in spdx_list,
the case-sensitive match breaks script/check-approval which downcases
its argument since it was added in 8e56bb8 (add
script/check-approval, 2016-01-18, github#318).

[1]: github#418 (comment)
[2]: licensee/licensee#72
wking added a commit to wking/choosealicense.com that referenced this issue Jan 3, 2018
The previous case-insensitive matching was removed in e5f46fa (test
required spdx-ids against data from spdx, 2016-05-25, github#418).  That
commit was designed [1] to allow case-sensitive matching as discussed
in [2].  But while I'm in favor of case-sensitive keys in spdx_list,
the case-sensitive match breaks script/check-approval which downcases
its argument since it was added in 8e56bb8 (add
script/check-approval, 2016-01-18, github#318).

There are more notes on SPDX's plans for case sensitivity in [3], so
we should see a clearer policy there soon.  I'm arguing for
case-sensitive *display* with optional case-insensitive matching.  I
am optimistic that the SPDX will at least agree not to register short
IDs that only differ by case, which is all we need to make this
case-insensitive match safe here.

[1]: github#418 (comment)
[2]: licensee/licensee#72
[3]: spdx/spdx-spec#63
@wking
Copy link
Contributor

wking commented Mar 28, 2018

And with the just-landed #283, we've dropped the downcasing from matched_license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants