{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/108142444","pull_request_review_id":29154587,"id":108142444,"diff_hunk":"@@ -1,7 +1,5 @@\n #!/bin/sh\n \n-PATH=\"$PATH:/usr/local/bin\"","path":"bin/pre-commit","position":3,"original_position":3,"commit_id":"e499569eb6bba99624086e483b37af769347d2eb","original_commit_id":"e499569eb6bba99624086e483b37af769347d2eb","user":{"login":"raoulwegat","id":2627210,"avatar_url":"https://avatars1.githubusercontent.com/u/2627210?v=3","gravatar_id":"","url":"https://api.github.com/users/raoulwegat","html_url":"https://github.com/raoulwegat","followers_url":"https://api.github.com/users/raoulwegat/followers","following_url":"https://api.github.com/users/raoulwegat/following{/other_user}","gists_url":"https://api.github.com/users/raoulwegat/gists{/gist_id}","starred_url":"https://api.github.com/users/raoulwegat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raoulwegat/subscriptions","organizations_url":"https://api.github.com/users/raoulwegat/orgs","repos_url":"https://api.github.com/users/raoulwegat/repos","events_url":"https://api.github.com/users/raoulwegat/events{/privacy}","received_events_url":"https://api.github.com/users/raoulwegat/received_events","type":"User","site_admin":false},"body":"@nosolosw For those of us using GUI git apps like Tower.app, removing PATH causes commit to stop working as the app no longer has PATH info to run the commands in `.git/hooks/pre-commit`. Can you revert this line?\r\n\r\nMore info: https://www.git-tower.com/help/mac/faq-and-tips/faq#faq-hook-scripts\r\n\r\n","created_at":"2017-03-27T11:03:39Z","updated_at":"2017-03-27T11:03:39Z","html_url":"https://github.com/Automattic/wp-calypso/pull/6945#discussion_r108142444","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/108142444"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/6945#discussion_r108142444"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945","id":78313819,"html_url":"https://github.com/Automattic/wp-calypso/pull/6945","diff_url":"https://github.com/Automattic/wp-calypso/pull/6945.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/6945.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6945","number":6945,"state":"closed","locked":false,"title":"Set ESLint rules as errors while preventing hooks/CI from failing","user":{"login":"nssw","id":19974613,"avatar_url":"https://avatars3.githubusercontent.com/u/19974613?v=3","gravatar_id":"","url":"https://api.github.com/users/nssw","html_url":"https://github.com/nssw","followers_url":"https://api.github.com/users/nssw/followers","following_url":"https://api.github.com/users/nssw/following{/other_user}","gists_url":"https://api.github.com/users/nssw/gists{/gist_id}","starred_url":"https://api.github.com/users/nssw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nssw/subscriptions","organizations_url":"https://api.github.com/users/nssw/orgs","repos_url":"https://api.github.com/users/nssw/repos","events_url":"https://api.github.com/users/nssw/events{/privacy}","received_events_url":"https://api.github.com/users/nssw/received_events","type":"User","site_admin":false},"body":"We are migrating old code to the new standards (see janitorial efforts at #8562). In the meantime, the new code is failing to adhere to our current code-style because there are rules set as warnings yet.\r\n\r\nUntil now, they could not be set to errors because doing so will break the git hooks and our CI tools. This PR aims to address that problem by only reporting errors in lines modified, instead of the whole code base. With this approach, we can enforce that **all new code is always written following the up-to-date conventions**, which will help the migration effort to be completed sooner.\r\n\r\nThe gist of this PR is just piping commands for several contexts:\r\n\r\n\teslint -f json | eslines\r\n\r\n### Caveats\r\n\r\nEditor integration has proven harder than expected, and, at this point, it's not a goal to aim for it. This means that in editors all rules will be reported as errors.\r\n\r\nFor editors that allow calling custom commands for linting, there may be a way out and a solution may be found. I'm happy to help with this. Yet, as it needs to be considered in a case-by-case basis and it is time-consuming I'd rather do it after this PR is merged/aborted.\r\n\r\n--- \r\n\r\n## How to test locally\r\n\r\n- `git clone git@github.com:Automattic/wp-calypso.git`\r\n-  `git checkout -b add/eslint-formatters-calypso-testcase origin/add/eslint-formatters-calypso-testcase`\r\n- `npm install`\r\n- `make githooks`\r\n\r\nTest that it works:\r\n\r\n- open `client/components/web-preview/index.jsx` and remove the spaces after and before the parens at line 167. Do not introduce any other change.\r\n- git add `client/components/web-preview/index.jsx`\r\n- git commit: expected result is that commit hook will report an error in the line modified and won't let you commit (notice that the same error in lines not modified is considered a `warning`)\r\n\r\nTest that it doesn't prevent you from commiting (if the errors are in lines not modified):\r\n\r\n- open `client/components/web-preview/index.jsx` and remove all debug statements and the debug importing. Do not introduce any other change.\r\n- git add `client/components/web-preview/index.jsx`\r\n- git commit: expected result is that commit hook will not report any error.\r\n\r\n\r\n","created_at":"2016-07-21T13:17:00Z","updated_at":"2017-03-27T11:03:39Z","closed_at":"2017-03-22T12:52:27Z","merged_at":"2017-03-22T12:52:27Z","merge_commit_sha":"a5889f96c3695549dabac91b3e1578ffc7d67ef1","assignee":{"login":"nosolosw","id":583546,"avatar_url":"https://avatars2.githubusercontent.com/u/583546?v=3","gravatar_id":"","url":"https://api.github.com/users/nosolosw","html_url":"https://github.com/nosolosw","followers_url":"https://api.github.com/users/nosolosw/followers","following_url":"https://api.github.com/users/nosolosw/following{/other_user}","gists_url":"https://api.github.com/users/nosolosw/gists{/gist_id}","starred_url":"https://api.github.com/users/nosolosw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nosolosw/subscriptions","organizations_url":"https://api.github.com/users/nosolosw/orgs","repos_url":"https://api.github.com/users/nosolosw/repos","events_url":"https://api.github.com/users/nosolosw/events{/privacy}","received_events_url":"https://api.github.com/users/nosolosw/received_events","type":"User","site_admin":false},"assignees":[{"login":"nosolosw","id":583546,"avatar_url":"https://avatars2.githubusercontent.com/u/583546?v=3","gravatar_id":"","url":"https://api.github.com/users/nosolosw","html_url":"https://github.com/nosolosw","followers_url":"https://api.github.com/users/nosolosw/followers","following_url":"https://api.github.com/users/nosolosw/following{/other_user}","gists_url":"https://api.github.com/users/nosolosw/gists{/gist_id}","starred_url":"https://api.github.com/users/nosolosw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nosolosw/subscriptions","organizations_url":"https://api.github.com/users/nosolosw/orgs","repos_url":"https://api.github.com/users/nosolosw/repos","events_url":"https://api.github.com/users/nosolosw/events{/privacy}","received_events_url":"https://api.github.com/users/nosolosw/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/6945/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e499569eb6bba99624086e483b37af769347d2eb","head":{"label":"Automattic:add/eslint-formatters-calypso-testcase","ref":"add/eslint-formatters-calypso-testcase","sha":"e499569eb6bba99624086e483b37af769347d2eb","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-03-27T10:27:46Z","pushed_at":"2017-03-27T11:00:07Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":52294,"stargazers_count":8593,"watchers_count":8593,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1097,"mirror_url":null,"open_issues_count":1764,"forks":1097,"open_issues":1764,"watchers":8593,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"109b74ec94fc7de2b575e0da7cf6a8ae9fa96961","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-03-27T10:27:46Z","pushed_at":"2017-03-27T11:00:07Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":52294,"stargazers_count":8593,"watchers_count":8593,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1097,"mirror_url":null,"open_issues_count":1764,"forks":1097,"open_issues":1764,"watchers":8593,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/6945"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/6945"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/6945/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/6945/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/e499569eb6bba99624086e483b37af769347d2eb"}}}}
{"actor":{"display_login":"raoulwegat"}}