{"action":"created","comment":{"url":"https://api.github.com/repos/square/kotlinpoet/pulls/comments/227020938","pull_request_review_id":166967698,"id":227020938,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzAyMDkzOA==","diff_hunk":"@@ -221,6 +221,22 @@ class FunSpecTest {\n       |fun foo(string: kotlin.String, nodoc: kotlin.Boolean): kotlin.String = \"foo\"\"\"\".trimMargin())\n   }\n \n+  @Test fun functionWithModifiedReturnKdoc() {\n+    val funSpec = FunSpec.builder(\"foo\")\n+        .addParameter(ParameterSpec.builder(\"nodoc\", Boolean::class).build())\n+        .returns(String::class, \"the foo.\")\n+        .addCode(CodeBlock.of(\"return \\\"foo\\\"\"))","path":"src/test/java/com/squareup/kotlinpoet/FunSpecTest.kt","position":null,"original_position":8,"commit_id":"6aef8b0ba4c371330edff97ae041a80321f5bc72","original_commit_id":"1ffae286c3015cc234410e7b13ad505e66af9344","user":{"login":"shaishavgandhi05","id":2227639,"node_id":"MDQ6VXNlcjIyMjc2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2227639?v=4","gravatar_id":"","url":"https://api.github.com/users/shaishavgandhi05","html_url":"https://github.com/shaishavgandhi05","followers_url":"https://api.github.com/users/shaishavgandhi05/followers","following_url":"https://api.github.com/users/shaishavgandhi05/following{/other_user}","gists_url":"https://api.github.com/users/shaishavgandhi05/gists{/gist_id}","starred_url":"https://api.github.com/users/shaishavgandhi05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaishavgandhi05/subscriptions","organizations_url":"https://api.github.com/users/shaishavgandhi05/orgs","repos_url":"https://api.github.com/users/shaishavgandhi05/repos","events_url":"https://api.github.com/users/shaishavgandhi05/events{/privacy}","received_events_url":"https://api.github.com/users/shaishavgandhi05/received_events","type":"User","site_admin":false},"body":"TIL. The one I did always felt awkward. Have fixed it in a test above this one too which had it. ","created_at":"2018-10-22T15:20:13Z","updated_at":"2018-10-22T15:20:14Z","html_url":"https://github.com/square/kotlinpoet/pull/505#discussion_r227020938","pull_request_url":"https://api.github.com/repos/square/kotlinpoet/pulls/505","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/square/kotlinpoet/pulls/comments/227020938"},"html":{"href":"https://github.com/square/kotlinpoet/pull/505#discussion_r227020938"},"pull_request":{"href":"https://api.github.com/repos/square/kotlinpoet/pulls/505"}},"in_reply_to_id":227009828},"pull_request":{"url":"https://api.github.com/repos/square/kotlinpoet/pulls/505","id":224597868,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NTk3ODY4","html_url":"https://github.com/square/kotlinpoet/pull/505","diff_url":"https://github.com/square/kotlinpoet/pull/505.diff","patch_url":"https://github.com/square/kotlinpoet/pull/505.patch","issue_url":"https://api.github.com/repos/square/kotlinpoet/issues/505","number":505,"state":"open","locked":false,"title":"Return KDoc follow up","user":{"login":"shaishavgandhi05","id":2227639,"node_id":"MDQ6VXNlcjIyMjc2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2227639?v=4","gravatar_id":"","url":"https://api.github.com/users/shaishavgandhi05","html_url":"https://github.com/shaishavgandhi05","followers_url":"https://api.github.com/users/shaishavgandhi05/followers","following_url":"https://api.github.com/users/shaishavgandhi05/following{/other_user}","gists_url":"https://api.github.com/users/shaishavgandhi05/gists{/gist_id}","starred_url":"https://api.github.com/users/shaishavgandhi05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaishavgandhi05/subscriptions","organizations_url":"https://api.github.com/users/shaishavgandhi05/orgs","repos_url":"https://api.github.com/users/shaishavgandhi05/repos","events_url":"https://api.github.com/users/shaishavgandhi05/events{/privacy}","received_events_url":"https://api.github.com/users/shaishavgandhi05/received_events","type":"User","site_admin":false},"body":"There were some subtle bugs with the initial implementation of adding KDoc to `returns()`. \r\n1. This fixes the bug where `toBuilder()` wouldn't have the Kdoc associated with the return type.\r\n2. Have moved the `returnKdoc` to only have the description and not the `@return` keyword as well. We only add the `@return` on emission. \r\n3. To accurately model `returns`, we now just replace the Kdoc given in the `returns()` method instead of appending to the `returnKdoc` CodeBlock. This makes more sense since if you do `toBuilder()` and then change the return type, the newer Kdoc should replace the older one and not append to it. ","created_at":"2018-10-22T06:28:37Z","updated_at":"2018-10-22T15:20:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e467e059c3ec2a9d3036c43260034c81b730dad1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/square/kotlinpoet/pulls/505/commits","review_comments_url":"https://api.github.com/repos/square/kotlinpoet/pulls/505/comments","review_comment_url":"https://api.github.com/repos/square/kotlinpoet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/kotlinpoet/issues/505/comments","statuses_url":"https://api.github.com/repos/square/kotlinpoet/statuses/6aef8b0ba4c371330edff97ae041a80321f5bc72","head":{"label":"shaishavgandhi05:sg/return-kdoc-followup","ref":"sg/return-kdoc-followup","sha":"6aef8b0ba4c371330edff97ae041a80321f5bc72","user":{"login":"shaishavgandhi05","id":2227639,"node_id":"MDQ6VXNlcjIyMjc2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2227639?v=4","gravatar_id":"","url":"https://api.github.com/users/shaishavgandhi05","html_url":"https://github.com/shaishavgandhi05","followers_url":"https://api.github.com/users/shaishavgandhi05/followers","following_url":"https://api.github.com/users/shaishavgandhi05/following{/other_user}","gists_url":"https://api.github.com/users/shaishavgandhi05/gists{/gist_id}","starred_url":"https://api.github.com/users/shaishavgandhi05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaishavgandhi05/subscriptions","organizations_url":"https://api.github.com/users/shaishavgandhi05/orgs","repos_url":"https://api.github.com/users/shaishavgandhi05/repos","events_url":"https://api.github.com/users/shaishavgandhi05/events{/privacy}","received_events_url":"https://api.github.com/users/shaishavgandhi05/received_events","type":"User","site_admin":false},"repo":{"id":141607632,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE2MDc2MzI=","name":"kotlinpoet","full_name":"shaishavgandhi05/kotlinpoet","private":false,"owner":{"login":"shaishavgandhi05","id":2227639,"node_id":"MDQ6VXNlcjIyMjc2Mzk=","avatar_url":"https://avatars1.githubusercontent.com/u/2227639?v=4","gravatar_id":"","url":"https://api.github.com/users/shaishavgandhi05","html_url":"https://github.com/shaishavgandhi05","followers_url":"https://api.github.com/users/shaishavgandhi05/followers","following_url":"https://api.github.com/users/shaishavgandhi05/following{/other_user}","gists_url":"https://api.github.com/users/shaishavgandhi05/gists{/gist_id}","starred_url":"https://api.github.com/users/shaishavgandhi05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaishavgandhi05/subscriptions","organizations_url":"https://api.github.com/users/shaishavgandhi05/orgs","repos_url":"https://api.github.com/users/shaishavgandhi05/repos","events_url":"https://api.github.com/users/shaishavgandhi05/events{/privacy}","received_events_url":"https://api.github.com/users/shaishavgandhi05/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shaishavgandhi05/kotlinpoet","description":"A Kotlin API for generating .kt source files.","fork":true,"url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet","forks_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/forks","keys_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/teams","hooks_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/hooks","issue_events_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/issues/events{/number}","events_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/events","assignees_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/assignees{/user}","branches_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/branches{/branch}","tags_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/tags","blobs_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/git/refs{/sha}","trees_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/statuses/{sha}","languages_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/languages","stargazers_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/stargazers","contributors_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/contributors","subscribers_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/subscribers","subscription_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/subscription","commits_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/commits{/sha}","git_commits_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/git/commits{/sha}","comments_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/comments{/number}","issue_comment_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/issues/comments{/number}","contents_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/contents/{+path}","compare_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/merges","archive_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/downloads","issues_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/issues{/number}","pulls_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/pulls{/number}","milestones_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/milestones{/number}","notifications_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/labels{/name}","releases_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/releases{/id}","deployments_url":"https://api.github.com/repos/shaishavgandhi05/kotlinpoet/deployments","created_at":"2018-07-19T16:52:59Z","updated_at":"2018-07-19T16:53:01Z","pushed_at":"2018-10-22T15:19:36Z","git_url":"git://github.com/shaishavgandhi05/kotlinpoet.git","ssh_url":"git@github.com:shaishavgandhi05/kotlinpoet.git","clone_url":"https://github.com/shaishavgandhi05/kotlinpoet.git","svn_url":"https://github.com/shaishavgandhi05/kotlinpoet","homepage":"","size":2147,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"d65e85f693dd790e5e63ef4fcf208a38dce0a27f","user":{"login":"square","id":82592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNTky","avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":83513404,"node_id":"MDEwOlJlcG9zaXRvcnk4MzUxMzQwNA==","name":"kotlinpoet","full_name":"square/kotlinpoet","private":false,"owner":{"login":"square","id":82592,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyNTky","avatar_url":"https://avatars0.githubusercontent.com/u/82592?v=4","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/square/kotlinpoet","description":"A Kotlin API for generating .kt source files.","fork":false,"url":"https://api.github.com/repos/square/kotlinpoet","forks_url":"https://api.github.com/repos/square/kotlinpoet/forks","keys_url":"https://api.github.com/repos/square/kotlinpoet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/kotlinpoet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/kotlinpoet/teams","hooks_url":"https://api.github.com/repos/square/kotlinpoet/hooks","issue_events_url":"https://api.github.com/repos/square/kotlinpoet/issues/events{/number}","events_url":"https://api.github.com/repos/square/kotlinpoet/events","assignees_url":"https://api.github.com/repos/square/kotlinpoet/assignees{/user}","branches_url":"https://api.github.com/repos/square/kotlinpoet/branches{/branch}","tags_url":"https://api.github.com/repos/square/kotlinpoet/tags","blobs_url":"https://api.github.com/repos/square/kotlinpoet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/kotlinpoet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/kotlinpoet/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/kotlinpoet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/kotlinpoet/statuses/{sha}","languages_url":"https://api.github.com/repos/square/kotlinpoet/languages","stargazers_url":"https://api.github.com/repos/square/kotlinpoet/stargazers","contributors_url":"https://api.github.com/repos/square/kotlinpoet/contributors","subscribers_url":"https://api.github.com/repos/square/kotlinpoet/subscribers","subscription_url":"https://api.github.com/repos/square/kotlinpoet/subscription","commits_url":"https://api.github.com/repos/square/kotlinpoet/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/kotlinpoet/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/kotlinpoet/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/kotlinpoet/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/kotlinpoet/contents/{+path}","compare_url":"https://api.github.com/repos/square/kotlinpoet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/kotlinpoet/merges","archive_url":"https://api.github.com/repos/square/kotlinpoet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/kotlinpoet/downloads","issues_url":"https://api.github.com/repos/square/kotlinpoet/issues{/number}","pulls_url":"https://api.github.com/repos/square/kotlinpoet/pulls{/number}","milestones_url":"https://api.github.com/repos/square/kotlinpoet/milestones{/number}","notifications_url":"https://api.github.com/repos/square/kotlinpoet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/kotlinpoet/labels{/name}","releases_url":"https://api.github.com/repos/square/kotlinpoet/releases{/id}","deployments_url":"https://api.github.com/repos/square/kotlinpoet/deployments","created_at":"2017-03-01T04:59:42Z","updated_at":"2018-10-22T05:05:04Z","pushed_at":"2018-10-22T15:19:38Z","git_url":"git://github.com/square/kotlinpoet.git","ssh_url":"git@github.com:square/kotlinpoet.git","clone_url":"https://github.com/square/kotlinpoet.git","svn_url":"https://github.com/square/kotlinpoet","homepage":"","size":2148,"stargazers_count":1474,"watchers_count":1474,"language":"Kotlin","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":99,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":99,"open_issues":34,"watchers":1474,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/kotlinpoet/pulls/505"},"html":{"href":"https://github.com/square/kotlinpoet/pull/505"},"issue":{"href":"https://api.github.com/repos/square/kotlinpoet/issues/505"},"comments":{"href":"https://api.github.com/repos/square/kotlinpoet/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/square/kotlinpoet/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/square/kotlinpoet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/kotlinpoet/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/square/kotlinpoet/statuses/6aef8b0ba4c371330edff97ae041a80321f5bc72"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"shaishavgandhi05"}}