{"action":"created","comment":{"url":"https://api.github.com/repos/realm/SwiftLint/pulls/comments/204712984","pull_request_review_id":139838469,"id":204712984,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDcxMjk4NA==","diff_hunk":"@@ -30,19 +30,21 @@ public struct ConditionalReturnsOnNewlineRule: ConfigurationProviderRule, Rule,\n     )\n \n     public func validate(file: File) -> [StyleViolation] {\n-        let pattern = \"(guard|if)[^\\n]*return\"\n+        let pattern: String = configuration.ifOnly ? \"(if)[^\\n]*return\" : \"(guard|if)[^\\n]*return\"\n+\n         return file.rangesAndTokens(matching: pattern).filter { _, tokens in\n             guard let firstToken = tokens.first, let lastToken = tokens.last,\n                 SyntaxKind(rawValue: firstToken.type) == .keyword &&\n                     SyntaxKind(rawValue: lastToken.type) == .keyword else {\n                         return false\n             }\n \n-            return [\"if\", \"guard\"].contains(content(for: firstToken, file: file)) &&\n+            let searchTokens: [String] = configuration.ifOnly ? [\"if\"] : [\"if\", \"guard\"]","path":"Source/SwiftLintFramework/Rules/ConditionalReturnsOnNewlineRule.swift","position":null,"original_position":24,"commit_id":"1452da41298cf519b277882614ec38da81e96831","original_commit_id":"73fafd5c071f59b7ed8c09a2fe493f5e202215ea","user":{"login":"Dschee","id":6942160,"node_id":"MDQ6VXNlcjY5NDIxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6942160?v=4","gravatar_id":"","url":"https://api.github.com/users/Dschee","html_url":"https://github.com/Dschee","followers_url":"https://api.github.com/users/Dschee/followers","following_url":"https://api.github.com/users/Dschee/following{/other_user}","gists_url":"https://api.github.com/users/Dschee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dschee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dschee/subscriptions","organizations_url":"https://api.github.com/users/Dschee/orgs","repos_url":"https://api.github.com/users/Dschee/repos","events_url":"https://api.github.com/users/Dschee/events{/privacy}","received_events_url":"https://api.github.com/users/Dschee/received_events","type":"User","site_admin":false},"body":"Removed.","created_at":"2018-07-24T11:04:37Z","updated_at":"2018-07-24T11:04:37Z","html_url":"https://github.com/realm/SwiftLint/pull/2308#discussion_r204712984","pull_request_url":"https://api.github.com/repos/realm/SwiftLint/pulls/2308","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/comments/204712984"},"html":{"href":"https://github.com/realm/SwiftLint/pull/2308#discussion_r204712984"},"pull_request":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/2308"}},"in_reply_to_id":204530400},"pull_request":{"url":"https://api.github.com/repos/realm/SwiftLint/pulls/2308","id":203142167,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMTQyMTY3","html_url":"https://github.com/realm/SwiftLint/pull/2308","diff_url":"https://github.com/realm/SwiftLint/pull/2308.diff","patch_url":"https://github.com/realm/SwiftLint/pull/2308.patch","issue_url":"https://api.github.com/repos/realm/SwiftLint/issues/2308","number":2308,"state":"open","locked":false,"title":"Add `if_only` option to rule conditional_returns_on_newline","user":{"login":"Dschee","id":6942160,"node_id":"MDQ6VXNlcjY5NDIxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6942160?v=4","gravatar_id":"","url":"https://api.github.com/users/Dschee","html_url":"https://github.com/Dschee","followers_url":"https://api.github.com/users/Dschee/followers","following_url":"https://api.github.com/users/Dschee/following{/other_user}","gists_url":"https://api.github.com/users/Dschee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dschee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dschee/subscriptions","organizations_url":"https://api.github.com/users/Dschee/orgs","repos_url":"https://api.github.com/users/Dschee/repos","events_url":"https://api.github.com/users/Dschee/events{/privacy}","received_events_url":"https://api.github.com/users/Dschee/received_events","type":"User","site_admin":false},"body":"Fixes #2307.","created_at":"2018-07-23T08:20:13Z","updated_at":"2018-07-24T11:04:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4ddc5a4d5bf47b69ff87d661834ac9032fd8082","assignee":{"login":"Dschee","id":6942160,"node_id":"MDQ6VXNlcjY5NDIxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6942160?v=4","gravatar_id":"","url":"https://api.github.com/users/Dschee","html_url":"https://github.com/Dschee","followers_url":"https://api.github.com/users/Dschee/followers","following_url":"https://api.github.com/users/Dschee/following{/other_user}","gists_url":"https://api.github.com/users/Dschee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dschee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dschee/subscriptions","organizations_url":"https://api.github.com/users/Dschee/orgs","repos_url":"https://api.github.com/users/Dschee/repos","events_url":"https://api.github.com/users/Dschee/events{/privacy}","received_events_url":"https://api.github.com/users/Dschee/received_events","type":"User","site_admin":false},"assignees":[{"login":"Dschee","id":6942160,"node_id":"MDQ6VXNlcjY5NDIxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6942160?v=4","gravatar_id":"","url":"https://api.github.com/users/Dschee","html_url":"https://github.com/Dschee","followers_url":"https://api.github.com/users/Dschee/followers","following_url":"https://api.github.com/users/Dschee/following{/other_user}","gists_url":"https://api.github.com/users/Dschee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dschee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dschee/subscriptions","organizations_url":"https://api.github.com/users/Dschee/orgs","repos_url":"https://api.github.com/users/Dschee/repos","events_url":"https://api.github.com/users/Dschee/events{/privacy}","received_events_url":"https://api.github.com/users/Dschee/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/realm/SwiftLint/pulls/2308/commits","review_comments_url":"https://api.github.com/repos/realm/SwiftLint/pulls/2308/comments","review_comment_url":"https://api.github.com/repos/realm/SwiftLint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/SwiftLint/issues/2308/comments","statuses_url":"https://api.github.com/repos/realm/SwiftLint/statuses/1452da41298cf519b277882614ec38da81e96831","head":{"label":"Dschee:conditional-returns-on-newline","ref":"conditional-returns-on-newline","sha":"1452da41298cf519b277882614ec38da81e96831","user":{"login":"Dschee","id":6942160,"node_id":"MDQ6VXNlcjY5NDIxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6942160?v=4","gravatar_id":"","url":"https://api.github.com/users/Dschee","html_url":"https://github.com/Dschee","followers_url":"https://api.github.com/users/Dschee/followers","following_url":"https://api.github.com/users/Dschee/following{/other_user}","gists_url":"https://api.github.com/users/Dschee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dschee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dschee/subscriptions","organizations_url":"https://api.github.com/users/Dschee/orgs","repos_url":"https://api.github.com/users/Dschee/repos","events_url":"https://api.github.com/users/Dschee/events{/privacy}","received_events_url":"https://api.github.com/users/Dschee/received_events","type":"User","site_admin":false},"repo":{"id":93259542,"node_id":"MDEwOlJlcG9zaXRvcnk5MzI1OTU0Mg==","name":"SwiftLint","full_name":"Dschee/SwiftLint","owner":{"login":"Dschee","id":6942160,"node_id":"MDQ6VXNlcjY5NDIxNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/6942160?v=4","gravatar_id":"","url":"https://api.github.com/users/Dschee","html_url":"https://github.com/Dschee","followers_url":"https://api.github.com/users/Dschee/followers","following_url":"https://api.github.com/users/Dschee/following{/other_user}","gists_url":"https://api.github.com/users/Dschee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dschee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dschee/subscriptions","organizations_url":"https://api.github.com/users/Dschee/orgs","repos_url":"https://api.github.com/users/Dschee/repos","events_url":"https://api.github.com/users/Dschee/events{/privacy}","received_events_url":"https://api.github.com/users/Dschee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dschee/SwiftLint","description":"A tool to enforce Swift style and conventions.","fork":true,"url":"https://api.github.com/repos/Dschee/SwiftLint","forks_url":"https://api.github.com/repos/Dschee/SwiftLint/forks","keys_url":"https://api.github.com/repos/Dschee/SwiftLint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dschee/SwiftLint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dschee/SwiftLint/teams","hooks_url":"https://api.github.com/repos/Dschee/SwiftLint/hooks","issue_events_url":"https://api.github.com/repos/Dschee/SwiftLint/issues/events{/number}","events_url":"https://api.github.com/repos/Dschee/SwiftLint/events","assignees_url":"https://api.github.com/repos/Dschee/SwiftLint/assignees{/user}","branches_url":"https://api.github.com/repos/Dschee/SwiftLint/branches{/branch}","tags_url":"https://api.github.com/repos/Dschee/SwiftLint/tags","blobs_url":"https://api.github.com/repos/Dschee/SwiftLint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dschee/SwiftLint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dschee/SwiftLint/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dschee/SwiftLint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dschee/SwiftLint/statuses/{sha}","languages_url":"https://api.github.com/repos/Dschee/SwiftLint/languages","stargazers_url":"https://api.github.com/repos/Dschee/SwiftLint/stargazers","contributors_url":"https://api.github.com/repos/Dschee/SwiftLint/contributors","subscribers_url":"https://api.github.com/repos/Dschee/SwiftLint/subscribers","subscription_url":"https://api.github.com/repos/Dschee/SwiftLint/subscription","commits_url":"https://api.github.com/repos/Dschee/SwiftLint/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dschee/SwiftLint/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dschee/SwiftLint/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dschee/SwiftLint/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dschee/SwiftLint/contents/{+path}","compare_url":"https://api.github.com/repos/Dschee/SwiftLint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dschee/SwiftLint/merges","archive_url":"https://api.github.com/repos/Dschee/SwiftLint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dschee/SwiftLint/downloads","issues_url":"https://api.github.com/repos/Dschee/SwiftLint/issues{/number}","pulls_url":"https://api.github.com/repos/Dschee/SwiftLint/pulls{/number}","milestones_url":"https://api.github.com/repos/Dschee/SwiftLint/milestones{/number}","notifications_url":"https://api.github.com/repos/Dschee/SwiftLint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dschee/SwiftLint/labels{/name}","releases_url":"https://api.github.com/repos/Dschee/SwiftLint/releases{/id}","deployments_url":"https://api.github.com/repos/Dschee/SwiftLint/deployments","created_at":"2017-06-03T16:15:15Z","updated_at":"2018-07-23T16:35:54Z","pushed_at":"2018-07-24T11:04:04Z","git_url":"git://github.com/Dschee/SwiftLint.git","ssh_url":"git@github.com:Dschee/SwiftLint.git","clone_url":"https://github.com/Dschee/SwiftLint.git","svn_url":"https://github.com/Dschee/SwiftLint","homepage":"https://realm.io","size":20681,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"b49ae70fc31d89849ac6fdf51999a53d4703bfe7","user":{"login":"realm","id":7575099,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NzUwOTk=","avatar_url":"https://avatars0.githubusercontent.com/u/7575099?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkzNTczMjIxNA==","name":"SwiftLint","full_name":"realm/SwiftLint","owner":{"login":"realm","id":7575099,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NzUwOTk=","avatar_url":"https://avatars0.githubusercontent.com/u/7575099?v=4","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}","deployments_url":"https://api.github.com/repos/realm/SwiftLint/deployments","created_at":"2015-05-16T16:59:31Z","updated_at":"2018-07-24T07:19:07Z","pushed_at":"2018-07-24T11:04:06Z","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":"https://realm.io","size":7313,"stargazers_count":9794,"watchers_count":9794,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":968,"mirror_url":null,"archived":false,"open_issues_count":249,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":968,"open_issues":249,"watchers":9794,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/2308"},"html":{"href":"https://github.com/realm/SwiftLint/pull/2308"},"issue":{"href":"https://api.github.com/repos/realm/SwiftLint/issues/2308"},"comments":{"href":"https://api.github.com/repos/realm/SwiftLint/issues/2308/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/2308/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/SwiftLint/pulls/2308/commits"},"statuses":{"href":"https://api.github.com/repos/realm/SwiftLint/statuses/1452da41298cf519b277882614ec38da81e96831"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Dschee"}}