{"action":"created","comment":{"url":"https://api.github.com/repos/bobgilmore/githooks/pulls/comments/39350501","id":39350501,"diff_hunk":"@@ -20,21 +20,27 @@ def errors?\n   end\n \n   def examine_code\n-    return [] unless use_for_project?\n+    return [] if directory_excluded_from_all_checks?\n+    return [] if disabled_via_preference?\n     return [] unless check_file_based_on_extension?\n-    mess = []\n-    mess << @warning_message if !PreCommitHelper.directory_excluded_from_all_checks?(@dir) && @changed_code.match(@regexp)\n-    mess\n+    message = []\n+    message << @warning_message if @changed_code.match(@regexp)\n+    message\n   end\n \n   private\n \n-  def use_for_project?\n-    val = PreCommitHelper.git_config_val_for_hook(@hook_key)\n-    val.empty? || (val == 'true') || @pref_on\n+  def directory_excluded_from_all_checks?\n+    PreCommitHelper.directory_excluded_from_all_checks?(@dir)\n+  end\n+\n+  def disabled_via_preference?\n+    PreCommitHelper.disabled_via_preference?(@hook_key, @force_pref_on)\n   end\n \n   def check_file_based_on_extension?\n-    PreCommitHelper.check_file?(file: @file, extensions_to_include: @extensions_to_include, extensions_to_exclude: @extensions_to_exclude)\n+    PreCommitHelper.check_file_based_on_extension?(file: @file,\n+      extensions_to_include: @extensions_to_include,\n+      extensions_to_exclude: @extensions_to_exclude)","path":"pre_commit/simple_deactivatable_regexp_checker.rb","position":42,"original_position":42,"commit_id":"a6a34fd702c1aeb1d2017e23119233de625c0df7","original_commit_id":"a6a34fd702c1aeb1d2017e23119233de625c0df7","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Align the elements of a hash literal if they span more than one line.","created_at":"2015-09-13T18:40:21Z","updated_at":"2015-09-13T18:40:21Z","html_url":"https://github.com/bobgilmore/githooks/pull/53#discussion_r39350501","pull_request_url":"https://api.github.com/repos/bobgilmore/githooks/pulls/53","_links":{"self":{"href":"https://api.github.com/repos/bobgilmore/githooks/pulls/comments/39350501"},"html":{"href":"https://github.com/bobgilmore/githooks/pull/53#discussion_r39350501"},"pull_request":{"href":"https://api.github.com/repos/bobgilmore/githooks/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/bobgilmore/githooks/pulls/53","id":44878024,"html_url":"https://github.com/bobgilmore/githooks/pull/53","diff_url":"https://github.com/bobgilmore/githooks/pull/53.diff","patch_url":"https://github.com/bobgilmore/githooks/pull/53.patch","issue_url":"https://api.github.com/repos/bobgilmore/githooks/issues/53","number":53,"state":"open","locked":false,"title":"Load checkers dynamically","user":{"login":"bobgilmore","id":677714,"avatar_url":"https://avatars.githubusercontent.com/u/677714?v=3","gravatar_id":"","url":"https://api.github.com/users/bobgilmore","html_url":"https://github.com/bobgilmore","followers_url":"https://api.github.com/users/bobgilmore/followers","following_url":"https://api.github.com/users/bobgilmore/following{/other_user}","gists_url":"https://api.github.com/users/bobgilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/bobgilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobgilmore/subscriptions","organizations_url":"https://api.github.com/users/bobgilmore/orgs","repos_url":"https://api.github.com/users/bobgilmore/repos","events_url":"https://api.github.com/users/bobgilmore/events{/privacy}","received_events_url":"https://api.github.com/users/bobgilmore/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-13T18:40:14Z","updated_at":"2015-09-13T18:40:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"366e31494815ef858516ab5385d13ca971ab7ed2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bobgilmore/githooks/pulls/53/commits","review_comments_url":"https://api.github.com/repos/bobgilmore/githooks/pulls/53/comments","review_comment_url":"https://api.github.com/repos/bobgilmore/githooks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bobgilmore/githooks/issues/53/comments","statuses_url":"https://api.github.com/repos/bobgilmore/githooks/statuses/a6a34fd702c1aeb1d2017e23119233de625c0df7","head":{"label":"bobgilmore:load-checkers-dynamically","ref":"load-checkers-dynamically","sha":"a6a34fd702c1aeb1d2017e23119233de625c0df7","user":{"login":"bobgilmore","id":677714,"avatar_url":"https://avatars.githubusercontent.com/u/677714?v=3","gravatar_id":"","url":"https://api.github.com/users/bobgilmore","html_url":"https://github.com/bobgilmore","followers_url":"https://api.github.com/users/bobgilmore/followers","following_url":"https://api.github.com/users/bobgilmore/following{/other_user}","gists_url":"https://api.github.com/users/bobgilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/bobgilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobgilmore/subscriptions","organizations_url":"https://api.github.com/users/bobgilmore/orgs","repos_url":"https://api.github.com/users/bobgilmore/repos","events_url":"https://api.github.com/users/bobgilmore/events{/privacy}","received_events_url":"https://api.github.com/users/bobgilmore/received_events","type":"User","site_admin":false},"repo":{"id":7862780,"name":"githooks","full_name":"bobgilmore/githooks","owner":{"login":"bobgilmore","id":677714,"avatar_url":"https://avatars.githubusercontent.com/u/677714?v=3","gravatar_id":"","url":"https://api.github.com/users/bobgilmore","html_url":"https://github.com/bobgilmore","followers_url":"https://api.github.com/users/bobgilmore/followers","following_url":"https://api.github.com/users/bobgilmore/following{/other_user}","gists_url":"https://api.github.com/users/bobgilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/bobgilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobgilmore/subscriptions","organizations_url":"https://api.github.com/users/bobgilmore/orgs","repos_url":"https://api.github.com/users/bobgilmore/repos","events_url":"https://api.github.com/users/bobgilmore/events{/privacy}","received_events_url":"https://api.github.com/users/bobgilmore/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bobgilmore/githooks","description":"My personal githooks, which help me avoid silly or obvious mistakes.","fork":false,"url":"https://api.github.com/repos/bobgilmore/githooks","forks_url":"https://api.github.com/repos/bobgilmore/githooks/forks","keys_url":"https://api.github.com/repos/bobgilmore/githooks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bobgilmore/githooks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bobgilmore/githooks/teams","hooks_url":"https://api.github.com/repos/bobgilmore/githooks/hooks","issue_events_url":"https://api.github.com/repos/bobgilmore/githooks/issues/events{/number}","events_url":"https://api.github.com/repos/bobgilmore/githooks/events","assignees_url":"https://api.github.com/repos/bobgilmore/githooks/assignees{/user}","branches_url":"https://api.github.com/repos/bobgilmore/githooks/branches{/branch}","tags_url":"https://api.github.com/repos/bobgilmore/githooks/tags","blobs_url":"https://api.github.com/repos/bobgilmore/githooks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bobgilmore/githooks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bobgilmore/githooks/git/refs{/sha}","trees_url":"https://api.github.com/repos/bobgilmore/githooks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bobgilmore/githooks/statuses/{sha}","languages_url":"https://api.github.com/repos/bobgilmore/githooks/languages","stargazers_url":"https://api.github.com/repos/bobgilmore/githooks/stargazers","contributors_url":"https://api.github.com/repos/bobgilmore/githooks/contributors","subscribers_url":"https://api.github.com/repos/bobgilmore/githooks/subscribers","subscription_url":"https://api.github.com/repos/bobgilmore/githooks/subscription","commits_url":"https://api.github.com/repos/bobgilmore/githooks/commits{/sha}","git_commits_url":"https://api.github.com/repos/bobgilmore/githooks/git/commits{/sha}","comments_url":"https://api.github.com/repos/bobgilmore/githooks/comments{/number}","issue_comment_url":"https://api.github.com/repos/bobgilmore/githooks/issues/comments{/number}","contents_url":"https://api.github.com/repos/bobgilmore/githooks/contents/{+path}","compare_url":"https://api.github.com/repos/bobgilmore/githooks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bobgilmore/githooks/merges","archive_url":"https://api.github.com/repos/bobgilmore/githooks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bobgilmore/githooks/downloads","issues_url":"https://api.github.com/repos/bobgilmore/githooks/issues{/number}","pulls_url":"https://api.github.com/repos/bobgilmore/githooks/pulls{/number}","milestones_url":"https://api.github.com/repos/bobgilmore/githooks/milestones{/number}","notifications_url":"https://api.github.com/repos/bobgilmore/githooks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bobgilmore/githooks/labels{/name}","releases_url":"https://api.github.com/repos/bobgilmore/githooks/releases{/id}","created_at":"2013-01-28T03:54:00Z","updated_at":"2015-08-21T05:01:20Z","pushed_at":"2015-09-13T18:40:15Z","git_url":"git://github.com/bobgilmore/githooks.git","ssh_url":"git@github.com:bobgilmore/githooks.git","clone_url":"https://github.com/bobgilmore/githooks.git","svn_url":"https://github.com/bobgilmore/githooks","homepage":"","size":834,"stargazers_count":27,"watchers_count":27,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":9,"forks":21,"open_issues":9,"watchers":27,"default_branch":"master"}},"base":{"label":"bobgilmore:master","ref":"master","sha":"62e7983e9ca6a6737e6aac119e808a036e4361f9","user":{"login":"bobgilmore","id":677714,"avatar_url":"https://avatars.githubusercontent.com/u/677714?v=3","gravatar_id":"","url":"https://api.github.com/users/bobgilmore","html_url":"https://github.com/bobgilmore","followers_url":"https://api.github.com/users/bobgilmore/followers","following_url":"https://api.github.com/users/bobgilmore/following{/other_user}","gists_url":"https://api.github.com/users/bobgilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/bobgilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobgilmore/subscriptions","organizations_url":"https://api.github.com/users/bobgilmore/orgs","repos_url":"https://api.github.com/users/bobgilmore/repos","events_url":"https://api.github.com/users/bobgilmore/events{/privacy}","received_events_url":"https://api.github.com/users/bobgilmore/received_events","type":"User","site_admin":false},"repo":{"id":7862780,"name":"githooks","full_name":"bobgilmore/githooks","owner":{"login":"bobgilmore","id":677714,"avatar_url":"https://avatars.githubusercontent.com/u/677714?v=3","gravatar_id":"","url":"https://api.github.com/users/bobgilmore","html_url":"https://github.com/bobgilmore","followers_url":"https://api.github.com/users/bobgilmore/followers","following_url":"https://api.github.com/users/bobgilmore/following{/other_user}","gists_url":"https://api.github.com/users/bobgilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/bobgilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobgilmore/subscriptions","organizations_url":"https://api.github.com/users/bobgilmore/orgs","repos_url":"https://api.github.com/users/bobgilmore/repos","events_url":"https://api.github.com/users/bobgilmore/events{/privacy}","received_events_url":"https://api.github.com/users/bobgilmore/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bobgilmore/githooks","description":"My personal githooks, which help me avoid silly or obvious mistakes.","fork":false,"url":"https://api.github.com/repos/bobgilmore/githooks","forks_url":"https://api.github.com/repos/bobgilmore/githooks/forks","keys_url":"https://api.github.com/repos/bobgilmore/githooks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bobgilmore/githooks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bobgilmore/githooks/teams","hooks_url":"https://api.github.com/repos/bobgilmore/githooks/hooks","issue_events_url":"https://api.github.com/repos/bobgilmore/githooks/issues/events{/number}","events_url":"https://api.github.com/repos/bobgilmore/githooks/events","assignees_url":"https://api.github.com/repos/bobgilmore/githooks/assignees{/user}","branches_url":"https://api.github.com/repos/bobgilmore/githooks/branches{/branch}","tags_url":"https://api.github.com/repos/bobgilmore/githooks/tags","blobs_url":"https://api.github.com/repos/bobgilmore/githooks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bobgilmore/githooks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bobgilmore/githooks/git/refs{/sha}","trees_url":"https://api.github.com/repos/bobgilmore/githooks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bobgilmore/githooks/statuses/{sha}","languages_url":"https://api.github.com/repos/bobgilmore/githooks/languages","stargazers_url":"https://api.github.com/repos/bobgilmore/githooks/stargazers","contributors_url":"https://api.github.com/repos/bobgilmore/githooks/contributors","subscribers_url":"https://api.github.com/repos/bobgilmore/githooks/subscribers","subscription_url":"https://api.github.com/repos/bobgilmore/githooks/subscription","commits_url":"https://api.github.com/repos/bobgilmore/githooks/commits{/sha}","git_commits_url":"https://api.github.com/repos/bobgilmore/githooks/git/commits{/sha}","comments_url":"https://api.github.com/repos/bobgilmore/githooks/comments{/number}","issue_comment_url":"https://api.github.com/repos/bobgilmore/githooks/issues/comments{/number}","contents_url":"https://api.github.com/repos/bobgilmore/githooks/contents/{+path}","compare_url":"https://api.github.com/repos/bobgilmore/githooks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bobgilmore/githooks/merges","archive_url":"https://api.github.com/repos/bobgilmore/githooks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bobgilmore/githooks/downloads","issues_url":"https://api.github.com/repos/bobgilmore/githooks/issues{/number}","pulls_url":"https://api.github.com/repos/bobgilmore/githooks/pulls{/number}","milestones_url":"https://api.github.com/repos/bobgilmore/githooks/milestones{/number}","notifications_url":"https://api.github.com/repos/bobgilmore/githooks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bobgilmore/githooks/labels{/name}","releases_url":"https://api.github.com/repos/bobgilmore/githooks/releases{/id}","created_at":"2013-01-28T03:54:00Z","updated_at":"2015-08-21T05:01:20Z","pushed_at":"2015-09-13T18:40:15Z","git_url":"git://github.com/bobgilmore/githooks.git","ssh_url":"git@github.com:bobgilmore/githooks.git","clone_url":"https://github.com/bobgilmore/githooks.git","svn_url":"https://github.com/bobgilmore/githooks","homepage":"","size":834,"stargazers_count":27,"watchers_count":27,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":9,"forks":21,"open_issues":9,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bobgilmore/githooks/pulls/53"},"html":{"href":"https://github.com/bobgilmore/githooks/pull/53"},"issue":{"href":"https://api.github.com/repos/bobgilmore/githooks/issues/53"},"comments":{"href":"https://api.github.com/repos/bobgilmore/githooks/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/bobgilmore/githooks/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/bobgilmore/githooks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bobgilmore/githooks/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/bobgilmore/githooks/statuses/a6a34fd702c1aeb1d2017e23119233de625c0df7"}}}}