{"action":"opened","number":61,"pull_request":{"url":"https://api.github.com/repos/npm/normalize-package-data/pulls/61","id":34597661,"html_url":"https://github.com/npm/normalize-package-data/pull/61","diff_url":"https://github.com/npm/normalize-package-data/pull/61.diff","patch_url":"https://github.com/npm/normalize-package-data/pull/61.patch","issue_url":"https://api.github.com/repos/npm/normalize-package-data/issues/61","number":61,"state":"open","locked":false,"title":"Validate license fields","user":{"login":"kemitchell","id":205760,"avatar_url":"https://avatars.githubusercontent.com/u/205760?v=3","gravatar_id":"","url":"https://api.github.com/users/kemitchell","html_url":"https://github.com/kemitchell","followers_url":"https://api.github.com/users/kemitchell/followers","following_url":"https://api.github.com/users/kemitchell/following{/other_user}","gists_url":"https://api.github.com/users/kemitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/kemitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kemitchell/subscriptions","organizations_url":"https://api.github.com/users/kemitchell/orgs","repos_url":"https://api.github.com/users/kemitchell/repos","events_url":"https://api.github.com/users/kemitchell/events{/privacy}","received_events_url":"https://api.github.com/users/kemitchell/received_events","type":"User","site_admin":false},"body":"This PR adds new warnings about the `\"license\"` field:\r\n\r\n0. when there is no \"`license`\" field (including when \"`licenses`\" is used instead of `\"license\"`)\r\n0. when the value of the `\"license\"` field is not a valid SPDX license expression string per [kemitchell/spdx.js][spdx.js]'s implementation of the most recent standard draft, [beta draft 0.98][spec].\r\n\r\nIt addresses many concerns in npm/npm#6241 and npm/npm#4473.\r\n\r\nI will be happy to make additional commits (or force-push commits) as needed to make this PR easy to merge. I've tried to conform to existing style, structure, and organization; please let me know what I've missed.\r\n\r\nA few notes:\r\n\r\n0. [spdx.js][spdx.js] is a brand new package. The [draft specification][spec] includes an ABNF grammar, but I found I had to make changes to support all of the examples in the draft and some common-sense variations. The test suite (embedded in the README) includes all the examples from the spec, plus a few more. Any help \"torture testing\" would be much appreciated.\r\n\r\n0. SPDX license expressions support complex conjunction and disjunction, e.g. `(Apache-2.0 OR GPL-3.0+)`, which can describe multiply-licensed projects. It also supports `LicenseRef-X` syntax for licenses that don't yet have standard identifiers.\r\n\r\n[spdx.js]: http://github.com/kemitchell/spdx.js\r\n[spec]: http://spdx.org/SPDX-specifications/spdx-version-2.0\r\n\r\nWhy should anyone care? Behold:\r\n- [a list showing 561 of the current 1008 most-depended-upon packages do not have guidelines-approved SPDX-string license properties](https://gist.github.com/kemitchell/5496ae642e08911f12f8)\r\n- [a population study of license properties of all packages](https://gist.github.com/kemitchell/5496ae642e08911f12f8), showing non-SPDX strings like \"BSD\", \"Apache 2.0\", and \"GPLv3\" are very popular, though no string license property at all is by far the largest single sub-population. There are over 800 values total, normalizing for letter case, from the amusing \"TALK TO THE LEGAL DEPARTMENT\" to the asinine and unwelcome \"MOTHER'S TITS\". Someone in npm sales should talk to Totem Labs about private modules!\r\n\r\nMany thanks to the @maxogden and the [dat](http://dat-data.com/) team for making the above possible, and especially to @mafintosh for [dat-npm](https://github.com/mafintosh/dat-npm). Tips of my hat to @hughsk, @wercker and @substack for inspiring conversation.\r\n\r\n@othiym23 mentioned that I should also look at [init-package-json](https://github.com/npm/init-package-json). I have done some additional work on [a function for rules-based estimation of which SPDX identifier was intended by an invalid license string](https://github.com/kemitchell/spdx-correct.js) that may be useful here or there or both. For now, I'm using it to make automated PRs to errant package authors, mostly to raise awareness.","created_at":"2015-05-03T07:33:23Z","updated_at":"2015-05-03T07:33:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/npm/normalize-package-data/pulls/61/commits","review_comments_url":"https://api.github.com/repos/npm/normalize-package-data/pulls/61/comments","review_comment_url":"https://api.github.com/repos/npm/normalize-package-data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npm/normalize-package-data/issues/61/comments","statuses_url":"https://api.github.com/repos/npm/normalize-package-data/statuses/bb95efbf75dfcd4a3f58d8ab1ac615d9e813f5b2","head":{"label":"kemitchell:validate-license-field","ref":"validate-license-field","sha":"bb95efbf75dfcd4a3f58d8ab1ac615d9e813f5b2","user":{"login":"kemitchell","id":205760,"avatar_url":"https://avatars.githubusercontent.com/u/205760?v=3","gravatar_id":"","url":"https://api.github.com/users/kemitchell","html_url":"https://github.com/kemitchell","followers_url":"https://api.github.com/users/kemitchell/followers","following_url":"https://api.github.com/users/kemitchell/following{/other_user}","gists_url":"https://api.github.com/users/kemitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/kemitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kemitchell/subscriptions","organizations_url":"https://api.github.com/users/kemitchell/orgs","repos_url":"https://api.github.com/users/kemitchell/repos","events_url":"https://api.github.com/users/kemitchell/events{/privacy}","received_events_url":"https://api.github.com/users/kemitchell/received_events","type":"User","site_admin":false},"repo":{"id":34897367,"name":"normalize-package-data","full_name":"kemitchell/normalize-package-data","owner":{"login":"kemitchell","id":205760,"avatar_url":"https://avatars.githubusercontent.com/u/205760?v=3","gravatar_id":"","url":"https://api.github.com/users/kemitchell","html_url":"https://github.com/kemitchell","followers_url":"https://api.github.com/users/kemitchell/followers","following_url":"https://api.github.com/users/kemitchell/following{/other_user}","gists_url":"https://api.github.com/users/kemitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/kemitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kemitchell/subscriptions","organizations_url":"https://api.github.com/users/kemitchell/orgs","repos_url":"https://api.github.com/users/kemitchell/repos","events_url":"https://api.github.com/users/kemitchell/events{/privacy}","received_events_url":"https://api.github.com/users/kemitchell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kemitchell/normalize-package-data","description":"normalizes package metadata, typically found in package.json file.","fork":true,"url":"https://api.github.com/repos/kemitchell/normalize-package-data","forks_url":"https://api.github.com/repos/kemitchell/normalize-package-data/forks","keys_url":"https://api.github.com/repos/kemitchell/normalize-package-data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kemitchell/normalize-package-data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kemitchell/normalize-package-data/teams","hooks_url":"https://api.github.com/repos/kemitchell/normalize-package-data/hooks","issue_events_url":"https://api.github.com/repos/kemitchell/normalize-package-data/issues/events{/number}","events_url":"https://api.github.com/repos/kemitchell/normalize-package-data/events","assignees_url":"https://api.github.com/repos/kemitchell/normalize-package-data/assignees{/user}","branches_url":"https://api.github.com/repos/kemitchell/normalize-package-data/branches{/branch}","tags_url":"https://api.github.com/repos/kemitchell/normalize-package-data/tags","blobs_url":"https://api.github.com/repos/kemitchell/normalize-package-data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kemitchell/normalize-package-data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kemitchell/normalize-package-data/git/refs{/sha}","trees_url":"https://api.github.com/repos/kemitchell/normalize-package-data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kemitchell/normalize-package-data/statuses/{sha}","languages_url":"https://api.github.com/repos/kemitchell/normalize-package-data/languages","stargazers_url":"https://api.github.com/repos/kemitchell/normalize-package-data/stargazers","contributors_url":"https://api.github.com/repos/kemitchell/normalize-package-data/contributors","subscribers_url":"https://api.github.com/repos/kemitchell/normalize-package-data/subscribers","subscription_url":"https://api.github.com/repos/kemitchell/normalize-package-data/subscription","commits_url":"https://api.github.com/repos/kemitchell/normalize-package-data/commits{/sha}","git_commits_url":"https://api.github.com/repos/kemitchell/normalize-package-data/git/commits{/sha}","comments_url":"https://api.github.com/repos/kemitchell/normalize-package-data/comments{/number}","issue_comment_url":"https://api.github.com/repos/kemitchell/normalize-package-data/issues/comments{/number}","contents_url":"https://api.github.com/repos/kemitchell/normalize-package-data/contents/{+path}","compare_url":"https://api.github.com/repos/kemitchell/normalize-package-data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kemitchell/normalize-package-data/merges","archive_url":"https://api.github.com/repos/kemitchell/normalize-package-data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kemitchell/normalize-package-data/downloads","issues_url":"https://api.github.com/repos/kemitchell/normalize-package-data/issues{/number}","pulls_url":"https://api.github.com/repos/kemitchell/normalize-package-data/pulls{/number}","milestones_url":"https://api.github.com/repos/kemitchell/normalize-package-data/milestones{/number}","notifications_url":"https://api.github.com/repos/kemitchell/normalize-package-data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kemitchell/normalize-package-data/labels{/name}","releases_url":"https://api.github.com/repos/kemitchell/normalize-package-data/releases{/id}","created_at":"2015-05-01T09:54:51Z","updated_at":"2015-05-01T09:54:52Z","pushed_at":"2015-05-03T06:46:40Z","git_url":"git://github.com/kemitchell/normalize-package-data.git","ssh_url":"git@github.com:kemitchell/normalize-package-data.git","clone_url":"https://github.com/kemitchell/normalize-package-data.git","svn_url":"https://github.com/kemitchell/normalize-package-data","homepage":"","size":204,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"npm:master","ref":"master","sha":"ea0b959633e4803685bae2283d3d79a0115e6f8a","user":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"repo":{"id":9301720,"name":"normalize-package-data","full_name":"npm/normalize-package-data","owner":{"login":"npm","id":6078720,"avatar_url":"https://avatars.githubusercontent.com/u/6078720?v=3","gravatar_id":"","url":"https://api.github.com/users/npm","html_url":"https://github.com/npm","followers_url":"https://api.github.com/users/npm/followers","following_url":"https://api.github.com/users/npm/following{/other_user}","gists_url":"https://api.github.com/users/npm/gists{/gist_id}","starred_url":"https://api.github.com/users/npm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npm/subscriptions","organizations_url":"https://api.github.com/users/npm/orgs","repos_url":"https://api.github.com/users/npm/repos","events_url":"https://api.github.com/users/npm/events{/privacy}","received_events_url":"https://api.github.com/users/npm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/npm/normalize-package-data","description":"normalizes package metadata, typically found in package.json file.","fork":false,"url":"https://api.github.com/repos/npm/normalize-package-data","forks_url":"https://api.github.com/repos/npm/normalize-package-data/forks","keys_url":"https://api.github.com/repos/npm/normalize-package-data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npm/normalize-package-data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npm/normalize-package-data/teams","hooks_url":"https://api.github.com/repos/npm/normalize-package-data/hooks","issue_events_url":"https://api.github.com/repos/npm/normalize-package-data/issues/events{/number}","events_url":"https://api.github.com/repos/npm/normalize-package-data/events","assignees_url":"https://api.github.com/repos/npm/normalize-package-data/assignees{/user}","branches_url":"https://api.github.com/repos/npm/normalize-package-data/branches{/branch}","tags_url":"https://api.github.com/repos/npm/normalize-package-data/tags","blobs_url":"https://api.github.com/repos/npm/normalize-package-data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npm/normalize-package-data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npm/normalize-package-data/git/refs{/sha}","trees_url":"https://api.github.com/repos/npm/normalize-package-data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npm/normalize-package-data/statuses/{sha}","languages_url":"https://api.github.com/repos/npm/normalize-package-data/languages","stargazers_url":"https://api.github.com/repos/npm/normalize-package-data/stargazers","contributors_url":"https://api.github.com/repos/npm/normalize-package-data/contributors","subscribers_url":"https://api.github.com/repos/npm/normalize-package-data/subscribers","subscription_url":"https://api.github.com/repos/npm/normalize-package-data/subscription","commits_url":"https://api.github.com/repos/npm/normalize-package-data/commits{/sha}","git_commits_url":"https://api.github.com/repos/npm/normalize-package-data/git/commits{/sha}","comments_url":"https://api.github.com/repos/npm/normalize-package-data/comments{/number}","issue_comment_url":"https://api.github.com/repos/npm/normalize-package-data/issues/comments{/number}","contents_url":"https://api.github.com/repos/npm/normalize-package-data/contents/{+path}","compare_url":"https://api.github.com/repos/npm/normalize-package-data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npm/normalize-package-data/merges","archive_url":"https://api.github.com/repos/npm/normalize-package-data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npm/normalize-package-data/downloads","issues_url":"https://api.github.com/repos/npm/normalize-package-data/issues{/number}","pulls_url":"https://api.github.com/repos/npm/normalize-package-data/pulls{/number}","milestones_url":"https://api.github.com/repos/npm/normalize-package-data/milestones{/number}","notifications_url":"https://api.github.com/repos/npm/normalize-package-data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npm/normalize-package-data/labels{/name}","releases_url":"https://api.github.com/repos/npm/normalize-package-data/releases{/id}","created_at":"2013-04-08T16:57:30Z","updated_at":"2015-04-06T23:20:20Z","pushed_at":"2015-05-03T06:49:57Z","git_url":"git://github.com/npm/normalize-package-data.git","ssh_url":"git@github.com:npm/normalize-package-data.git","clone_url":"https://github.com/npm/normalize-package-data.git","svn_url":"https://github.com/npm/normalize-package-data","homepage":"","size":778,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":21,"forks":12,"open_issues":21,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npm/normalize-package-data/pulls/61"},"html":{"href":"https://github.com/npm/normalize-package-data/pull/61"},"issue":{"href":"https://api.github.com/repos/npm/normalize-package-data/issues/61"},"comments":{"href":"https://api.github.com/repos/npm/normalize-package-data/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/npm/normalize-package-data/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/npm/normalize-package-data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npm/normalize-package-data/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/npm/normalize-package-data/statuses/bb95efbf75dfcd4a3f58d8ab1ac615d9e813f5b2"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":62,"deletions":10,"changed_files":8}}