{"action":"created","comment":{"url":"https://api.github.com/repos/realm/SwiftLint/pulls/comments/49545765","id":49545765,"diff_hunk":"@@ -36,12 +37,10 @@ public struct ConditionalBindingCascadeRule: Rule {\n     )\n \n     public func validateFile(file: File) -> [StyleViolation] {\n-        let conditionalBindingKeywords = [\"if\", \"guard\"]\n-        let pattern =  \"^(\" +\n-                        conditionalBindingKeywords.joinWithSeparator(\"|\") +\n-                        \")(\\\\s*?)let((.|\\\\s)*?),(\\\\s*?)let((.|\\\\s)*?)\\\\{\"\n-        return file.matchPattern(pattern,\n-            excludingSyntaxKinds: SyntaxKind.commentAndStringKinds()).map {\n+        return file.matchPattern(\"^(if|guard)(.*?)let(.*?),(.*?)let(.*?)\\\\{\",\n+            excludingSyntaxKinds: SyntaxKind.commentAndStringKinds()).filter {\n+                !(file.contents as NSString).substringWithRange($0).containsString(\"where\")","path":"Source/SwiftLintFramework/Rules/ConditionalBindingCascadeRule.swift","position":22,"original_position":22,"commit_id":"e13907ead30ec5750f174fc6a8e7de3e3b74aa4a","original_commit_id":"e13907ead30ec5750f174fc6a8e7de3e3b74aa4a","user":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"body":"I'm sure this could lead to some missed violations, but I'm not too concerned with that right now.","created_at":"2016-01-13T02:39:57Z","updated_at":"2016-01-13T02:39:57Z","html_url":"https://github.com/realm/SwiftLint/pull/348#discussion_r49545765","pull_request_url":"https://api.github.com/repos/realm/SwiftLint/pulls/348","_links":{"self":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/comments/49545765"},"html":{"href":"https://github.com/realm/SwiftLint/pull/348#discussion_r49545765"},"pull_request":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/348"}}},"pull_request":{"url":"https://api.github.com/repos/realm/SwiftLint/pulls/348","id":55847637,"html_url":"https://github.com/realm/SwiftLint/pull/348","diff_url":"https://github.com/realm/SwiftLint/pull/348.diff","patch_url":"https://github.com/realm/SwiftLint/pull/348.patch","issue_url":"https://api.github.com/repos/realm/SwiftLint/issues/348","number":348,"state":"open","locked":false,"title":"fix infinite regex search & 'where' false positive in ConditionalBindingCascadeRule","user":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"body":"Fixes #340 and #347 /cc @norio-nomura ","created_at":"2016-01-13T02:36:47Z","updated_at":"2016-01-13T02:39:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e804bd703dd9cd2ab78fd82b97eba6e28eaa59c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/realm/SwiftLint/pulls/348/commits","review_comments_url":"https://api.github.com/repos/realm/SwiftLint/pulls/348/comments","review_comment_url":"https://api.github.com/repos/realm/SwiftLint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/SwiftLint/issues/348/comments","statuses_url":"https://api.github.com/repos/realm/SwiftLint/statuses/e13907ead30ec5750f174fc6a8e7de3e3b74aa4a","head":{"label":"realm:jp-conditional-binding-cascade-fixes","ref":"jp-conditional-binding-cascade-fixes","sha":"e13907ead30ec5750f174fc6a8e7de3e3b74aa4a","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":35732214,"name":"SwiftLint","full_name":"realm/SwiftLint","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/SwiftLint","description":"A tool to enforce Swift style and conventions.","fork":false,"url":"https://api.github.com/repos/realm/SwiftLint","forks_url":"https://api.github.com/repos/realm/SwiftLint/forks","keys_url":"https://api.github.com/repos/realm/SwiftLint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/SwiftLint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/SwiftLint/teams","hooks_url":"https://api.github.com/repos/realm/SwiftLint/hooks","issue_events_url":"https://api.github.com/repos/realm/SwiftLint/issues/events{/number}","events_url":"https://api.github.com/repos/realm/SwiftLint/events","assignees_url":"https://api.github.com/repos/realm/SwiftLint/assignees{/user}","branches_url":"https://api.github.com/repos/realm/SwiftLint/branches{/branch}","tags_url":"https://api.github.com/repos/realm/SwiftLint/tags","blobs_url":"https://api.github.com/repos/realm/SwiftLint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/SwiftLint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/SwiftLint/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/SwiftLint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/SwiftLint/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/SwiftLint/languages","stargazers_url":"https://api.github.com/repos/realm/SwiftLint/stargazers","contributors_url":"https://api.github.com/repos/realm/SwiftLint/contributors","subscribers_url":"https://api.github.com/repos/realm/SwiftLint/subscribers","subscription_url":"https://api.github.com/repos/realm/SwiftLint/subscription","commits_url":"https://api.github.com/repos/realm/SwiftLint/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/SwiftLint/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/SwiftLint/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/SwiftLint/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/SwiftLint/contents/{+path}","compare_url":"https://api.github.com/repos/realm/SwiftLint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/SwiftLint/merges","archive_url":"https://api.github.com/repos/realm/SwiftLint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/SwiftLint/downloads","issues_url":"https://api.github.com/repos/realm/SwiftLint/issues{/number}","pulls_url":"https://api.github.com/repos/realm/SwiftLint/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/SwiftLint/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/SwiftLint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/SwiftLint/labels{/name}","releases_url":"https://api.github.com/repos/realm/SwiftLint/releases{/id}","created_at":"2015-05-16T16:59:31Z","updated_at":"2016-01-12T15:40:17Z","pushed_at":"2016-01-13T02:36:48Z","git_url":"git://github.com/realm/SwiftLint.git","ssh_url":"git@github.com:realm/SwiftLint.git","clone_url":"https://github.com/realm/SwiftLint.git","svn_url":"https://github.com/realm/SwiftLint","homepage":"","size":1019,"stargazers_count":2962,"watchers_count":2962,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"open_issues_count":56,"forks":170,"open_issues":56,"watchers":2962,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"6df884a1192377e5c86ad1a34abdd84d4053f7bc","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":35732214,"name":"SwiftLint","full_name":"realm/SwiftLint","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/SwiftLint","description":"A tool to enforce Swift style and conventions.","fork":false,"url":"https://api.github.com/repos/realm/SwiftLint","forks_url":"https://api.github.com/repos/realm/SwiftLint/forks","keys_url":"https://api.github.com/repos/realm/SwiftLint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/SwiftLint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/SwiftLint/teams","hooks_url":"https://api.github.com/repos/realm/SwiftLint/hooks","issue_events_url":"https://api.github.com/repos/realm/SwiftLint/issues/events{/number}","events_url":"https://api.github.com/repos/realm/SwiftLint/events","assignees_url":"https://api.github.com/repos/realm/SwiftLint/assignees{/user}","branches_url":"https://api.github.com/repos/realm/SwiftLint/branches{/branch}","tags_url":"https://api.github.com/repos/realm/SwiftLint/tags","blobs_url":"https://api.github.com/repos/realm/SwiftLint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/SwiftLint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/SwiftLint/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/SwiftLint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/SwiftLint/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/SwiftLint/languages","stargazers_url":"https://api.github.com/repos/realm/SwiftLint/stargazers","contributors_url":"https://api.github.com/repos/realm/SwiftLint/contributors","subscribers_url":"https://api.github.com/repos/realm/SwiftLint/subscribers","subscription_url":"https://api.github.com/repos/realm/SwiftLint/subscription","commits_url":"https://api.github.com/repos/realm/SwiftLint/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/SwiftLint/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/SwiftLint/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/SwiftLint/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/SwiftLint/contents/{+path}","compare_url":"https://api.github.com/repos/realm/SwiftLint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/SwiftLint/merges","archive_url":"https://api.github.com/repos/realm/SwiftLint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/SwiftLint/downloads","issues_url":"https://api.github.com/repos/realm/SwiftLint/issues{/number}","pulls_url":"https://api.github.com/repos/realm/SwiftLint/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/SwiftLint/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/SwiftLint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/SwiftLint/labels{/name}","releases_url":"https://api.github.com/repos/realm/SwiftLint/releases{/id}","created_at":"2015-05-16T16:59:31Z","updated_at":"2016-01-12T15:40:17Z","pushed_at":"2016-01-13T02:36:48Z","git_url":"git://github.com/realm/SwiftLint.git","ssh_url":"git@github.com:realm/SwiftLint.git","clone_url":"https://github.com/realm/SwiftLint.git","svn_url":"https://github.com/realm/SwiftLint","homepage":"","size":1019,"stargazers_count":2962,"watchers_count":2962,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"open_issues_count":56,"forks":170,"open_issues":56,"watchers":2962,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/348"},"html":{"href":"https://github.com/realm/SwiftLint/pull/348"},"issue":{"href":"https://api.github.com/repos/realm/SwiftLint/issues/348"},"comments":{"href":"https://api.github.com/repos/realm/SwiftLint/issues/348/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/348/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/348/commits"},"statuses":{"href":"https://api.github.com/repos/realm/SwiftLint/statuses/e13907ead30ec5750f174fc6a8e7de3e3b74aa4a"}}}}