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

spec_helper: Extract FSF approval from wking.github.io/fsf-api #569

Merged
merged 1 commit into from
Jan 3, 2018

Conversation

wking
Copy link
Contributor

@wking wking commented Jan 3, 2018

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 (discussion in #561). 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>'

If you want to test with ./script/check-approval ISC and similar, you should merge #567 and #568 to fix unrelated check-approval issues.

Fixes #561.


# FSF approved the Clear BSD, but doesn't use its SPDX ID or Name
if licenses.keys.include? 'clearbsd'
licenses['bsd-3-clause-clear'] = licenses['clearbsd']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To help with review, this rename is handled in the mock API:

$ curl -s https://wking.github.io/fsf-api/clearbsd.json | jq .identifiers.spdx
[
  "BSD-3-Clause-Clear"
]

The MIT / Expat and other mappings are also handled in the mock API.

@wking
Copy link
Contributor Author

wking commented Jan 3, 2018

I've rebased this PR with d0d926dd7e3049 to pick up the just-merged #568.

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>'
@wking
Copy link
Contributor Author

wking commented Jan 3, 2018

I've pushed b2a489384a7bbb, squashing in the 2becf12 rubocop fixes.

@mlinksva mlinksva merged commit 156babe into github:gh-pages Jan 3, 2018
@wking wking deleted the fsf-api branch January 3, 2018 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FSF approved from the mock-FSF API at wking/fsf-api?
2 participants