{"action":"created","comment":{"url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/comments/206976911","pull_request_review_id":142495814,"id":206976911,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjk3NjkxMQ==","diff_hunk":"@@ -1944,7 +2017,9 @@ def _GetSymbolNameFromForwardDeclareLine(line):\n   \"\"\"\n   iwyu_namespace_re = re.compile(r'namespace ([^{]*) { ')\n   symbolname_re = re.compile(r'([A-Za-z0-9_]+)')\n-  namespaces_in_line = iwyu_namespace_re.findall(line)\n+  # turn anonymous namespaces into their proper symbol representation\n+  namespaces_in_line = iwyu_namespace_re.findall(line.replace(","path":"fix_includes.py","position":267,"original_position":267,"commit_id":"9df690cd45fa6ab4266e40e2be5a4c7a13bea894","original_commit_id":"9df690cd45fa6ab4266e40e2be5a4c7a13bea894","user":{"login":"chri7325","id":12401649,"node_id":"MDQ6VXNlcjEyNDAxNjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/12401649?v=4","gravatar_id":"","url":"https://api.github.com/users/chri7325","html_url":"https://github.com/chri7325","followers_url":"https://api.github.com/users/chri7325/followers","following_url":"https://api.github.com/users/chri7325/following{/other_user}","gists_url":"https://api.github.com/users/chri7325/gists{/gist_id}","starred_url":"https://api.github.com/users/chri7325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chri7325/subscriptions","organizations_url":"https://api.github.com/users/chri7325/orgs","repos_url":"https://api.github.com/users/chri7325/repos","events_url":"https://api.github.com/users/chri7325/events{/privacy}","received_events_url":"https://api.github.com/users/chri7325/received_events","type":"User","site_admin":false},"body":"@kimgr this was actually a bug in this method.  Given an anonymous namespace, the regular expression would fail to properly symbolicate the namespace, leading to global symbol.  Using nm and c++filt on a class in an anonymous namespace shows the symbol namespace as (anonymous namespace).   The test to check this behavior is below where I include an anonymous namespace inside of a regular namespace and are still able to get the proper namespace span and include new forward declares where needed.","created_at":"2018-08-01T18:02:04Z","updated_at":"2018-08-01T18:02:04Z","html_url":"https://github.com/include-what-you-use/include-what-you-use/pull/571#discussion_r206976911","pull_request_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/comments/206976911"},"html":{"href":"https://github.com/include-what-you-use/include-what-you-use/pull/571#discussion_r206976911"},"pull_request":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571"}},"in_reply_to_id":203858591},"pull_request":{"url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571","id":201428323,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNDI4MzIz","html_url":"https://github.com/include-what-you-use/include-what-you-use/pull/571","diff_url":"https://github.com/include-what-you-use/include-what-you-use/pull/571.diff","patch_url":"https://github.com/include-what-you-use/include-what-you-use/pull/571.patch","issue_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/571","number":571,"state":"open","locked":false,"title":"Enhance fix_includes.py to understand multi-level namespaces","user":{"login":"chri7325","id":12401649,"node_id":"MDQ6VXNlcjEyNDAxNjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/12401649?v=4","gravatar_id":"","url":"https://api.github.com/users/chri7325","html_url":"https://github.com/chri7325","followers_url":"https://api.github.com/users/chri7325/followers","following_url":"https://api.github.com/users/chri7325/following{/other_user}","gists_url":"https://api.github.com/users/chri7325/gists{/gist_id}","starred_url":"https://api.github.com/users/chri7325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chri7325/subscriptions","organizations_url":"https://api.github.com/users/chri7325/orgs","repos_url":"https://api.github.com/users/chri7325/repos","events_url":"https://api.github.com/users/chri7325/events{/privacy}","received_events_url":"https://api.github.com/users/chri7325/received_events","type":"User","site_admin":false},"body":"The fix_includes.sh script has logic to append new forward declares at\r\nthe namespace level if possible.  This logic only tries on the first\r\nnamespace encountered, however, so projects with a lot of namespaces\r\nrequire a lot of manual tidying up.  Add multi-level detection so nested\r\nnamespaces have includes automatically inserted without creating new\r\nnamespace blocks when it is possible to do so cleanly.  If any issues\r\nare encountered when evaluating namespaces, new forward declares will\r\nbe added at the top level.  Ifdeffed code will also be ignored when\r\ntrying to evaluate namespaces as well.\r\n\r\nSigned-off-by: Christian Venegas <cvenegas@esri.com>\r\n\r\n@kimgr I've run IWYU on our codebase with these changes and the results\r\nwere very successful.  We have our entire codebase formatted with Allman\r\nnamespaces so it is very normalized.  I changed from Allman namespaces to\r\nnonAllman and had the same success.  I also tried nonAllman with compact\r\nnamespaces.  This covers the cases of\r\n```\r\n// Allman\r\nnamespace ns\r\n{\r\nnamspace ns1\r\n{\r\n} // namespace ns1\r\n} // namespace ns\r\n\r\n// NonAllman\r\nnamespace ns {\r\nnamspace ns1 {\r\n} // namespace ns1\r\n} // namespace ns\r\n```","created_at":"2018-07-14T01:09:45Z","updated_at":"2018-08-01T18:02:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa5359b85e434a34969ffc7139f04db5ac64f95c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571/commits","review_comments_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571/comments","review_comment_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/comments{/number}","comments_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/571/comments","statuses_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/statuses/9df690cd45fa6ab4266e40e2be5a4c7a13bea894","head":{"label":"chri7325:chri7325/multi_level_namespace","ref":"chri7325/multi_level_namespace","sha":"9df690cd45fa6ab4266e40e2be5a4c7a13bea894","user":{"login":"chri7325","id":12401649,"node_id":"MDQ6VXNlcjEyNDAxNjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/12401649?v=4","gravatar_id":"","url":"https://api.github.com/users/chri7325","html_url":"https://github.com/chri7325","followers_url":"https://api.github.com/users/chri7325/followers","following_url":"https://api.github.com/users/chri7325/following{/other_user}","gists_url":"https://api.github.com/users/chri7325/gists{/gist_id}","starred_url":"https://api.github.com/users/chri7325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chri7325/subscriptions","organizations_url":"https://api.github.com/users/chri7325/orgs","repos_url":"https://api.github.com/users/chri7325/repos","events_url":"https://api.github.com/users/chri7325/events{/privacy}","received_events_url":"https://api.github.com/users/chri7325/received_events","type":"User","site_admin":false},"repo":{"id":136983637,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY5ODM2Mzc=","name":"include-what-you-use","full_name":"chri7325/include-what-you-use","owner":{"login":"chri7325","id":12401649,"node_id":"MDQ6VXNlcjEyNDAxNjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/12401649?v=4","gravatar_id":"","url":"https://api.github.com/users/chri7325","html_url":"https://github.com/chri7325","followers_url":"https://api.github.com/users/chri7325/followers","following_url":"https://api.github.com/users/chri7325/following{/other_user}","gists_url":"https://api.github.com/users/chri7325/gists{/gist_id}","starred_url":"https://api.github.com/users/chri7325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chri7325/subscriptions","organizations_url":"https://api.github.com/users/chri7325/orgs","repos_url":"https://api.github.com/users/chri7325/repos","events_url":"https://api.github.com/users/chri7325/events{/privacy}","received_events_url":"https://api.github.com/users/chri7325/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chri7325/include-what-you-use","description":"A tool for use with clang to analyze #includes in C and C++ source files","fork":true,"url":"https://api.github.com/repos/chri7325/include-what-you-use","forks_url":"https://api.github.com/repos/chri7325/include-what-you-use/forks","keys_url":"https://api.github.com/repos/chri7325/include-what-you-use/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chri7325/include-what-you-use/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chri7325/include-what-you-use/teams","hooks_url":"https://api.github.com/repos/chri7325/include-what-you-use/hooks","issue_events_url":"https://api.github.com/repos/chri7325/include-what-you-use/issues/events{/number}","events_url":"https://api.github.com/repos/chri7325/include-what-you-use/events","assignees_url":"https://api.github.com/repos/chri7325/include-what-you-use/assignees{/user}","branches_url":"https://api.github.com/repos/chri7325/include-what-you-use/branches{/branch}","tags_url":"https://api.github.com/repos/chri7325/include-what-you-use/tags","blobs_url":"https://api.github.com/repos/chri7325/include-what-you-use/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chri7325/include-what-you-use/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chri7325/include-what-you-use/git/refs{/sha}","trees_url":"https://api.github.com/repos/chri7325/include-what-you-use/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chri7325/include-what-you-use/statuses/{sha}","languages_url":"https://api.github.com/repos/chri7325/include-what-you-use/languages","stargazers_url":"https://api.github.com/repos/chri7325/include-what-you-use/stargazers","contributors_url":"https://api.github.com/repos/chri7325/include-what-you-use/contributors","subscribers_url":"https://api.github.com/repos/chri7325/include-what-you-use/subscribers","subscription_url":"https://api.github.com/repos/chri7325/include-what-you-use/subscription","commits_url":"https://api.github.com/repos/chri7325/include-what-you-use/commits{/sha}","git_commits_url":"https://api.github.com/repos/chri7325/include-what-you-use/git/commits{/sha}","comments_url":"https://api.github.com/repos/chri7325/include-what-you-use/comments{/number}","issue_comment_url":"https://api.github.com/repos/chri7325/include-what-you-use/issues/comments{/number}","contents_url":"https://api.github.com/repos/chri7325/include-what-you-use/contents/{+path}","compare_url":"https://api.github.com/repos/chri7325/include-what-you-use/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chri7325/include-what-you-use/merges","archive_url":"https://api.github.com/repos/chri7325/include-what-you-use/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chri7325/include-what-you-use/downloads","issues_url":"https://api.github.com/repos/chri7325/include-what-you-use/issues{/number}","pulls_url":"https://api.github.com/repos/chri7325/include-what-you-use/pulls{/number}","milestones_url":"https://api.github.com/repos/chri7325/include-what-you-use/milestones{/number}","notifications_url":"https://api.github.com/repos/chri7325/include-what-you-use/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chri7325/include-what-you-use/labels{/name}","releases_url":"https://api.github.com/repos/chri7325/include-what-you-use/releases{/id}","deployments_url":"https://api.github.com/repos/chri7325/include-what-you-use/deployments","created_at":"2018-06-11T21:36:57Z","updated_at":"2018-06-11T21:36:59Z","pushed_at":"2018-08-01T01:57:59Z","git_url":"git://github.com/chri7325/include-what-you-use.git","ssh_url":"git@github.com:chri7325/include-what-you-use.git","clone_url":"https://github.com/chri7325/include-what-you-use.git","svn_url":"https://github.com/chri7325/include-what-you-use","homepage":"https://include-what-you-use.org","size":1772,"stargazers_count":0,"watchers_count":0,"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,"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":"include-what-you-use:master","ref":"master","sha":"0ac92dbbf3b88f3189d1608873a1feb96b9fbf5c","user":{"login":"include-what-you-use","id":11830272,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODMwMjcy","avatar_url":"https://avatars3.githubusercontent.com/u/11830272?v=4","gravatar_id":"","url":"https://api.github.com/users/include-what-you-use","html_url":"https://github.com/include-what-you-use","followers_url":"https://api.github.com/users/include-what-you-use/followers","following_url":"https://api.github.com/users/include-what-you-use/following{/other_user}","gists_url":"https://api.github.com/users/include-what-you-use/gists{/gist_id}","starred_url":"https://api.github.com/users/include-what-you-use/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/include-what-you-use/subscriptions","organizations_url":"https://api.github.com/users/include-what-you-use/orgs","repos_url":"https://api.github.com/users/include-what-you-use/repos","events_url":"https://api.github.com/users/include-what-you-use/events{/privacy}","received_events_url":"https://api.github.com/users/include-what-you-use/received_events","type":"Organization","site_admin":false},"repo":{"id":37440338,"node_id":"MDEwOlJlcG9zaXRvcnkzNzQ0MDMzOA==","name":"include-what-you-use","full_name":"include-what-you-use/include-what-you-use","owner":{"login":"include-what-you-use","id":11830272,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODMwMjcy","avatar_url":"https://avatars3.githubusercontent.com/u/11830272?v=4","gravatar_id":"","url":"https://api.github.com/users/include-what-you-use","html_url":"https://github.com/include-what-you-use","followers_url":"https://api.github.com/users/include-what-you-use/followers","following_url":"https://api.github.com/users/include-what-you-use/following{/other_user}","gists_url":"https://api.github.com/users/include-what-you-use/gists{/gist_id}","starred_url":"https://api.github.com/users/include-what-you-use/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/include-what-you-use/subscriptions","organizations_url":"https://api.github.com/users/include-what-you-use/orgs","repos_url":"https://api.github.com/users/include-what-you-use/repos","events_url":"https://api.github.com/users/include-what-you-use/events{/privacy}","received_events_url":"https://api.github.com/users/include-what-you-use/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/include-what-you-use/include-what-you-use","description":"A tool for use with clang to analyze #includes in C and C++ source files","fork":false,"url":"https://api.github.com/repos/include-what-you-use/include-what-you-use","forks_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/forks","keys_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/keys{/key_id}","collaborators_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/teams","hooks_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/hooks","issue_events_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/events{/number}","events_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/events","assignees_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/assignees{/user}","branches_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/branches{/branch}","tags_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/tags","blobs_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/git/refs{/sha}","trees_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/git/trees{/sha}","statuses_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/statuses/{sha}","languages_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/languages","stargazers_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/stargazers","contributors_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/contributors","subscribers_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/subscribers","subscription_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/subscription","commits_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/commits{/sha}","git_commits_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/git/commits{/sha}","comments_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/comments{/number}","issue_comment_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/comments{/number}","contents_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/contents/{+path}","compare_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/compare/{base}...{head}","merges_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/merges","archive_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/downloads","issues_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues{/number}","pulls_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls{/number}","milestones_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/milestones{/number}","notifications_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/labels{/name}","releases_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/releases{/id}","deployments_url":"https://api.github.com/repos/include-what-you-use/include-what-you-use/deployments","created_at":"2015-06-15T03:00:29Z","updated_at":"2018-08-01T00:03:44Z","pushed_at":"2018-07-29T12:54:07Z","git_url":"git://github.com/include-what-you-use/include-what-you-use.git","ssh_url":"git@github.com:include-what-you-use/include-what-you-use.git","clone_url":"https://github.com/include-what-you-use/include-what-you-use.git","svn_url":"https://github.com/include-what-you-use/include-what-you-use","homepage":"https://include-what-you-use.org","size":2037,"stargazers_count":1076,"watchers_count":1076,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":105,"mirror_url":null,"archived":false,"open_issues_count":138,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":105,"open_issues":138,"watchers":1076,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571"},"html":{"href":"https://github.com/include-what-you-use/include-what-you-use/pull/571"},"issue":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/571"},"comments":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/issues/571/comments"},"review_comments":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571/comments"},"review_comment":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/pulls/571/commits"},"statuses":{"href":"https://api.github.com/repos/include-what-you-use/include-what-you-use/statuses/9df690cd45fa6ab4266e40e2be5a4c7a13bea894"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chri7325"}}