{"action":"created","comment":{"url":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/comments/47637281","id":47637281,"diff_hunk":"@@ -224,12 +225,15 @@ var ManifestParser = (function() {\n   function _parse(string) {\n     // TODO: temporary while ManifestParser is a collection of static methods.\n     _logs = [];\n+    _tips = [];\n     _success = true;\n \n     try {\n       _json_input = JSON.parse(string);\n     } catch (e) {\n       _logs.push(\"File isn't valid JSON: \" + e);\n+      _tips.push(\"Double quotes are considered valid JSON, single quotes aren't. Make sure you use double quotes.\");","path":"manifest-parser.js","position":19,"original_position":19,"commit_id":"b4f3283fec41e850239a4a403235816adf21e909","original_commit_id":"b4f3283fec41e850239a4a403235816adf21e909","user":{"login":"mounirlamouri","id":573590,"avatar_url":"https://avatars.githubusercontent.com/u/573590?v=3","gravatar_id":"","url":"https://api.github.com/users/mounirlamouri","html_url":"https://github.com/mounirlamouri","followers_url":"https://api.github.com/users/mounirlamouri/followers","following_url":"https://api.github.com/users/mounirlamouri/following{/other_user}","gists_url":"https://api.github.com/users/mounirlamouri/gists{/gist_id}","starred_url":"https://api.github.com/users/mounirlamouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mounirlamouri/subscriptions","organizations_url":"https://api.github.com/users/mounirlamouri/orgs","repos_url":"https://api.github.com/users/mounirlamouri/repos","events_url":"https://api.github.com/users/mounirlamouri/events{/privacy}","received_events_url":"https://api.github.com/users/mounirlamouri/received_events","type":"User","site_admin":false},"body":"I would do something like:\r\n```js\r\n_tips.push('Your JSON failed to parse, these are the main reasons why JSON parsing usually fails:\\n - Double quotes should be used around property names and for strings. Single quotes are not valid.\\n - JSON specification disallow trailing comma after the last property even if some implementations allow it.');\r\n```\r\n\r\n\r\nIOW:\r\n- mention that the tips are related to the JSON parsing failure.\r\n- mention when double quotes are usually used.\r\n- use single quotes ;)\r\n- optional: make this only one tip?\r\n\r\nlgtm with this.","created_at":"2015-12-15T13:49:29Z","updated_at":"2015-12-15T13:49:29Z","html_url":"https://github.com/mounirlamouri/manifest-validator/pull/12#discussion_r47637281","pull_request_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/comments/47637281"},"html":{"href":"https://github.com/mounirlamouri/manifest-validator/pull/12#discussion_r47637281"},"pull_request":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12","id":53690175,"html_url":"https://github.com/mounirlamouri/manifest-validator/pull/12","diff_url":"https://github.com/mounirlamouri/manifest-validator/pull/12.diff","patch_url":"https://github.com/mounirlamouri/manifest-validator/pull/12.patch","issue_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/issues/12","number":12,"state":"open","locked":false,"title":"Added tips","user":{"login":"beaufortfrancois","id":634478,"avatar_url":"https://avatars.githubusercontent.com/u/634478?v=3","gravatar_id":"","url":"https://api.github.com/users/beaufortfrancois","html_url":"https://github.com/beaufortfrancois","followers_url":"https://api.github.com/users/beaufortfrancois/followers","following_url":"https://api.github.com/users/beaufortfrancois/following{/other_user}","gists_url":"https://api.github.com/users/beaufortfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufortfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufortfrancois/subscriptions","organizations_url":"https://api.github.com/users/beaufortfrancois/orgs","repos_url":"https://api.github.com/users/beaufortfrancois/repos","events_url":"https://api.github.com/users/beaufortfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/beaufortfrancois/received_events","type":"User","site_admin":false},"body":"As discussed in https://github.com/mounirlamouri/manifest-validator/pull/9, here's a simple way to show common tips when `JSON.parse` fails. ","created_at":"2015-12-15T11:18:50Z","updated_at":"2015-12-15T13:49:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d15ca5d191b44cd89065b7f07e576fd4086543d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12/commits","review_comments_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12/comments","review_comment_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/issues/12/comments","statuses_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/statuses/b4f3283fec41e850239a4a403235816adf21e909","head":{"label":"beaufortfrancois:addTips","ref":"addTips","sha":"b4f3283fec41e850239a4a403235816adf21e909","user":{"login":"beaufortfrancois","id":634478,"avatar_url":"https://avatars.githubusercontent.com/u/634478?v=3","gravatar_id":"","url":"https://api.github.com/users/beaufortfrancois","html_url":"https://github.com/beaufortfrancois","followers_url":"https://api.github.com/users/beaufortfrancois/followers","following_url":"https://api.github.com/users/beaufortfrancois/following{/other_user}","gists_url":"https://api.github.com/users/beaufortfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufortfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufortfrancois/subscriptions","organizations_url":"https://api.github.com/users/beaufortfrancois/orgs","repos_url":"https://api.github.com/users/beaufortfrancois/repos","events_url":"https://api.github.com/users/beaufortfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/beaufortfrancois/received_events","type":"User","site_admin":false},"repo":{"id":47962913,"name":"manifest-validator","full_name":"beaufortfrancois/manifest-validator","owner":{"login":"beaufortfrancois","id":634478,"avatar_url":"https://avatars.githubusercontent.com/u/634478?v=3","gravatar_id":"","url":"https://api.github.com/users/beaufortfrancois","html_url":"https://github.com/beaufortfrancois","followers_url":"https://api.github.com/users/beaufortfrancois/followers","following_url":"https://api.github.com/users/beaufortfrancois/following{/other_user}","gists_url":"https://api.github.com/users/beaufortfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufortfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufortfrancois/subscriptions","organizations_url":"https://api.github.com/users/beaufortfrancois/orgs","repos_url":"https://api.github.com/users/beaufortfrancois/repos","events_url":"https://api.github.com/users/beaufortfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/beaufortfrancois/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beaufortfrancois/manifest-validator","description":"Web Manifest Validator","fork":true,"url":"https://api.github.com/repos/beaufortfrancois/manifest-validator","forks_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/forks","keys_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/teams","hooks_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/hooks","issue_events_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/issues/events{/number}","events_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/events","assignees_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/assignees{/user}","branches_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/branches{/branch}","tags_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/tags","blobs_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/languages","stargazers_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/stargazers","contributors_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/contributors","subscribers_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/subscribers","subscription_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/subscription","commits_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/contents/{+path}","compare_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/merges","archive_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/downloads","issues_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/issues{/number}","pulls_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/labels{/name}","releases_url":"https://api.github.com/repos/beaufortfrancois/manifest-validator/releases{/id}","created_at":"2015-12-14T08:52:42Z","updated_at":"2015-12-14T08:52:42Z","pushed_at":"2015-12-15T11:23:08Z","git_url":"git://github.com/beaufortfrancois/manifest-validator.git","ssh_url":"git@github.com:beaufortfrancois/manifest-validator.git","clone_url":"https://github.com/beaufortfrancois/manifest-validator.git","svn_url":"https://github.com/beaufortfrancois/manifest-validator","homepage":"https://mounirlamouri.github.io/manifest-validator/","size":21,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"mounirlamouri:gh-pages","ref":"gh-pages","sha":"c6d72897be91c15763a4ffdc4a8962698720d70c","user":{"login":"mounirlamouri","id":573590,"avatar_url":"https://avatars.githubusercontent.com/u/573590?v=3","gravatar_id":"","url":"https://api.github.com/users/mounirlamouri","html_url":"https://github.com/mounirlamouri","followers_url":"https://api.github.com/users/mounirlamouri/followers","following_url":"https://api.github.com/users/mounirlamouri/following{/other_user}","gists_url":"https://api.github.com/users/mounirlamouri/gists{/gist_id}","starred_url":"https://api.github.com/users/mounirlamouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mounirlamouri/subscriptions","organizations_url":"https://api.github.com/users/mounirlamouri/orgs","repos_url":"https://api.github.com/users/mounirlamouri/repos","events_url":"https://api.github.com/users/mounirlamouri/events{/privacy}","received_events_url":"https://api.github.com/users/mounirlamouri/received_events","type":"User","site_admin":false},"repo":{"id":41757986,"name":"manifest-validator","full_name":"mounirlamouri/manifest-validator","owner":{"login":"mounirlamouri","id":573590,"avatar_url":"https://avatars.githubusercontent.com/u/573590?v=3","gravatar_id":"","url":"https://api.github.com/users/mounirlamouri","html_url":"https://github.com/mounirlamouri","followers_url":"https://api.github.com/users/mounirlamouri/followers","following_url":"https://api.github.com/users/mounirlamouri/following{/other_user}","gists_url":"https://api.github.com/users/mounirlamouri/gists{/gist_id}","starred_url":"https://api.github.com/users/mounirlamouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mounirlamouri/subscriptions","organizations_url":"https://api.github.com/users/mounirlamouri/orgs","repos_url":"https://api.github.com/users/mounirlamouri/repos","events_url":"https://api.github.com/users/mounirlamouri/events{/privacy}","received_events_url":"https://api.github.com/users/mounirlamouri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mounirlamouri/manifest-validator","description":"Web Manifest Validator","fork":false,"url":"https://api.github.com/repos/mounirlamouri/manifest-validator","forks_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/forks","keys_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/teams","hooks_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/hooks","issue_events_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/issues/events{/number}","events_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/events","assignees_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/assignees{/user}","branches_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/branches{/branch}","tags_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/tags","blobs_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/languages","stargazers_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/stargazers","contributors_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/contributors","subscribers_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/subscribers","subscription_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/subscription","commits_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/contents/{+path}","compare_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/merges","archive_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/downloads","issues_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/issues{/number}","pulls_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/labels{/name}","releases_url":"https://api.github.com/repos/mounirlamouri/manifest-validator/releases{/id}","created_at":"2015-09-01T19:12:30Z","updated_at":"2015-12-15T11:10:25Z","pushed_at":"2015-12-15T11:23:08Z","git_url":"git://github.com/mounirlamouri/manifest-validator.git","ssh_url":"git@github.com:mounirlamouri/manifest-validator.git","clone_url":"https://github.com/mounirlamouri/manifest-validator.git","svn_url":"https://github.com/mounirlamouri/manifest-validator","homepage":"https://mounirlamouri.github.io/manifest-validator/","size":561,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":8,"forks":2,"open_issues":8,"watchers":8,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12"},"html":{"href":"https://github.com/mounirlamouri/manifest-validator/pull/12"},"issue":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/issues/12"},"comments":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/mounirlamouri/manifest-validator/statuses/b4f3283fec41e850239a4a403235816adf21e909"}}}}