{"action":"created","comment":{"url":"https://api.github.com/repos/realm/SwiftLint/pulls/comments/38267429","id":38267429,"diff_hunk":"@@ -9,9 +9,51 @@\n import SourceKittenFramework\n import SwiftXPC\n \n-typealias Line = (index: Int, content: String)\n+public typealias Line = (index: Int, content: String)\n+\n+public typealias Region = (startLine: Int, endLine: Int, disabledRules: [String])\n+\n+public enum CommandAction: String {\n+    case Enable = \"enable\"\n+    case Disable = \"disable\"\n+}\n+\n+public typealias Command = (CommandAction, String, Int)\n \n extension File {\n+    public func regions() -> [Region] {\n+        let nsStringContents = contents as NSString\n+        let commands = matchPattern(\"swiftlint:(enable|disable):force_cast\")","path":"Source/SwiftLintFramework/File+SwiftLint.swift","position":null,"original_position":19,"commit_id":"71d9d57c8060d55464e8d942173ef7452cb39c03","original_commit_id":"c699d3d2fa3dedaa8db14baae386cd7d4cb5ea4c","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":"the rule capturing was already being done by `NSScanner`, but I had accidentally hardcoded `force_cast` in here as part of my testing.","created_at":"2015-08-30T00:40:20Z","updated_at":"2015-08-30T00:40:20Z","html_url":"https://github.com/realm/SwiftLint/pull/111#discussion_r38267429","pull_request_url":"https://api.github.com/repos/realm/SwiftLint/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/comments/38267429"},"html":{"href":"https://github.com/realm/SwiftLint/pull/111#discussion_r38267429"},"pull_request":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/realm/SwiftLint/pulls/111","id":43704715,"html_url":"https://github.com/realm/SwiftLint/pull/111","diff_url":"https://github.com/realm/SwiftLint/pull/111.diff","patch_url":"https://github.com/realm/SwiftLint/pull/111.patch","issue_url":"https://api.github.com/repos/realm/SwiftLint/issues/111","number":111,"state":"open","locked":false,"title":"Disable/re-enable rules from within source code comments. Fixes #4.","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":"First draft addressing #4. Still need to write some tests, but seems to be working from what I can tell from manually testing. /cc @keith @segiddins ","created_at":"2015-08-30T00:12:31Z","updated_at":"2015-08-30T00:40:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e87c8d2c305cc8b39b9ab5b3f0d3c99e0935ec7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/realm/SwiftLint/pulls/111/commits","review_comments_url":"https://api.github.com/repos/realm/SwiftLint/pulls/111/comments","review_comment_url":"https://api.github.com/repos/realm/SwiftLint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/SwiftLint/issues/111/comments","statuses_url":"https://api.github.com/repos/realm/SwiftLint/statuses/71d9d57c8060d55464e8d942173ef7452cb39c03","head":{"label":"realm:jp-comment-commands","ref":"jp-comment-commands","sha":"71d9d57c8060d55464e8d942173ef7452cb39c03","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":"An experimental 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":"2015-08-29T21:32:15Z","pushed_at":"2015-08-30T00:39:40Z","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":null,"size":852,"stargazers_count":1765,"watchers_count":1765,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":37,"forks":94,"open_issues":37,"watchers":1765,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"524bee7931e680cdfa18c7ec20b2abc67e345017","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":"An experimental 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":"2015-08-29T21:32:15Z","pushed_at":"2015-08-30T00:39:40Z","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":null,"size":852,"stargazers_count":1765,"watchers_count":1765,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":37,"forks":94,"open_issues":37,"watchers":1765,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/111"},"html":{"href":"https://github.com/realm/SwiftLint/pull/111"},"issue":{"href":"https://api.github.com/repos/realm/SwiftLint/issues/111"},"comments":{"href":"https://api.github.com/repos/realm/SwiftLint/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/realm/SwiftLint/statuses/71d9d57c8060d55464e8d942173ef7452cb39c03"}}}}