{"action":"created","comment":{"url":"https://api.github.com/repos/bazelbuild/rules_go/pulls/comments/188404367","pull_request_review_id":120376046,"id":188404367,"diff_hunk":"@@ -0,0 +1,207 @@\n+/* Copyright 2018 The Bazel Authors. All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+   http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+// Loads and runs registered analyses on a well-typed Go package.\n+\n+package main\n+\n+import (\n+\t\"errors\"\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"go/ast\"\n+\t\"go/build\"\n+\t\"go/parser\"\n+\t\"go/token\"\n+\t\"go/types\"\n+\t\"log\"\n+\t\"os\"\n+\t\"path/filepath\"\n+\t\"sort\"\n+\t\"strings\"\n+\n+\t\"github.com/bazelbuild/rules_go/go/tools/analysis\"\n+\t\"golang.org/x/tools/go/gcexportdata\"\n+)\n+\n+// run returns an error only if the package is successfully loaded and at least\n+// one analysis fails. All other errors (e.g. during loading) are logged but\n+// do not return an error so as not to unnecessarily interrupt builds.\n+func run(args []string) error {\n+\tarchiveFiles := multiFlag{}\n+\tflags := flag.NewFlagSet(\"checker\", flag.ContinueOnError)\n+\tflags.Var(&archiveFiles, \"archivefile\", \"Archive file of a direct dependency\")\n+\tstdlib := flags.String(\"stdlib\", \"\", \"Root directory of stdlib\")\n+\tif err := flags.Parse(args); err != nil {\n+\t\tlog.Println(err)\n+\t\treturn nil","path":"go/tools/builders/checker_main.go","position":49,"original_position":49,"commit_id":"d10f3ba12108873a060b2635e826d428493ac811","original_commit_id":"d10f3ba12108873a060b2635e826d428493ac811","user":{"login":"stjj89","id":3895885,"avatar_url":"https://avatars3.githubusercontent.com/u/3895885?v=4","gravatar_id":"","url":"https://api.github.com/users/stjj89","html_url":"https://github.com/stjj89","followers_url":"https://api.github.com/users/stjj89/followers","following_url":"https://api.github.com/users/stjj89/following{/other_user}","gists_url":"https://api.github.com/users/stjj89/gists{/gist_id}","starred_url":"https://api.github.com/users/stjj89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stjj89/subscriptions","organizations_url":"https://api.github.com/users/stjj89/orgs","repos_url":"https://api.github.com/users/stjj89/repos","events_url":"https://api.github.com/users/stjj89/events{/privacy}","received_events_url":"https://api.github.com/users/stjj89/received_events","type":"User","site_admin":false},"body":"In the internal Go code analysis framework (nogo), only legitimate code analysis failures should block the build. We surface error messages for other internal errors, but do not block builds for them. We do not want a mistake on the check-writer's part to interfere with Go developer productivity.\r\n\r\nI think that the same policy should apply here. A build-blocking check failure can be particularly high impact if the developer cannot turn off the check. (i.e. in a setup where the configuration file is only writable by a subset of developers at the organization.)","created_at":"2018-05-15T19:13:37Z","updated_at":"2018-05-15T19:13:37Z","html_url":"https://github.com/bazelbuild/rules_go/pull/1487#discussion_r188404367","pull_request_url":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/rules_go/pulls/comments/188404367"},"html":{"href":"https://github.com/bazelbuild/rules_go/pull/1487#discussion_r188404367"},"pull_request":{"href":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487"}},"in_reply_to_id":188360425},"pull_request":{"url":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487","id":186134643,"html_url":"https://github.com/bazelbuild/rules_go/pull/1487","diff_url":"https://github.com/bazelbuild/rules_go/pull/1487.diff","patch_url":"https://github.com/bazelbuild/rules_go/pull/1487.patch","issue_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/1487","number":1487,"state":"open","locked":false,"title":" Dynamically generate and execute check libraries","user":{"login":"stjj89","id":3895885,"avatar_url":"https://avatars3.githubusercontent.com/u/3895885?v=4","gravatar_id":"","url":"https://api.github.com/users/stjj89","html_url":"https://github.com/stjj89","followers_url":"https://api.github.com/users/stjj89/followers","following_url":"https://api.github.com/users/stjj89/following{/other_user}","gists_url":"https://api.github.com/users/stjj89/gists{/gist_id}","starred_url":"https://api.github.com/users/stjj89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stjj89/subscriptions","organizations_url":"https://api.github.com/users/stjj89/orgs","repos_url":"https://api.github.com/users/stjj89/repos","events_url":"https://api.github.com/users/stjj89/events{/privacy}","received_events_url":"https://api.github.com/users/stjj89/received_events","type":"User","site_admin":false},"body":"Link all the check libraries passed to the go_checker rule into the\r\ngenerated checker binary and run the analyses these libraries register\r\nat build-time. Each check library must register its analysis using the\r\nnewly added package analysis.\r\n\r\nFirst pass. Pending questions:\r\n- Is there a need for `go_check_library`? Should checks be given as `go_tool_library`?\r\n- The checker code is getting complex. Should we keep that much code in a template, or are there cleaner alternatives?\r\n- How should we write integration tests for this? We will probably need some way to dynamically change the WORKSPACE file in the test environment.\r\n- Package analysis, gcexportdata, and gcimporter15 need to be go_tool_library to solve the bootstrapping problem. Is there any cleaner way to solve this problem?","created_at":"2018-05-05T02:16:01Z","updated_at":"2018-05-15T19:13:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7be30008b8821d4f6b70e0039036b286bf7309ea","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ianthehat","id":858832,"avatar_url":"https://avatars0.githubusercontent.com/u/858832?v=4","gravatar_id":"","url":"https://api.github.com/users/ianthehat","html_url":"https://github.com/ianthehat","followers_url":"https://api.github.com/users/ianthehat/followers","following_url":"https://api.github.com/users/ianthehat/following{/other_user}","gists_url":"https://api.github.com/users/ianthehat/gists{/gist_id}","starred_url":"https://api.github.com/users/ianthehat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianthehat/subscriptions","organizations_url":"https://api.github.com/users/ianthehat/orgs","repos_url":"https://api.github.com/users/ianthehat/repos","events_url":"https://api.github.com/users/ianthehat/events{/privacy}","received_events_url":"https://api.github.com/users/ianthehat/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":342134177,"url":"https://api.github.com/repos/bazelbuild/rules_go/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487/commits","review_comments_url":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487/comments","review_comment_url":"https://api.github.com/repos/bazelbuild/rules_go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/1487/comments","statuses_url":"https://api.github.com/repos/bazelbuild/rules_go/statuses/d10f3ba12108873a060b2635e826d428493ac811","head":{"label":"stjj89:check","ref":"check","sha":"d10f3ba12108873a060b2635e826d428493ac811","user":{"login":"stjj89","id":3895885,"avatar_url":"https://avatars3.githubusercontent.com/u/3895885?v=4","gravatar_id":"","url":"https://api.github.com/users/stjj89","html_url":"https://github.com/stjj89","followers_url":"https://api.github.com/users/stjj89/followers","following_url":"https://api.github.com/users/stjj89/following{/other_user}","gists_url":"https://api.github.com/users/stjj89/gists{/gist_id}","starred_url":"https://api.github.com/users/stjj89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stjj89/subscriptions","organizations_url":"https://api.github.com/users/stjj89/orgs","repos_url":"https://api.github.com/users/stjj89/repos","events_url":"https://api.github.com/users/stjj89/events{/privacy}","received_events_url":"https://api.github.com/users/stjj89/received_events","type":"User","site_admin":false},"repo":{"id":130738762,"name":"rules_go","full_name":"stjj89/rules_go","owner":{"login":"stjj89","id":3895885,"avatar_url":"https://avatars3.githubusercontent.com/u/3895885?v=4","gravatar_id":"","url":"https://api.github.com/users/stjj89","html_url":"https://github.com/stjj89","followers_url":"https://api.github.com/users/stjj89/followers","following_url":"https://api.github.com/users/stjj89/following{/other_user}","gists_url":"https://api.github.com/users/stjj89/gists{/gist_id}","starred_url":"https://api.github.com/users/stjj89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stjj89/subscriptions","organizations_url":"https://api.github.com/users/stjj89/orgs","repos_url":"https://api.github.com/users/stjj89/repos","events_url":"https://api.github.com/users/stjj89/events{/privacy}","received_events_url":"https://api.github.com/users/stjj89/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stjj89/rules_go","description":"Go rules for Bazel","fork":true,"url":"https://api.github.com/repos/stjj89/rules_go","forks_url":"https://api.github.com/repos/stjj89/rules_go/forks","keys_url":"https://api.github.com/repos/stjj89/rules_go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stjj89/rules_go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stjj89/rules_go/teams","hooks_url":"https://api.github.com/repos/stjj89/rules_go/hooks","issue_events_url":"https://api.github.com/repos/stjj89/rules_go/issues/events{/number}","events_url":"https://api.github.com/repos/stjj89/rules_go/events","assignees_url":"https://api.github.com/repos/stjj89/rules_go/assignees{/user}","branches_url":"https://api.github.com/repos/stjj89/rules_go/branches{/branch}","tags_url":"https://api.github.com/repos/stjj89/rules_go/tags","blobs_url":"https://api.github.com/repos/stjj89/rules_go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stjj89/rules_go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stjj89/rules_go/git/refs{/sha}","trees_url":"https://api.github.com/repos/stjj89/rules_go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stjj89/rules_go/statuses/{sha}","languages_url":"https://api.github.com/repos/stjj89/rules_go/languages","stargazers_url":"https://api.github.com/repos/stjj89/rules_go/stargazers","contributors_url":"https://api.github.com/repos/stjj89/rules_go/contributors","subscribers_url":"https://api.github.com/repos/stjj89/rules_go/subscribers","subscription_url":"https://api.github.com/repos/stjj89/rules_go/subscription","commits_url":"https://api.github.com/repos/stjj89/rules_go/commits{/sha}","git_commits_url":"https://api.github.com/repos/stjj89/rules_go/git/commits{/sha}","comments_url":"https://api.github.com/repos/stjj89/rules_go/comments{/number}","issue_comment_url":"https://api.github.com/repos/stjj89/rules_go/issues/comments{/number}","contents_url":"https://api.github.com/repos/stjj89/rules_go/contents/{+path}","compare_url":"https://api.github.com/repos/stjj89/rules_go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stjj89/rules_go/merges","archive_url":"https://api.github.com/repos/stjj89/rules_go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stjj89/rules_go/downloads","issues_url":"https://api.github.com/repos/stjj89/rules_go/issues{/number}","pulls_url":"https://api.github.com/repos/stjj89/rules_go/pulls{/number}","milestones_url":"https://api.github.com/repos/stjj89/rules_go/milestones{/number}","notifications_url":"https://api.github.com/repos/stjj89/rules_go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stjj89/rules_go/labels{/name}","releases_url":"https://api.github.com/repos/stjj89/rules_go/releases{/id}","deployments_url":"https://api.github.com/repos/stjj89/rules_go/deployments","created_at":"2018-04-23T18:20:59Z","updated_at":"2018-04-24T22:00:18Z","pushed_at":"2018-05-15T00:23:11Z","git_url":"git://github.com/stjj89/rules_go.git","ssh_url":"git@github.com:stjj89/rules_go.git","clone_url":"https://github.com/stjj89/rules_go.git","svn_url":"https://github.com/stjj89/rules_go","homepage":null,"size":2427,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"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":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bazelbuild:feature/check","ref":"feature/check","sha":"9e263c2b18a647e1772ea24e49bb33d35495a86f","user":{"login":"bazelbuild","id":11684617,"avatar_url":"https://avatars1.githubusercontent.com/u/11684617?v=4","gravatar_id":"","url":"https://api.github.com/users/bazelbuild","html_url":"https://github.com/bazelbuild","followers_url":"https://api.github.com/users/bazelbuild/followers","following_url":"https://api.github.com/users/bazelbuild/following{/other_user}","gists_url":"https://api.github.com/users/bazelbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/bazelbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazelbuild/subscriptions","organizations_url":"https://api.github.com/users/bazelbuild/orgs","repos_url":"https://api.github.com/users/bazelbuild/repos","events_url":"https://api.github.com/users/bazelbuild/events{/privacy}","received_events_url":"https://api.github.com/users/bazelbuild/received_events","type":"Organization","site_admin":false},"repo":{"id":53954979,"name":"rules_go","full_name":"bazelbuild/rules_go","owner":{"login":"bazelbuild","id":11684617,"avatar_url":"https://avatars1.githubusercontent.com/u/11684617?v=4","gravatar_id":"","url":"https://api.github.com/users/bazelbuild","html_url":"https://github.com/bazelbuild","followers_url":"https://api.github.com/users/bazelbuild/followers","following_url":"https://api.github.com/users/bazelbuild/following{/other_user}","gists_url":"https://api.github.com/users/bazelbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/bazelbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazelbuild/subscriptions","organizations_url":"https://api.github.com/users/bazelbuild/orgs","repos_url":"https://api.github.com/users/bazelbuild/repos","events_url":"https://api.github.com/users/bazelbuild/events{/privacy}","received_events_url":"https://api.github.com/users/bazelbuild/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bazelbuild/rules_go","description":"Go rules for Bazel","fork":false,"url":"https://api.github.com/repos/bazelbuild/rules_go","forks_url":"https://api.github.com/repos/bazelbuild/rules_go/forks","keys_url":"https://api.github.com/repos/bazelbuild/rules_go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bazelbuild/rules_go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bazelbuild/rules_go/teams","hooks_url":"https://api.github.com/repos/bazelbuild/rules_go/hooks","issue_events_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/events{/number}","events_url":"https://api.github.com/repos/bazelbuild/rules_go/events","assignees_url":"https://api.github.com/repos/bazelbuild/rules_go/assignees{/user}","branches_url":"https://api.github.com/repos/bazelbuild/rules_go/branches{/branch}","tags_url":"https://api.github.com/repos/bazelbuild/rules_go/tags","blobs_url":"https://api.github.com/repos/bazelbuild/rules_go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bazelbuild/rules_go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bazelbuild/rules_go/git/refs{/sha}","trees_url":"https://api.github.com/repos/bazelbuild/rules_go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bazelbuild/rules_go/statuses/{sha}","languages_url":"https://api.github.com/repos/bazelbuild/rules_go/languages","stargazers_url":"https://api.github.com/repos/bazelbuild/rules_go/stargazers","contributors_url":"https://api.github.com/repos/bazelbuild/rules_go/contributors","subscribers_url":"https://api.github.com/repos/bazelbuild/rules_go/subscribers","subscription_url":"https://api.github.com/repos/bazelbuild/rules_go/subscription","commits_url":"https://api.github.com/repos/bazelbuild/rules_go/commits{/sha}","git_commits_url":"https://api.github.com/repos/bazelbuild/rules_go/git/commits{/sha}","comments_url":"https://api.github.com/repos/bazelbuild/rules_go/comments{/number}","issue_comment_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/comments{/number}","contents_url":"https://api.github.com/repos/bazelbuild/rules_go/contents/{+path}","compare_url":"https://api.github.com/repos/bazelbuild/rules_go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bazelbuild/rules_go/merges","archive_url":"https://api.github.com/repos/bazelbuild/rules_go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bazelbuild/rules_go/downloads","issues_url":"https://api.github.com/repos/bazelbuild/rules_go/issues{/number}","pulls_url":"https://api.github.com/repos/bazelbuild/rules_go/pulls{/number}","milestones_url":"https://api.github.com/repos/bazelbuild/rules_go/milestones{/number}","notifications_url":"https://api.github.com/repos/bazelbuild/rules_go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bazelbuild/rules_go/labels{/name}","releases_url":"https://api.github.com/repos/bazelbuild/rules_go/releases{/id}","deployments_url":"https://api.github.com/repos/bazelbuild/rules_go/deployments","created_at":"2016-03-15T15:15:14Z","updated_at":"2018-05-15T14:34:11Z","pushed_at":"2018-05-15T00:23:12Z","git_url":"git://github.com/bazelbuild/rules_go.git","ssh_url":"git@github.com:bazelbuild/rules_go.git","clone_url":"https://github.com/bazelbuild/rules_go.git","svn_url":"https://github.com/bazelbuild/rules_go","homepage":null,"size":2463,"stargazers_count":264,"watchers_count":264,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":177,"mirror_url":null,"archived":false,"open_issues_count":108,"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":177,"open_issues":108,"watchers":264,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487"},"html":{"href":"https://github.com/bazelbuild/rules_go/pull/1487"},"issue":{"href":"https://api.github.com/repos/bazelbuild/rules_go/issues/1487"},"comments":{"href":"https://api.github.com/repos/bazelbuild/rules_go/issues/1487/comments"},"review_comments":{"href":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487/comments"},"review_comment":{"href":"https://api.github.com/repos/bazelbuild/rules_go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bazelbuild/rules_go/pulls/1487/commits"},"statuses":{"href":"https://api.github.com/repos/bazelbuild/rules_go/statuses/d10f3ba12108873a060b2635e826d428493ac811"}},"author_association":"NONE"}}
{"actor":{"display_login":"stjj89"}}