{"action":"created","comment":{"url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments/172893703","pull_request_review_id":101989151,"id":172893703,"diff_hunk":"@@ -118,10 +127,14 @@ HashSet<ITypeSymbol> typeStack\n \t\t\t\t\t+ \"are referenced, including transitive dependencies.\" );\r\n \t\t\t}\r\n \r\n-\t\t\t// If we're verifying immutability, then carry on; otherwise, bailout\r\n-\t\t\tif( !flags.HasFlag( MutabilityInspectionFlags.IgnoreImmutabilityAttribute ) && type.IsTypeMarkedImmutable() ) {\r\n-\t\t\t\tImmutableHashSet<string> immutableExceptions = type.GetAllImmutableExceptions();\r\n-\t\t\t\treturn MutabilityInspectionResult.NotMutable( immutableExceptions );\r\n+\t\t\t// If we're not verifying immutability, we might be able to bail out early\r\n+\t\t\tvar scope = type.GetImmutabilityScope();\r\n+\t\t\tif( !flags.HasFlag( MutabilityInspectionFlags.IgnoreImmutabilityAttribute ) && scope != ImmutabilityScope.None ) {\r\n+\t\t\t\t// if we're fully immutable or we allow unsealed (i.e., base classes), then bailout\r\n+\t\t\t\tif( scope == ImmutabilityScope.SelfAndChildren || flags.HasFlag( MutabilityInspectionFlags.AllowUnsealed ) && scope == ImmutabilityScope.Self ) {\r","path":"src/D2L.CodeStyle.Analyzers/Immutability/MutabilityInspector.cs","position":28,"original_position":28,"commit_id":"8b22e97ffe975a495af1f9b89db3c2fad398904d","original_commit_id":"8b22e97ffe975a495af1f9b89db3c2fad398904d","user":{"login":"j3parker","id":597907,"avatar_url":"https://avatars2.githubusercontent.com/u/597907?v=4","gravatar_id":"","url":"https://api.github.com/users/j3parker","html_url":"https://github.com/j3parker","followers_url":"https://api.github.com/users/j3parker/followers","following_url":"https://api.github.com/users/j3parker/following{/other_user}","gists_url":"https://api.github.com/users/j3parker/gists{/gist_id}","starred_url":"https://api.github.com/users/j3parker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j3parker/subscriptions","organizations_url":"https://api.github.com/users/j3parker/orgs","repos_url":"https://api.github.com/users/j3parker/repos","events_url":"https://api.github.com/users/j3parker/events{/privacy}","received_events_url":"https://api.github.com/users/j3parker/received_events","type":"User","site_admin":false},"body":"I think this should be rewritten to not rely on implicit associativity rules.\r\n\r\n```cs\r\nif ( flags.HasFlag( MutabilityInspectionFlags.AllowUnsealed ) ) {\r\n  if ( scope != ImmutabilityScope.None ) {\r\n    // not mutable\r\n  } \r\n} else if ( scope == ImmutablityScope.SelfAndChildern ) {\r\n  // not mutable\r\n}\r\n\r\n// mutable\r\n```\r\nI'm going to submit a PR today that will start the ball rolling on removing `MutabilityInspectionFlags.AllowUnsealed`, so each of those branches are going to go to different functions anyway.","created_at":"2018-03-07T16:06:54Z","updated_at":"2018-03-07T16:06:54Z","html_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/296#discussion_r172893703","pull_request_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments/172893703"},"html":{"href":"https://github.com/Brightspace/D2L.CodeStyle/pull/296#discussion_r172893703"},"pull_request":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296"}}},"pull_request":{"url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296","id":169210645,"html_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/296","diff_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/296.diff","patch_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/296.patch","issue_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/296","number":296,"state":"open","locked":false,"title":"Adding a new `ImmutableBaseClass` attribute.","user":{"login":"saquibmian","id":2387703,"avatar_url":"https://avatars2.githubusercontent.com/u/2387703?v=4","gravatar_id":"","url":"https://api.github.com/users/saquibmian","html_url":"https://github.com/saquibmian","followers_url":"https://api.github.com/users/saquibmian/followers","following_url":"https://api.github.com/users/saquibmian/following{/other_user}","gists_url":"https://api.github.com/users/saquibmian/gists{/gist_id}","starred_url":"https://api.github.com/users/saquibmian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saquibmian/subscriptions","organizations_url":"https://api.github.com/users/saquibmian/orgs","repos_url":"https://api.github.com/users/saquibmian/repos","events_url":"https://api.github.com/users/saquibmian/events{/privacy}","received_events_url":"https://api.github.com/users/saquibmian/received_events","type":"User","site_admin":false},"body":"This attribute applies the rules of immutability to a base class, without requiring its implementations to also be immutable.\r\nAs such, a member of said type is not safe, unless it is known to be the concrete type.","created_at":"2018-02-14T20:13:46Z","updated_at":"2018-03-07T16:06:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d75ffeed804725c17dc1fc764546b0ac7eab5d3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296/commits","review_comments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296/comments","review_comment_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/296/comments","statuses_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/statuses/8b22e97ffe975a495af1f9b89db3c2fad398904d","head":{"label":"Brightspace:smian/immutableBaseClassOnly","ref":"smian/immutableBaseClassOnly","sha":"8b22e97ffe975a495af1f9b89db3c2fad398904d","user":{"login":"Brightspace","id":5429170,"avatar_url":"https://avatars2.githubusercontent.com/u/5429170?v=4","gravatar_id":"","url":"https://api.github.com/users/Brightspace","html_url":"https://github.com/Brightspace","followers_url":"https://api.github.com/users/Brightspace/followers","following_url":"https://api.github.com/users/Brightspace/following{/other_user}","gists_url":"https://api.github.com/users/Brightspace/gists{/gist_id}","starred_url":"https://api.github.com/users/Brightspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brightspace/subscriptions","organizations_url":"https://api.github.com/users/Brightspace/orgs","repos_url":"https://api.github.com/users/Brightspace/repos","events_url":"https://api.github.com/users/Brightspace/events{/privacy}","received_events_url":"https://api.github.com/users/Brightspace/received_events","type":"Organization","site_admin":false},"repo":{"id":66025309,"name":"D2L.CodeStyle","full_name":"Brightspace/D2L.CodeStyle","owner":{"login":"Brightspace","id":5429170,"avatar_url":"https://avatars2.githubusercontent.com/u/5429170?v=4","gravatar_id":"","url":"https://api.github.com/users/Brightspace","html_url":"https://github.com/Brightspace","followers_url":"https://api.github.com/users/Brightspace/followers","following_url":"https://api.github.com/users/Brightspace/following{/other_user}","gists_url":"https://api.github.com/users/Brightspace/gists{/gist_id}","starred_url":"https://api.github.com/users/Brightspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brightspace/subscriptions","organizations_url":"https://api.github.com/users/Brightspace/orgs","repos_url":"https://api.github.com/users/Brightspace/repos","events_url":"https://api.github.com/users/Brightspace/events{/privacy}","received_events_url":"https://api.github.com/users/Brightspace/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Brightspace/D2L.CodeStyle","description":"Annotations and analysis tools for D2L C# code style","fork":false,"url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle","forks_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/forks","keys_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/teams","hooks_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/hooks","issue_events_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/events{/number}","events_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/events","assignees_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/assignees{/user}","branches_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/branches{/branch}","tags_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/tags","blobs_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/statuses/{sha}","languages_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/languages","stargazers_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/stargazers","contributors_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/contributors","subscribers_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/subscribers","subscription_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/subscription","commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/contents/{+path}","compare_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/merges","archive_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/downloads","issues_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues{/number}","pulls_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls{/number}","milestones_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/milestones{/number}","notifications_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/labels{/name}","releases_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/releases{/id}","deployments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/deployments","created_at":"2016-08-18T19:36:38Z","updated_at":"2018-03-05T21:00:53Z","pushed_at":"2018-03-06T16:35:59Z","git_url":"git://github.com/Brightspace/D2L.CodeStyle.git","ssh_url":"git@github.com:Brightspace/D2L.CodeStyle.git","clone_url":"https://github.com/Brightspace/D2L.CodeStyle.git","svn_url":"https://github.com/Brightspace/D2L.CodeStyle","homepage":"","size":927,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":13,"watchers":0,"default_branch":"master"}},"base":{"label":"Brightspace:master","ref":"master","sha":"c84826e7593b04d520d9e2f3b19abed1226a49a6","user":{"login":"Brightspace","id":5429170,"avatar_url":"https://avatars2.githubusercontent.com/u/5429170?v=4","gravatar_id":"","url":"https://api.github.com/users/Brightspace","html_url":"https://github.com/Brightspace","followers_url":"https://api.github.com/users/Brightspace/followers","following_url":"https://api.github.com/users/Brightspace/following{/other_user}","gists_url":"https://api.github.com/users/Brightspace/gists{/gist_id}","starred_url":"https://api.github.com/users/Brightspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brightspace/subscriptions","organizations_url":"https://api.github.com/users/Brightspace/orgs","repos_url":"https://api.github.com/users/Brightspace/repos","events_url":"https://api.github.com/users/Brightspace/events{/privacy}","received_events_url":"https://api.github.com/users/Brightspace/received_events","type":"Organization","site_admin":false},"repo":{"id":66025309,"name":"D2L.CodeStyle","full_name":"Brightspace/D2L.CodeStyle","owner":{"login":"Brightspace","id":5429170,"avatar_url":"https://avatars2.githubusercontent.com/u/5429170?v=4","gravatar_id":"","url":"https://api.github.com/users/Brightspace","html_url":"https://github.com/Brightspace","followers_url":"https://api.github.com/users/Brightspace/followers","following_url":"https://api.github.com/users/Brightspace/following{/other_user}","gists_url":"https://api.github.com/users/Brightspace/gists{/gist_id}","starred_url":"https://api.github.com/users/Brightspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brightspace/subscriptions","organizations_url":"https://api.github.com/users/Brightspace/orgs","repos_url":"https://api.github.com/users/Brightspace/repos","events_url":"https://api.github.com/users/Brightspace/events{/privacy}","received_events_url":"https://api.github.com/users/Brightspace/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Brightspace/D2L.CodeStyle","description":"Annotations and analysis tools for D2L C# code style","fork":false,"url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle","forks_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/forks","keys_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/teams","hooks_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/hooks","issue_events_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/events{/number}","events_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/events","assignees_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/assignees{/user}","branches_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/branches{/branch}","tags_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/tags","blobs_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/statuses/{sha}","languages_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/languages","stargazers_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/stargazers","contributors_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/contributors","subscribers_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/subscribers","subscription_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/subscription","commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/contents/{+path}","compare_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/merges","archive_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/downloads","issues_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues{/number}","pulls_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls{/number}","milestones_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/milestones{/number}","notifications_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/labels{/name}","releases_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/releases{/id}","deployments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/deployments","created_at":"2016-08-18T19:36:38Z","updated_at":"2018-03-05T21:00:53Z","pushed_at":"2018-03-06T16:35:59Z","git_url":"git://github.com/Brightspace/D2L.CodeStyle.git","ssh_url":"git@github.com:Brightspace/D2L.CodeStyle.git","clone_url":"https://github.com/Brightspace/D2L.CodeStyle.git","svn_url":"https://github.com/Brightspace/D2L.CodeStyle","homepage":"","size":927,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296"},"html":{"href":"https://github.com/Brightspace/D2L.CodeStyle/pull/296"},"issue":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/296"},"comments":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/296/comments"},"review_comments":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296/comments"},"review_comment":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/296/commits"},"statuses":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/statuses/8b22e97ffe975a495af1f9b89db3c2fad398904d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"j3parker"}}