{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/366079168","pull_request_review_id":342201931,"id":366079168,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2NjA3OTE2OA==","diff_hunk":"@@ -0,0 +1,66 @@\n+# Nullable Annotations\n+\n+This document describes how nullable annotations should be approached in the \n+Roslyn code base. The default is to simply follow [the same guidance](https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/api-guidelines/nullability.md)\n+as the [dotnet/runtime](github.com/dotnet/runtime) repository. This document\n+serves to detail the places where the guidance differs for Roslyn and \n+re-emphasize rules that come up frequently.\n+\n+## Annotation Guidance \n+\n+- **DO** annotate all new code\n+- **DO** use the null suppression operator in places where a method body has\n+ensured a value cannot be `null` but the compiler is unable to track it. \n+Example:\n+```cs\n+struct SyntaxTrivia {\n+    void Example() {    \n+        if (this.HasStructure) {\n+            Use(this.GetStructure()!)\n+        }\n+    }\n+}\n+```\n+- **DO** use `Assert` to validate state that is passed into the method\n+```cs\n+void M1(SyntaxNode node) {\n+    RoslynDebug.Assert(node.Parent is object);\n+    ...\n+    M2(node.Parent);\n+}\n+```\n+- **AVOID** annotating and refactoring code in the same commit. This can\n+significantly increase the cost of reviewing. Prefer instead to separate \n+annotations and significant refactorings into separate commits. Small changes,\n+and modernizing style (change `default(SyntaxToken)` to `default`) are\n+acceptable.\n+- **DO NOT** be concerned with the validity of annotations after an object has \n+been Dispose'd or otherwise entered into an invalid state. For example\n+manipulating a pooled object after it's been freed. This is a violation of the \n+objects contract and annotations aren't meaningful here.\n+- **DO NOT** be concerned with the validity of an enumerator's Current ","path":"docs/contributing/Nullable Annotations.md","position":41,"original_position":41,"commit_id":"e99c593b1b6c95d69b72c4bae76445b6cd2bb3d3","original_commit_id":"e99c593b1b6c95d69b72c4bae76445b6cd2bb3d3","user":{"login":"sharwell","id":1408396,"node_id":"MDQ6VXNlcjE0MDgzOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1408396?v=4","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n- **DO NOT** be concerned with the validity of an enumerator's `Current` \r\n```","created_at":"2020-01-13T23:14:20Z","updated_at":"2020-01-13T23:16:55Z","html_url":"https://github.com/dotnet/roslyn/pull/40940#discussion_r366079168","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/40940","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/366079168"},"html":{"href":"https://github.com/dotnet/roslyn/pull/40940#discussion_r366079168"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/40940"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/40940","id":362360563,"node_id":"MDExOlB1bGxSZXF1ZXN0MzYyMzYwNTYz","html_url":"https://github.com/dotnet/roslyn/pull/40940","diff_url":"https://github.com/dotnet/roslyn/pull/40940.diff","patch_url":"https://github.com/dotnet/roslyn/pull/40940.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/40940","number":40940,"state":"open","locked":false,"title":"Nullable Annotations Guidance","user":{"login":"jaredpar","id":146967,"node_id":"MDQ6VXNlcjE0Njk2Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/146967?v=4","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"body":"This document is meant to serve as a guide for developers as they\r\nadd nullable annotations to the Roslyn code base.\r\n\r\nThis is still a bit rough and incomplete but I wanted to send it out for\r\nreview so we can get it into shape and begin using it for guidance on\r\nannotations going forward.","created_at":"2020-01-13T22:52:17Z","updated_at":"2020-01-13T23:16:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99f4dc19b43572aac6b7bf9ab6308d430ea4a258","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":177193291,"node_id":"MDU6TGFiZWwxNzcxOTMyOTE=","url":"https://api.github.com/repos/dotnet/roslyn/labels/Documentation","name":"Documentation","color":"e52727","default":false,"description":""}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/40940/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/40940/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/40940/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/e99c593b1b6c95d69b72c4bae76445b6cd2bb3d3","head":{"label":"jaredpar:nullable-doc","ref":"nullable-doc","sha":"e99c593b1b6c95d69b72c4bae76445b6cd2bb3d3","user":{"login":"jaredpar","id":146967,"node_id":"MDQ6VXNlcjE0Njk2Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/146967?v=4","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"repo":{"id":29310774,"node_id":"MDEwOlJlcG9zaXRvcnkyOTMxMDc3NA==","name":"roslyn","full_name":"jaredpar/roslyn","private":false,"owner":{"login":"jaredpar","id":146967,"node_id":"MDQ6VXNlcjE0Njk2Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/146967?v=4","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jaredpar/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/jaredpar/roslyn","forks_url":"https://api.github.com/repos/jaredpar/roslyn/forks","keys_url":"https://api.github.com/repos/jaredpar/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaredpar/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaredpar/roslyn/teams","hooks_url":"https://api.github.com/repos/jaredpar/roslyn/hooks","issue_events_url":"https://api.github.com/repos/jaredpar/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/jaredpar/roslyn/events","assignees_url":"https://api.github.com/repos/jaredpar/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/jaredpar/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/jaredpar/roslyn/tags","blobs_url":"https://api.github.com/repos/jaredpar/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaredpar/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaredpar/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaredpar/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaredpar/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/jaredpar/roslyn/languages","stargazers_url":"https://api.github.com/repos/jaredpar/roslyn/stargazers","contributors_url":"https://api.github.com/repos/jaredpar/roslyn/contributors","subscribers_url":"https://api.github.com/repos/jaredpar/roslyn/subscribers","subscription_url":"https://api.github.com/repos/jaredpar/roslyn/subscription","commits_url":"https://api.github.com/repos/jaredpar/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaredpar/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaredpar/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaredpar/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaredpar/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/jaredpar/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaredpar/roslyn/merges","archive_url":"https://api.github.com/repos/jaredpar/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaredpar/roslyn/downloads","issues_url":"https://api.github.com/repos/jaredpar/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/jaredpar/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/jaredpar/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/jaredpar/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaredpar/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/jaredpar/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/jaredpar/roslyn/deployments","created_at":"2015-01-15T18:10:36Z","updated_at":"2018-10-04T06:51:10Z","pushed_at":"2020-01-13T23:10:59Z","git_url":"git://github.com/jaredpar/roslyn.git","ssh_url":"git@github.com:jaredpar/roslyn.git","clone_url":"https://github.com/jaredpar/roslyn.git","svn_url":"https://github.com/jaredpar/roslyn","homepage":"","size":757728,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":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":1,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"4251c80d37c03cc2b5f779e10c73ca7d80ddc778","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"node_id":"MDEwOlJlcG9zaXRvcnkyOTA3ODk5Nw==","name":"roslyn","full_name":"dotnet/roslyn","private":false,"owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dotnet/roslyn","description":"The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2020-01-13T22:50:36Z","pushed_at":"2020-01-13T23:11:01Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/","size":788202,"stargazers_count":12290,"watchers_count":12290,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2868,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":6918,"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":2868,"open_issues":6918,"watchers":12290,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/40940"},"html":{"href":"https://github.com/dotnet/roslyn/pull/40940"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/40940"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/40940/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/40940/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/40940/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/e99c593b1b6c95d69b72c4bae76445b6cd2bb3d3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"sharwell"}}