{"action":"created","issue":{"url":"https://api.github.com/repos/stevegrunwell/wp-enforcer/issues/22","labels_url":"https://api.github.com/repos/stevegrunwell/wp-enforcer/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/stevegrunwell/wp-enforcer/issues/22/comments","events_url":"https://api.github.com/repos/stevegrunwell/wp-enforcer/issues/22/events","html_url":"https://github.com/stevegrunwell/wp-enforcer/issues/22","id":120980896,"number":22,"title":"Restrict hook to the changed code","user":{"login":"rodrigoprimo","id":77215,"avatar_url":"https://avatars.githubusercontent.com/u/77215?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigoprimo","html_url":"https://github.com/rodrigoprimo","followers_url":"https://api.github.com/users/rodrigoprimo/followers","following_url":"https://api.github.com/users/rodrigoprimo/following{/other_user}","gists_url":"https://api.github.com/users/rodrigoprimo/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigoprimo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigoprimo/subscriptions","organizations_url":"https://api.github.com/users/rodrigoprimo/orgs","repos_url":"https://api.github.com/users/rodrigoprimo/repos","events_url":"https://api.github.com/users/rodrigoprimo/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigoprimo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/stevegrunwell/wp-enforcer/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-08T10:41:32Z","updated_at":"2015-12-29T23:00:23Z","closed_at":null,"body":"Would it be possible to modify the hook to check only the code that was added in a given commit (instead of checking changed files as in #1)? I think this would reduce friction even more when using wp-enforcer into an existing codebase."},"comment":{"url":"https://api.github.com/repos/stevegrunwell/wp-enforcer/issues/comments/167896613","html_url":"https://github.com/stevegrunwell/wp-enforcer/issues/22#issuecomment-167896613","issue_url":"https://api.github.com/repos/stevegrunwell/wp-enforcer/issues/22","id":167896613,"user":{"login":"westonruter","id":134745,"avatar_url":"https://avatars.githubusercontent.com/u/134745?v=3","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T23:00:23Z","updated_at":"2015-12-29T23:00:23Z","body":"Hey guys. What is described here is exactly what I implemented in wp-dev-lib for Travis CI checks, to restrict error reporting for PHPCS, JSHint, and JSCS for only the lines that are changed in a given pull request.\r\n\r\nFor more info, see https://github.com/xwp/wp-dev-lib/#limiting-scope-of-travis-ci-checks\r\n\r\nI've also implemented the same for the WordPress Core project in a patch: https://core.trac.wordpress.org/ticket/34694#comment:6\r\n\r\nI have an outstanding todo item to implement the patch-checking functionality in `pre-commit` hook (in addition to the Travis CI context): https://github.com/xwp/wp-dev-lib/issues/100"}}