{"action":"opened","number":223,"pull_request":{"url":"https://api.github.com/repos/pre-commit/pre-commit/pulls/223","id":34772656,"html_url":"https://github.com/pre-commit/pre-commit/pull/223","diff_url":"https://github.com/pre-commit/pre-commit/pull/223.diff","patch_url":"https://github.com/pre-commit/pre-commit/pull/223.patch","issue_url":"https://api.github.com/repos/pre-commit/pre-commit/issues/223","number":223,"state":"open","locked":false,"title":"Adding \"local-hooks\" entry to .pre-commit-config.yaml","user":{"login":"Lucas-C","id":925560,"avatar_url":"https://avatars.githubusercontent.com/u/925560?v=3","gravatar_id":"","url":"https://api.github.com/users/Lucas-C","html_url":"https://github.com/Lucas-C","followers_url":"https://api.github.com/users/Lucas-C/followers","following_url":"https://api.github.com/users/Lucas-C/following{/other_user}","gists_url":"https://api.github.com/users/Lucas-C/gists{/gist_id}","starred_url":"https://api.github.com/users/Lucas-C/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lucas-C/subscriptions","organizations_url":"https://api.github.com/users/Lucas-C/orgs","repos_url":"https://api.github.com/users/Lucas-C/repos","events_url":"https://api.github.com/users/Lucas-C/events{/privacy}","received_events_url":"https://api.github.com/users/Lucas-C/received_events","type":"User","site_admin":false},"body":"This is an attempt to address #219.\r\nAs it is a first draft, it misses some tests and a bit of code cleaning, but I'd like an initial design review before fixing the final glitches.\r\n\r\n**Example of valid _ .pre-commit-config.yaml_ using this feature :**\r\n```\r\n- local-hooks:\r\n  - id: no-todo\r\n    name: No TODO allowed in commited files\r\n    entry: grep -iI todo\r\n    expected_return_value: 1\r\n    language: system\r\n    files: ''\r\n```\r\n\r\n**Pros / Cons of the solution choosed:**\r\n+ + end-user-friendly: the new \"local-hooks\" field schema is the same as _hooks.yaml_ schema\r\n+ + nice reuse of MANIFEST_JSON_SCHEMA\r\n+ + no more `_run_hook` / `_run_hooks` code duplication\r\n+ + all the regressions tests pass\r\n- - \"local-hooks\" and classical repo/sha/hooks objects are mixed together in _.pre-commit-config.yaml_\r\n- - the `hooks_and_invokers` list of tuples is not entirely satisfying. Maybe it'd be worth having a proper `Hook` class ?\r\n","created_at":"2015-05-05T22:12:00Z","updated_at":"2015-05-05T22:12:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pre-commit/pre-commit/pulls/223/commits","review_comments_url":"https://api.github.com/repos/pre-commit/pre-commit/pulls/223/comments","review_comment_url":"https://api.github.com/repos/pre-commit/pre-commit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pre-commit/pre-commit/issues/223/comments","statuses_url":"https://api.github.com/repos/pre-commit/pre-commit/statuses/1bdc1336f29f1cc5e71e16d7c3b058682f1eee37","head":{"label":"Lucas-C:master","ref":"master","sha":"1bdc1336f29f1cc5e71e16d7c3b058682f1eee37","user":{"login":"Lucas-C","id":925560,"avatar_url":"https://avatars.githubusercontent.com/u/925560?v=3","gravatar_id":"","url":"https://api.github.com/users/Lucas-C","html_url":"https://github.com/Lucas-C","followers_url":"https://api.github.com/users/Lucas-C/followers","following_url":"https://api.github.com/users/Lucas-C/following{/other_user}","gists_url":"https://api.github.com/users/Lucas-C/gists{/gist_id}","starred_url":"https://api.github.com/users/Lucas-C/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lucas-C/subscriptions","organizations_url":"https://api.github.com/users/Lucas-C/orgs","repos_url":"https://api.github.com/users/Lucas-C/repos","events_url":"https://api.github.com/users/Lucas-C/events{/privacy}","received_events_url":"https://api.github.com/users/Lucas-C/received_events","type":"User","site_admin":false},"repo":{"id":34939200,"name":"pre-commit","full_name":"Lucas-C/pre-commit","owner":{"login":"Lucas-C","id":925560,"avatar_url":"https://avatars.githubusercontent.com/u/925560?v=3","gravatar_id":"","url":"https://api.github.com/users/Lucas-C","html_url":"https://github.com/Lucas-C","followers_url":"https://api.github.com/users/Lucas-C/followers","following_url":"https://api.github.com/users/Lucas-C/following{/other_user}","gists_url":"https://api.github.com/users/Lucas-C/gists{/gist_id}","starred_url":"https://api.github.com/users/Lucas-C/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lucas-C/subscriptions","organizations_url":"https://api.github.com/users/Lucas-C/orgs","repos_url":"https://api.github.com/users/Lucas-C/repos","events_url":"https://api.github.com/users/Lucas-C/events{/privacy}","received_events_url":"https://api.github.com/users/Lucas-C/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Lucas-C/pre-commit","description":"A framework for managing and maintaining multi-language pre-commit hooks.","fork":true,"url":"https://api.github.com/repos/Lucas-C/pre-commit","forks_url":"https://api.github.com/repos/Lucas-C/pre-commit/forks","keys_url":"https://api.github.com/repos/Lucas-C/pre-commit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lucas-C/pre-commit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lucas-C/pre-commit/teams","hooks_url":"https://api.github.com/repos/Lucas-C/pre-commit/hooks","issue_events_url":"https://api.github.com/repos/Lucas-C/pre-commit/issues/events{/number}","events_url":"https://api.github.com/repos/Lucas-C/pre-commit/events","assignees_url":"https://api.github.com/repos/Lucas-C/pre-commit/assignees{/user}","branches_url":"https://api.github.com/repos/Lucas-C/pre-commit/branches{/branch}","tags_url":"https://api.github.com/repos/Lucas-C/pre-commit/tags","blobs_url":"https://api.github.com/repos/Lucas-C/pre-commit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lucas-C/pre-commit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lucas-C/pre-commit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lucas-C/pre-commit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lucas-C/pre-commit/statuses/{sha}","languages_url":"https://api.github.com/repos/Lucas-C/pre-commit/languages","stargazers_url":"https://api.github.com/repos/Lucas-C/pre-commit/stargazers","contributors_url":"https://api.github.com/repos/Lucas-C/pre-commit/contributors","subscribers_url":"https://api.github.com/repos/Lucas-C/pre-commit/subscribers","subscription_url":"https://api.github.com/repos/Lucas-C/pre-commit/subscription","commits_url":"https://api.github.com/repos/Lucas-C/pre-commit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lucas-C/pre-commit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lucas-C/pre-commit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lucas-C/pre-commit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lucas-C/pre-commit/contents/{+path}","compare_url":"https://api.github.com/repos/Lucas-C/pre-commit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lucas-C/pre-commit/merges","archive_url":"https://api.github.com/repos/Lucas-C/pre-commit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lucas-C/pre-commit/downloads","issues_url":"https://api.github.com/repos/Lucas-C/pre-commit/issues{/number}","pulls_url":"https://api.github.com/repos/Lucas-C/pre-commit/pulls{/number}","milestones_url":"https://api.github.com/repos/Lucas-C/pre-commit/milestones{/number}","notifications_url":"https://api.github.com/repos/Lucas-C/pre-commit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lucas-C/pre-commit/labels{/name}","releases_url":"https://api.github.com/repos/Lucas-C/pre-commit/releases{/id}","created_at":"2015-05-02T07:23:32Z","updated_at":"2015-05-05T22:11:32Z","pushed_at":"2015-05-05T22:11:32Z","git_url":"git://github.com/Lucas-C/pre-commit.git","ssh_url":"git@github.com:Lucas-C/pre-commit.git","clone_url":"https://github.com/Lucas-C/pre-commit.git","svn_url":"https://github.com/Lucas-C/pre-commit","homepage":null,"size":1999,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"pre-commit:master","ref":"master","sha":"cdf726bbedb15f33ca60fdc397fec379946755fc","user":{"login":"pre-commit","id":6943086,"avatar_url":"https://avatars.githubusercontent.com/u/6943086?v=3","gravatar_id":"","url":"https://api.github.com/users/pre-commit","html_url":"https://github.com/pre-commit","followers_url":"https://api.github.com/users/pre-commit/followers","following_url":"https://api.github.com/users/pre-commit/following{/other_user}","gists_url":"https://api.github.com/users/pre-commit/gists{/gist_id}","starred_url":"https://api.github.com/users/pre-commit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pre-commit/subscriptions","organizations_url":"https://api.github.com/users/pre-commit/orgs","repos_url":"https://api.github.com/users/pre-commit/repos","events_url":"https://api.github.com/users/pre-commit/events{/privacy}","received_events_url":"https://api.github.com/users/pre-commit/received_events","type":"Organization","site_admin":false},"repo":{"id":17689377,"name":"pre-commit","full_name":"pre-commit/pre-commit","owner":{"login":"pre-commit","id":6943086,"avatar_url":"https://avatars.githubusercontent.com/u/6943086?v=3","gravatar_id":"","url":"https://api.github.com/users/pre-commit","html_url":"https://github.com/pre-commit","followers_url":"https://api.github.com/users/pre-commit/followers","following_url":"https://api.github.com/users/pre-commit/following{/other_user}","gists_url":"https://api.github.com/users/pre-commit/gists{/gist_id}","starred_url":"https://api.github.com/users/pre-commit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pre-commit/subscriptions","organizations_url":"https://api.github.com/users/pre-commit/orgs","repos_url":"https://api.github.com/users/pre-commit/repos","events_url":"https://api.github.com/users/pre-commit/events{/privacy}","received_events_url":"https://api.github.com/users/pre-commit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pre-commit/pre-commit","description":"A framework for managing and maintaining multi-language pre-commit hooks.","fork":false,"url":"https://api.github.com/repos/pre-commit/pre-commit","forks_url":"https://api.github.com/repos/pre-commit/pre-commit/forks","keys_url":"https://api.github.com/repos/pre-commit/pre-commit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pre-commit/pre-commit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pre-commit/pre-commit/teams","hooks_url":"https://api.github.com/repos/pre-commit/pre-commit/hooks","issue_events_url":"https://api.github.com/repos/pre-commit/pre-commit/issues/events{/number}","events_url":"https://api.github.com/repos/pre-commit/pre-commit/events","assignees_url":"https://api.github.com/repos/pre-commit/pre-commit/assignees{/user}","branches_url":"https://api.github.com/repos/pre-commit/pre-commit/branches{/branch}","tags_url":"https://api.github.com/repos/pre-commit/pre-commit/tags","blobs_url":"https://api.github.com/repos/pre-commit/pre-commit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pre-commit/pre-commit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pre-commit/pre-commit/git/refs{/sha}","trees_url":"https://api.github.com/repos/pre-commit/pre-commit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pre-commit/pre-commit/statuses/{sha}","languages_url":"https://api.github.com/repos/pre-commit/pre-commit/languages","stargazers_url":"https://api.github.com/repos/pre-commit/pre-commit/stargazers","contributors_url":"https://api.github.com/repos/pre-commit/pre-commit/contributors","subscribers_url":"https://api.github.com/repos/pre-commit/pre-commit/subscribers","subscription_url":"https://api.github.com/repos/pre-commit/pre-commit/subscription","commits_url":"https://api.github.com/repos/pre-commit/pre-commit/commits{/sha}","git_commits_url":"https://api.github.com/repos/pre-commit/pre-commit/git/commits{/sha}","comments_url":"https://api.github.com/repos/pre-commit/pre-commit/comments{/number}","issue_comment_url":"https://api.github.com/repos/pre-commit/pre-commit/issues/comments{/number}","contents_url":"https://api.github.com/repos/pre-commit/pre-commit/contents/{+path}","compare_url":"https://api.github.com/repos/pre-commit/pre-commit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pre-commit/pre-commit/merges","archive_url":"https://api.github.com/repos/pre-commit/pre-commit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pre-commit/pre-commit/downloads","issues_url":"https://api.github.com/repos/pre-commit/pre-commit/issues{/number}","pulls_url":"https://api.github.com/repos/pre-commit/pre-commit/pulls{/number}","milestones_url":"https://api.github.com/repos/pre-commit/pre-commit/milestones{/number}","notifications_url":"https://api.github.com/repos/pre-commit/pre-commit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pre-commit/pre-commit/labels{/name}","releases_url":"https://api.github.com/repos/pre-commit/pre-commit/releases{/id}","created_at":"2014-03-13T00:39:38Z","updated_at":"2015-05-04T15:00:10Z","pushed_at":"2015-05-05T20:20:33Z","git_url":"git://github.com/pre-commit/pre-commit.git","ssh_url":"git@github.com:pre-commit/pre-commit.git","clone_url":"https://github.com/pre-commit/pre-commit.git","svn_url":"https://github.com/pre-commit/pre-commit","homepage":null,"size":2078,"stargazers_count":494,"watchers_count":494,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":30,"forks":32,"open_issues":30,"watchers":494,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pre-commit/pre-commit/pulls/223"},"html":{"href":"https://github.com/pre-commit/pre-commit/pull/223"},"issue":{"href":"https://api.github.com/repos/pre-commit/pre-commit/issues/223"},"comments":{"href":"https://api.github.com/repos/pre-commit/pre-commit/issues/223/comments"},"review_comments":{"href":"https://api.github.com/repos/pre-commit/pre-commit/pulls/223/comments"},"review_comment":{"href":"https://api.github.com/repos/pre-commit/pre-commit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pre-commit/pre-commit/pulls/223/commits"},"statuses":{"href":"https://api.github.com/repos/pre-commit/pre-commit/statuses/1bdc1336f29f1cc5e71e16d7c3b058682f1eee37"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":132,"deletions":42,"changed_files":4}}