1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 04:40:09 +01:00

spec_helper: Restore case-insensitive matching in find_spdx

The previous case-insensitive matching was removed in e5f46faa (test
required spdx-ids against data from spdx, 2016-05-25, #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 8e56bb83 (add
script/check-approval, 2016-01-18, #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]: https://github.com/github/choosealicense.com/pull/418#issuecomment-221404630
[2]: https://github.com/benbalter/licensee/issues/72
[3]: https://github.com/spdx/spdx-spec/issues/63
This commit is contained in:
W. Trevor King 2018-01-03 11:08:38 -08:00
parent 5f83952a41
commit af78adb4fe

View File

@ -86,7 +86,7 @@ def spdx_ids
end end
def find_spdx(license) def find_spdx(license)
spdx_list.find { |name, _properties| name == license } spdx_list.find { |name, _properties| name.casecmp(license).zero? }
end end
def osi_approved_licenses def osi_approved_licenses