{"action":"created","comment":{"url":"https://api.github.com/repos/thenerdery/android-standards/pulls/comments/199054969","pull_request_review_id":133099672,"id":199054969,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTA1NDk2OQ==","diff_hunk":"@@ -338,12 +342,68 @@ if (condition) {\n }\n ----\n \n-This is __bad__:\n-\n [source, kotlin]\n ----\n if (condition)\n-    body()  // bad!\n+    body()  // WRONG!\n+----\n+\n+Braces are not required for `when` branches and `if` statement bodies if they meet BOTH\n+the following conditions:\n+\n+. the conditional and the branch each contain at most a single predicate\n+. it fits on a single line\n+\n+For `if` statements, there is an additional condition that there be no `else if` or `else`\n+branches.\n+\n+[source, kotlin]\n+----\n+// Okay\n+if (string.isEmpty()) return\n+\n+// Okay\n+when (value) {\n+    0 -> doSpecificThing()\n+    1 -> doAnotherSpecificThing()\n+\telse -> doGenericThing()\n+}\n+\n+// WRONG\n+if (string.isEmpty()) doEmptyThing() else doFullThing()\n+\n+// STILL WRONG!\n+if (string.isEmpty()) doEmptyThing()\n+else doFullThing()\n+\n+----\n+\n+==== Expressions\n+\n+An `if`/`else` conditional that is used as an expression may omit braces only if the\n+conditional and each branch of the expression contain at most a single predicate,\n+and the entire expression fits on one line.\n+\n+[source, kotlin]\n+----\n+val value = if (string.isEmpty()) 0 else 1  // Okay","path":"standards/code-style.adoc","position":73,"original_position":73,"commit_id":"1183b54259d67775a360fa087adfdcb912d1ddb3","original_commit_id":"1183b54259d67775a360fa087adfdcb912d1ddb3","user":{"login":"kentonw","id":9555918,"node_id":"MDQ6VXNlcjk1NTU5MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/9555918?v=4","gravatar_id":"","url":"https://api.github.com/users/kentonw","html_url":"https://github.com/kentonw","followers_url":"https://api.github.com/users/kentonw/followers","following_url":"https://api.github.com/users/kentonw/following{/other_user}","gists_url":"https://api.github.com/users/kentonw/gists{/gist_id}","starred_url":"https://api.github.com/users/kentonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentonw/subscriptions","organizations_url":"https://api.github.com/users/kentonw/orgs","repos_url":"https://api.github.com/users/kentonw/repos","events_url":"https://api.github.com/users/kentonw/events{/privacy}","received_events_url":"https://api.github.com/users/kentonw/received_events","type":"User","site_admin":false},"body":"This actually seems like it might contradict the above statement I commented on. Am I missing something?","created_at":"2018-06-29T05:17:08Z","updated_at":"2018-06-29T05:17:40Z","html_url":"https://github.com/thenerdery/android-standards/pull/22#discussion_r199054969","pull_request_url":"https://api.github.com/repos/thenerdery/android-standards/pulls/22","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/thenerdery/android-standards/pulls/comments/199054969"},"html":{"href":"https://github.com/thenerdery/android-standards/pull/22#discussion_r199054969"},"pull_request":{"href":"https://api.github.com/repos/thenerdery/android-standards/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/thenerdery/android-standards/pulls/22","id":196993420,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2OTkzNDIw","html_url":"https://github.com/thenerdery/android-standards/pull/22","diff_url":"https://github.com/thenerdery/android-standards/pull/22.diff","patch_url":"https://github.com/thenerdery/android-standards/pull/22.patch","issue_url":"https://api.github.com/repos/thenerdery/android-standards/issues/22","number":22,"state":"open","locked":false,"title":"Feature/braces exception","user":{"login":"hustonerd","id":2975102,"node_id":"MDQ6VXNlcjI5NzUxMDI=","avatar_url":"https://avatars1.githubusercontent.com/u/2975102?v=4","gravatar_id":"","url":"https://api.github.com/users/hustonerd","html_url":"https://github.com/hustonerd","followers_url":"https://api.github.com/users/hustonerd/followers","following_url":"https://api.github.com/users/hustonerd/following{/other_user}","gists_url":"https://api.github.com/users/hustonerd/gists{/gist_id}","starred_url":"https://api.github.com/users/hustonerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hustonerd/subscriptions","organizations_url":"https://api.github.com/users/hustonerd/orgs","repos_url":"https://api.github.com/users/hustonerd/repos","events_url":"https://api.github.com/users/hustonerd/events{/privacy}","received_events_url":"https://api.github.com/users/hustonerd/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-25T03:29:29Z","updated_at":"2018-06-29T05:17:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65d3e1890101aa242112180040ac2032a667edc9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mwolfson","id":295446,"node_id":"MDQ6VXNlcjI5NTQ0Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/295446?v=4","gravatar_id":"","url":"https://api.github.com/users/mwolfson","html_url":"https://github.com/mwolfson","followers_url":"https://api.github.com/users/mwolfson/followers","following_url":"https://api.github.com/users/mwolfson/following{/other_user}","gists_url":"https://api.github.com/users/mwolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/mwolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwolfson/subscriptions","organizations_url":"https://api.github.com/users/mwolfson/orgs","repos_url":"https://api.github.com/users/mwolfson/repos","events_url":"https://api.github.com/users/mwolfson/events{/privacy}","received_events_url":"https://api.github.com/users/mwolfson/received_events","type":"User","site_admin":false},{"login":"fuentespatrick","id":817401,"node_id":"MDQ6VXNlcjgxNzQwMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/817401?v=4","gravatar_id":"","url":"https://api.github.com/users/fuentespatrick","html_url":"https://github.com/fuentespatrick","followers_url":"https://api.github.com/users/fuentespatrick/followers","following_url":"https://api.github.com/users/fuentespatrick/following{/other_user}","gists_url":"https://api.github.com/users/fuentespatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/fuentespatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fuentespatrick/subscriptions","organizations_url":"https://api.github.com/users/fuentespatrick/orgs","repos_url":"https://api.github.com/users/fuentespatrick/repos","events_url":"https://api.github.com/users/fuentespatrick/events{/privacy}","received_events_url":"https://api.github.com/users/fuentespatrick/received_events","type":"User","site_admin":false},{"login":"PerkinsRyan","id":2190329,"node_id":"MDQ6VXNlcjIxOTAzMjk=","avatar_url":"https://avatars0.githubusercontent.com/u/2190329?v=4","gravatar_id":"","url":"https://api.github.com/users/PerkinsRyan","html_url":"https://github.com/PerkinsRyan","followers_url":"https://api.github.com/users/PerkinsRyan/followers","following_url":"https://api.github.com/users/PerkinsRyan/following{/other_user}","gists_url":"https://api.github.com/users/PerkinsRyan/gists{/gist_id}","starred_url":"https://api.github.com/users/PerkinsRyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PerkinsRyan/subscriptions","organizations_url":"https://api.github.com/users/PerkinsRyan/orgs","repos_url":"https://api.github.com/users/PerkinsRyan/repos","events_url":"https://api.github.com/users/PerkinsRyan/events{/privacy}","received_events_url":"https://api.github.com/users/PerkinsRyan/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/thenerdery/android-standards/pulls/22/commits","review_comments_url":"https://api.github.com/repos/thenerdery/android-standards/pulls/22/comments","review_comment_url":"https://api.github.com/repos/thenerdery/android-standards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thenerdery/android-standards/issues/22/comments","statuses_url":"https://api.github.com/repos/thenerdery/android-standards/statuses/1183b54259d67775a360fa087adfdcb912d1ddb3","head":{"label":"hustonerd:feature/braces-exception","ref":"feature/braces-exception","sha":"1183b54259d67775a360fa087adfdcb912d1ddb3","user":{"login":"hustonerd","id":2975102,"node_id":"MDQ6VXNlcjI5NzUxMDI=","avatar_url":"https://avatars1.githubusercontent.com/u/2975102?v=4","gravatar_id":"","url":"https://api.github.com/users/hustonerd","html_url":"https://github.com/hustonerd","followers_url":"https://api.github.com/users/hustonerd/followers","following_url":"https://api.github.com/users/hustonerd/following{/other_user}","gists_url":"https://api.github.com/users/hustonerd/gists{/gist_id}","starred_url":"https://api.github.com/users/hustonerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hustonerd/subscriptions","organizations_url":"https://api.github.com/users/hustonerd/orgs","repos_url":"https://api.github.com/users/hustonerd/repos","events_url":"https://api.github.com/users/hustonerd/events{/privacy}","received_events_url":"https://api.github.com/users/hustonerd/received_events","type":"User","site_admin":false},"repo":{"id":128384541,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgzODQ1NDE=","name":"android-standards","full_name":"hustonerd/android-standards","owner":{"login":"hustonerd","id":2975102,"node_id":"MDQ6VXNlcjI5NzUxMDI=","avatar_url":"https://avatars1.githubusercontent.com/u/2975102?v=4","gravatar_id":"","url":"https://api.github.com/users/hustonerd","html_url":"https://github.com/hustonerd","followers_url":"https://api.github.com/users/hustonerd/followers","following_url":"https://api.github.com/users/hustonerd/following{/other_user}","gists_url":"https://api.github.com/users/hustonerd/gists{/gist_id}","starred_url":"https://api.github.com/users/hustonerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hustonerd/subscriptions","organizations_url":"https://api.github.com/users/hustonerd/orgs","repos_url":"https://api.github.com/users/hustonerd/repos","events_url":"https://api.github.com/users/hustonerd/events{/privacy}","received_events_url":"https://api.github.com/users/hustonerd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hustonerd/android-standards","description":"Android code and project standards for The Nerdery","fork":true,"url":"https://api.github.com/repos/hustonerd/android-standards","forks_url":"https://api.github.com/repos/hustonerd/android-standards/forks","keys_url":"https://api.github.com/repos/hustonerd/android-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hustonerd/android-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hustonerd/android-standards/teams","hooks_url":"https://api.github.com/repos/hustonerd/android-standards/hooks","issue_events_url":"https://api.github.com/repos/hustonerd/android-standards/issues/events{/number}","events_url":"https://api.github.com/repos/hustonerd/android-standards/events","assignees_url":"https://api.github.com/repos/hustonerd/android-standards/assignees{/user}","branches_url":"https://api.github.com/repos/hustonerd/android-standards/branches{/branch}","tags_url":"https://api.github.com/repos/hustonerd/android-standards/tags","blobs_url":"https://api.github.com/repos/hustonerd/android-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hustonerd/android-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hustonerd/android-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/hustonerd/android-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hustonerd/android-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/hustonerd/android-standards/languages","stargazers_url":"https://api.github.com/repos/hustonerd/android-standards/stargazers","contributors_url":"https://api.github.com/repos/hustonerd/android-standards/contributors","subscribers_url":"https://api.github.com/repos/hustonerd/android-standards/subscribers","subscription_url":"https://api.github.com/repos/hustonerd/android-standards/subscription","commits_url":"https://api.github.com/repos/hustonerd/android-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/hustonerd/android-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/hustonerd/android-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/hustonerd/android-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/hustonerd/android-standards/contents/{+path}","compare_url":"https://api.github.com/repos/hustonerd/android-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hustonerd/android-standards/merges","archive_url":"https://api.github.com/repos/hustonerd/android-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hustonerd/android-standards/downloads","issues_url":"https://api.github.com/repos/hustonerd/android-standards/issues{/number}","pulls_url":"https://api.github.com/repos/hustonerd/android-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/hustonerd/android-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/hustonerd/android-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hustonerd/android-standards/labels{/name}","releases_url":"https://api.github.com/repos/hustonerd/android-standards/releases{/id}","deployments_url":"https://api.github.com/repos/hustonerd/android-standards/deployments","created_at":"2018-04-06T11:09:58Z","updated_at":"2018-06-24T16:14:37Z","pushed_at":"2018-06-27T21:41:53Z","git_url":"git://github.com/hustonerd/android-standards.git","ssh_url":"git@github.com:hustonerd/android-standards.git","clone_url":"https://github.com/hustonerd/android-standards.git","svn_url":"https://github.com/hustonerd/android-standards","homepage":"https://www.nerdery.com/","size":55,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thenerdery:master","ref":"master","sha":"cefd0997f53c14d90da90aaecb9ef0a0f1f9eb8b","user":{"login":"thenerdery","id":1660739,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjA3Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1660739?v=4","gravatar_id":"","url":"https://api.github.com/users/thenerdery","html_url":"https://github.com/thenerdery","followers_url":"https://api.github.com/users/thenerdery/followers","following_url":"https://api.github.com/users/thenerdery/following{/other_user}","gists_url":"https://api.github.com/users/thenerdery/gists{/gist_id}","starred_url":"https://api.github.com/users/thenerdery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thenerdery/subscriptions","organizations_url":"https://api.github.com/users/thenerdery/orgs","repos_url":"https://api.github.com/users/thenerdery/repos","events_url":"https://api.github.com/users/thenerdery/events{/privacy}","received_events_url":"https://api.github.com/users/thenerdery/received_events","type":"Organization","site_admin":false},"repo":{"id":91106827,"node_id":"MDEwOlJlcG9zaXRvcnk5MTEwNjgyNw==","name":"android-standards","full_name":"thenerdery/android-standards","owner":{"login":"thenerdery","id":1660739,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjA3Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1660739?v=4","gravatar_id":"","url":"https://api.github.com/users/thenerdery","html_url":"https://github.com/thenerdery","followers_url":"https://api.github.com/users/thenerdery/followers","following_url":"https://api.github.com/users/thenerdery/following{/other_user}","gists_url":"https://api.github.com/users/thenerdery/gists{/gist_id}","starred_url":"https://api.github.com/users/thenerdery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thenerdery/subscriptions","organizations_url":"https://api.github.com/users/thenerdery/orgs","repos_url":"https://api.github.com/users/thenerdery/repos","events_url":"https://api.github.com/users/thenerdery/events{/privacy}","received_events_url":"https://api.github.com/users/thenerdery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thenerdery/android-standards","description":"Android code and project standards for The Nerdery","fork":false,"url":"https://api.github.com/repos/thenerdery/android-standards","forks_url":"https://api.github.com/repos/thenerdery/android-standards/forks","keys_url":"https://api.github.com/repos/thenerdery/android-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thenerdery/android-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thenerdery/android-standards/teams","hooks_url":"https://api.github.com/repos/thenerdery/android-standards/hooks","issue_events_url":"https://api.github.com/repos/thenerdery/android-standards/issues/events{/number}","events_url":"https://api.github.com/repos/thenerdery/android-standards/events","assignees_url":"https://api.github.com/repos/thenerdery/android-standards/assignees{/user}","branches_url":"https://api.github.com/repos/thenerdery/android-standards/branches{/branch}","tags_url":"https://api.github.com/repos/thenerdery/android-standards/tags","blobs_url":"https://api.github.com/repos/thenerdery/android-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thenerdery/android-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thenerdery/android-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/thenerdery/android-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thenerdery/android-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/thenerdery/android-standards/languages","stargazers_url":"https://api.github.com/repos/thenerdery/android-standards/stargazers","contributors_url":"https://api.github.com/repos/thenerdery/android-standards/contributors","subscribers_url":"https://api.github.com/repos/thenerdery/android-standards/subscribers","subscription_url":"https://api.github.com/repos/thenerdery/android-standards/subscription","commits_url":"https://api.github.com/repos/thenerdery/android-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/thenerdery/android-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/thenerdery/android-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/thenerdery/android-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/thenerdery/android-standards/contents/{+path}","compare_url":"https://api.github.com/repos/thenerdery/android-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thenerdery/android-standards/merges","archive_url":"https://api.github.com/repos/thenerdery/android-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thenerdery/android-standards/downloads","issues_url":"https://api.github.com/repos/thenerdery/android-standards/issues{/number}","pulls_url":"https://api.github.com/repos/thenerdery/android-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/thenerdery/android-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/thenerdery/android-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thenerdery/android-standards/labels{/name}","releases_url":"https://api.github.com/repos/thenerdery/android-standards/releases{/id}","deployments_url":"https://api.github.com/repos/thenerdery/android-standards/deployments","created_at":"2017-05-12T15:48:26Z","updated_at":"2018-06-25T21:03:53Z","pushed_at":"2018-06-27T21:41:54Z","git_url":"git://github.com/thenerdery/android-standards.git","ssh_url":"git@github.com:thenerdery/android-standards.git","clone_url":"https://github.com/thenerdery/android-standards.git","svn_url":"https://github.com/thenerdery/android-standards","homepage":"https://www.nerdery.com/","size":44,"stargazers_count":3,"watchers_count":3,"language":"Shell","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":9,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thenerdery/android-standards/pulls/22"},"html":{"href":"https://github.com/thenerdery/android-standards/pull/22"},"issue":{"href":"https://api.github.com/repos/thenerdery/android-standards/issues/22"},"comments":{"href":"https://api.github.com/repos/thenerdery/android-standards/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/thenerdery/android-standards/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/thenerdery/android-standards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thenerdery/android-standards/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/thenerdery/android-standards/statuses/1183b54259d67775a360fa087adfdcb912d1ddb3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kentonw"}}