The old root object has been moved under 'licenses' with
wking/fsf-api@8398a357 (pull: Add JSON-LD markup, 2018-01-04,
wking/fsf-api#12) for better forward/backward compatibility.
Unfortunately, this results in another one-time incompatible change,
which this commit accommodates.
The protection from future changes (which should be rare) isn't great,
because we're still parsing the document as JSON. There is at least
one JSON-LD parser for Ruby [1], but I've stuck with vanilla JSON to
avoid pullling in an external dependency just for this rather
peripheral functionality.
[1]: https://github.com/ruby-rdf/json-ld/
Ideally the FSF would be maintaining the API (or any API), but until
someone can talk them into that I think we can save work by
collaborating on the mock API. Using a JSON API also allows us to
drop the Nokogiri dependency.
The parens feel excessive, and I'm not familiar with Ruby, so they
might be. However, removing the parens from the libre check resulted
in:
$ ./script/check-approval ISC
./script/check-approval:8:in `require_relative': /.../choosealicense.com/spec/spec_helper.rb:108: syntax error, unexpected tSTRING_BEG, expecting keyword_then or ';' or '\n' (SyntaxError)
...gs') && meta['tags'].include? 'libre'
... ^
/.../choosealicense.com/spec/spec_helper.rb:116: syntax error, unexpected keyword_end, expecting end-of-input
from ./script/check-approval:8:in `<main>'
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
that's where they're likely to be, outside of examples at the end
of long licenses
still want to check as if there are unknown [] fields in first
1000 characters, might be a field that should be filled in, but
wouldn't for lack of correct name
- document criteria for whether a license is hidden
- needed for license spectrum on /licenses OR
- on 'popular' list at https://opensource.org/licenses (some other list could be used in the future)
- adjust license properties and tests accordingly
This gets non-hidden list back close to what it was before #386 and (pending licensee vendoring this change, licensee release, and github.com licensee dependency version bump) some commonly requested licenses (eg #413#449) will reappear in the github.com license drop-down.