{"action":"created","comment":{"url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/comments/50696027","id":50696027,"diff_hunk":"@@ -57,30 +57,62 @@ module.exports = function (swig) {\n \n   res.fail = function handlebarsFailure (e) {\n \n-    // Parse error on line 13:\n-    // ...></section>{{/if}}\n-    // ---------------------^\n-    // Expecting 'INVERSE', 'OPEN_ENDBLOCK', got 'EOF'\n+    // As of Handlebars 4.x, it is throwing two different kinds of errors.\n+    // A parse error:\n+    //\n+    //   Parse error on line 13:\n+    //   ...></section>{{/if}}\n+    //   ---------------------^\n+    //   Expecting 'INVERSE', 'OPEN_ENDBLOCK', got 'EOF'\n+    //\n+    // and a regular error:\n+    //\n+    //   {\n+    //     \"lineNumber\": 3,\n+    //     \"message\": \"if doesn't match title - 3:3\",\n+    //     \"name\": \"Error\",\n+    //     \"column\": 3\n+    //   }\n+    //\n+    // we need to check for both.\n+    // open issue asking for unification: https://github.com/wycats/handlebars.js/issues/1173\n \n     errors = true;\n \n     var message = e.message,\n-      file = e.fileName.underline,\n+      file = e.fileName.replace(process.cwd(), '').underline,\n       lines = message.split('\\n'),\n-      error = lines[0],\n-      badCode = lines[1],\n-      position = lines[2],\n-      expected = lines[3] || 'Something went awry.',\n       pad = swig.log.padding + swig.log.padding + ' ',\n-      matches = error.match(/(line (\\d)+)\\:/),\n-      lineNumber = matches[1] || 'line ???';\n+      error,\n+      badCode,\n+      position,\n+      expected,\n+      matches,\n+      lineNumber,\n+      linePad;\n \n     swig.log();\n     swig.log.error(null, file);\n \n-    swig.log(swig.log.padding + ' ' + expected.cyan);\n-    swig.log(pad + lineNumber.grey + ' ' + badCode.blue);\n-    swig.log(pad + (lineNumber + ' ').replace(/\\w/g, ' ') + position);\n+    // we're dealing with a parse error\n+    if (/Parse error on line/.test(message)) {\n+      error = lines[0];\n+      badCode = lines[1];\n+      position = lines[2];\n+      expected = lines[3] || 'Something went awry.';\n+      matches = error.match(/(line (\\d)+)\\:/);\n+      lineNumber = matches[1] || 'line ???';\n+      linePad = (new Array(lineNumber.length + 1)).fill(' ').join('');\n+\n+      swig.log(pad + lineNumber.grey + ' ' + badCode.blue);","path":"lib/swig-lint/lib/reporters/handlebars-reporter.js","position":65,"original_position":65,"commit_id":"69fd3df13aa68bd756c2f6e2408fcba6a52a778b","original_commit_id":"69fd3df13aa68bd756c2f6e2408fcba6a52a778b","user":{"login":"shellscape","id":76371,"avatar_url":"https://avatars.githubusercontent.com/u/76371?v=3","gravatar_id":"","url":"https://api.github.com/users/shellscape","html_url":"https://github.com/shellscape","followers_url":"https://api.github.com/users/shellscape/followers","following_url":"https://api.github.com/users/shellscape/following{/other_user}","gists_url":"https://api.github.com/users/shellscape/gists{/gist_id}","starred_url":"https://api.github.com/users/shellscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shellscape/subscriptions","organizations_url":"https://api.github.com/users/shellscape/orgs","repos_url":"https://api.github.com/users/shellscape/repos","events_url":"https://api.github.com/users/shellscape/events{/privacy}","received_events_url":"https://api.github.com/users/shellscape/received_events","type":"User","site_admin":false},"body":"pretty sure lines 97 and 98 should be enough for any dev to see it's a parse error","created_at":"2016-01-25T14:02:33Z","updated_at":"2016-01-25T14:02:33Z","html_url":"https://github.com/gilt/gilt-swig-assets/pull/10#discussion_r50696027","pull_request_url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/comments/50696027"},"html":{"href":"https://github.com/gilt/gilt-swig-assets/pull/10#discussion_r50696027"},"pull_request":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10","id":56981026,"html_url":"https://github.com/gilt/gilt-swig-assets/pull/10","diff_url":"https://github.com/gilt/gilt-swig-assets/pull/10.diff","patch_url":"https://github.com/gilt/gilt-swig-assets/pull/10.patch","issue_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/10","number":10,"state":"open","locked":false,"title":"swig-lint: fixing the handlebars error reporter","user":{"login":"shellscape","id":76371,"avatar_url":"https://avatars.githubusercontent.com/u/76371?v=3","gravatar_id":"","url":"https://api.github.com/users/shellscape","html_url":"https://github.com/shellscape","followers_url":"https://api.github.com/users/shellscape/followers","following_url":"https://api.github.com/users/shellscape/following{/other_user}","gists_url":"https://api.github.com/users/shellscape/gists{/gist_id}","starred_url":"https://api.github.com/users/shellscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shellscape/subscriptions","organizations_url":"https://api.github.com/users/shellscape/orgs","repos_url":"https://api.github.com/users/shellscape/repos","events_url":"https://api.github.com/users/shellscape/events{/privacy}","received_events_url":"https://api.github.com/users/shellscape/received_events","type":"User","site_admin":false},"body":"@RoryH  @njprrogers @jkenny ","created_at":"2016-01-23T17:20:18Z","updated_at":"2016-01-25T14:02:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f048ab38c4b0f479ca74d6e175f6149b981c2ba2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10/commits","review_comments_url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10/comments","review_comment_url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/10/comments","statuses_url":"https://api.github.com/repos/gilt/gilt-swig-assets/statuses/69fd3df13aa68bd756c2f6e2408fcba6a52a778b","head":{"label":"gilt:fix-handlebars-reporter","ref":"fix-handlebars-reporter","sha":"69fd3df13aa68bd756c2f6e2408fcba6a52a778b","user":{"login":"gilt","id":160415,"avatar_url":"https://avatars.githubusercontent.com/u/160415?v=3","gravatar_id":"","url":"https://api.github.com/users/gilt","html_url":"https://github.com/gilt","followers_url":"https://api.github.com/users/gilt/followers","following_url":"https://api.github.com/users/gilt/following{/other_user}","gists_url":"https://api.github.com/users/gilt/gists{/gist_id}","starred_url":"https://api.github.com/users/gilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilt/subscriptions","organizations_url":"https://api.github.com/users/gilt/orgs","repos_url":"https://api.github.com/users/gilt/repos","events_url":"https://api.github.com/users/gilt/events{/privacy}","received_events_url":"https://api.github.com/users/gilt/received_events","type":"Organization","site_admin":false},"repo":{"id":43087598,"name":"gilt-swig-assets","full_name":"gilt/gilt-swig-assets","owner":{"login":"gilt","id":160415,"avatar_url":"https://avatars.githubusercontent.com/u/160415?v=3","gravatar_id":"","url":"https://api.github.com/users/gilt","html_url":"https://github.com/gilt","followers_url":"https://api.github.com/users/gilt/followers","following_url":"https://api.github.com/users/gilt/following{/other_user}","gists_url":"https://api.github.com/users/gilt/gists{/gist_id}","starred_url":"https://api.github.com/users/gilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilt/subscriptions","organizations_url":"https://api.github.com/users/gilt/orgs","repos_url":"https://api.github.com/users/gilt/repos","events_url":"https://api.github.com/users/gilt/events{/privacy}","received_events_url":"https://api.github.com/users/gilt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gilt/gilt-swig-assets","description":"Swig tasks that are associated with Gilt's asset pipeline.","fork":false,"url":"https://api.github.com/repos/gilt/gilt-swig-assets","forks_url":"https://api.github.com/repos/gilt/gilt-swig-assets/forks","keys_url":"https://api.github.com/repos/gilt/gilt-swig-assets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gilt/gilt-swig-assets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gilt/gilt-swig-assets/teams","hooks_url":"https://api.github.com/repos/gilt/gilt-swig-assets/hooks","issue_events_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/events{/number}","events_url":"https://api.github.com/repos/gilt/gilt-swig-assets/events","assignees_url":"https://api.github.com/repos/gilt/gilt-swig-assets/assignees{/user}","branches_url":"https://api.github.com/repos/gilt/gilt-swig-assets/branches{/branch}","tags_url":"https://api.github.com/repos/gilt/gilt-swig-assets/tags","blobs_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/refs{/sha}","trees_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gilt/gilt-swig-assets/statuses/{sha}","languages_url":"https://api.github.com/repos/gilt/gilt-swig-assets/languages","stargazers_url":"https://api.github.com/repos/gilt/gilt-swig-assets/stargazers","contributors_url":"https://api.github.com/repos/gilt/gilt-swig-assets/contributors","subscribers_url":"https://api.github.com/repos/gilt/gilt-swig-assets/subscribers","subscription_url":"https://api.github.com/repos/gilt/gilt-swig-assets/subscription","commits_url":"https://api.github.com/repos/gilt/gilt-swig-assets/commits{/sha}","git_commits_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/commits{/sha}","comments_url":"https://api.github.com/repos/gilt/gilt-swig-assets/comments{/number}","issue_comment_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/comments{/number}","contents_url":"https://api.github.com/repos/gilt/gilt-swig-assets/contents/{+path}","compare_url":"https://api.github.com/repos/gilt/gilt-swig-assets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gilt/gilt-swig-assets/merges","archive_url":"https://api.github.com/repos/gilt/gilt-swig-assets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gilt/gilt-swig-assets/downloads","issues_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues{/number}","pulls_url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls{/number}","milestones_url":"https://api.github.com/repos/gilt/gilt-swig-assets/milestones{/number}","notifications_url":"https://api.github.com/repos/gilt/gilt-swig-assets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gilt/gilt-swig-assets/labels{/name}","releases_url":"https://api.github.com/repos/gilt/gilt-swig-assets/releases{/id}","deployments_url":"https://api.github.com/repos/gilt/gilt-swig-assets/deployments","created_at":"2015-09-24T19:14:28Z","updated_at":"2016-01-22T16:00:02Z","pushed_at":"2016-01-23T17:20:19Z","git_url":"git://github.com/gilt/gilt-swig-assets.git","ssh_url":"git@github.com:gilt/gilt-swig-assets.git","clone_url":"https://github.com/gilt/gilt-swig-assets.git","svn_url":"https://github.com/gilt/gilt-swig-assets","homepage":null,"size":115,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"gilt:master","ref":"master","sha":"a01fc1e85c10953af07a5f2c73e8935a370fd77a","user":{"login":"gilt","id":160415,"avatar_url":"https://avatars.githubusercontent.com/u/160415?v=3","gravatar_id":"","url":"https://api.github.com/users/gilt","html_url":"https://github.com/gilt","followers_url":"https://api.github.com/users/gilt/followers","following_url":"https://api.github.com/users/gilt/following{/other_user}","gists_url":"https://api.github.com/users/gilt/gists{/gist_id}","starred_url":"https://api.github.com/users/gilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilt/subscriptions","organizations_url":"https://api.github.com/users/gilt/orgs","repos_url":"https://api.github.com/users/gilt/repos","events_url":"https://api.github.com/users/gilt/events{/privacy}","received_events_url":"https://api.github.com/users/gilt/received_events","type":"Organization","site_admin":false},"repo":{"id":43087598,"name":"gilt-swig-assets","full_name":"gilt/gilt-swig-assets","owner":{"login":"gilt","id":160415,"avatar_url":"https://avatars.githubusercontent.com/u/160415?v=3","gravatar_id":"","url":"https://api.github.com/users/gilt","html_url":"https://github.com/gilt","followers_url":"https://api.github.com/users/gilt/followers","following_url":"https://api.github.com/users/gilt/following{/other_user}","gists_url":"https://api.github.com/users/gilt/gists{/gist_id}","starred_url":"https://api.github.com/users/gilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilt/subscriptions","organizations_url":"https://api.github.com/users/gilt/orgs","repos_url":"https://api.github.com/users/gilt/repos","events_url":"https://api.github.com/users/gilt/events{/privacy}","received_events_url":"https://api.github.com/users/gilt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gilt/gilt-swig-assets","description":"Swig tasks that are associated with Gilt's asset pipeline.","fork":false,"url":"https://api.github.com/repos/gilt/gilt-swig-assets","forks_url":"https://api.github.com/repos/gilt/gilt-swig-assets/forks","keys_url":"https://api.github.com/repos/gilt/gilt-swig-assets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gilt/gilt-swig-assets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gilt/gilt-swig-assets/teams","hooks_url":"https://api.github.com/repos/gilt/gilt-swig-assets/hooks","issue_events_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/events{/number}","events_url":"https://api.github.com/repos/gilt/gilt-swig-assets/events","assignees_url":"https://api.github.com/repos/gilt/gilt-swig-assets/assignees{/user}","branches_url":"https://api.github.com/repos/gilt/gilt-swig-assets/branches{/branch}","tags_url":"https://api.github.com/repos/gilt/gilt-swig-assets/tags","blobs_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/refs{/sha}","trees_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gilt/gilt-swig-assets/statuses/{sha}","languages_url":"https://api.github.com/repos/gilt/gilt-swig-assets/languages","stargazers_url":"https://api.github.com/repos/gilt/gilt-swig-assets/stargazers","contributors_url":"https://api.github.com/repos/gilt/gilt-swig-assets/contributors","subscribers_url":"https://api.github.com/repos/gilt/gilt-swig-assets/subscribers","subscription_url":"https://api.github.com/repos/gilt/gilt-swig-assets/subscription","commits_url":"https://api.github.com/repos/gilt/gilt-swig-assets/commits{/sha}","git_commits_url":"https://api.github.com/repos/gilt/gilt-swig-assets/git/commits{/sha}","comments_url":"https://api.github.com/repos/gilt/gilt-swig-assets/comments{/number}","issue_comment_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/comments{/number}","contents_url":"https://api.github.com/repos/gilt/gilt-swig-assets/contents/{+path}","compare_url":"https://api.github.com/repos/gilt/gilt-swig-assets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gilt/gilt-swig-assets/merges","archive_url":"https://api.github.com/repos/gilt/gilt-swig-assets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gilt/gilt-swig-assets/downloads","issues_url":"https://api.github.com/repos/gilt/gilt-swig-assets/issues{/number}","pulls_url":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls{/number}","milestones_url":"https://api.github.com/repos/gilt/gilt-swig-assets/milestones{/number}","notifications_url":"https://api.github.com/repos/gilt/gilt-swig-assets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gilt/gilt-swig-assets/labels{/name}","releases_url":"https://api.github.com/repos/gilt/gilt-swig-assets/releases{/id}","deployments_url":"https://api.github.com/repos/gilt/gilt-swig-assets/deployments","created_at":"2015-09-24T19:14:28Z","updated_at":"2016-01-22T16:00:02Z","pushed_at":"2016-01-23T17:20:19Z","git_url":"git://github.com/gilt/gilt-swig-assets.git","ssh_url":"git@github.com:gilt/gilt-swig-assets.git","clone_url":"https://github.com/gilt/gilt-swig-assets.git","svn_url":"https://github.com/gilt/gilt-swig-assets","homepage":null,"size":115,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10"},"html":{"href":"https://github.com/gilt/gilt-swig-assets/pull/10"},"issue":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/10"},"comments":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/gilt/gilt-swig-assets/statuses/69fd3df13aa68bd756c2f6e2408fcba6a52a778b"}}}}