{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/16533","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/16533/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/16533/comments","events_url":"https://api.github.com/repos/golang/go/issues/16533/events","html_url":"https://github.com/golang/go/issues/16533","id":168225621,"number":16533,"title":"proposal: x/tools/cmd/guru: Add option -allowerrors to perform analysis ignoring errors in packages in scope","user":{"login":"keymon","id":280032,"avatar_url":"https://avatars.githubusercontent.com/u/280032?v=3","gravatar_id":"","url":"https://api.github.com/users/keymon","html_url":"https://github.com/keymon","followers_url":"https://api.github.com/users/keymon/followers","following_url":"https://api.github.com/users/keymon/following{/other_user}","gists_url":"https://api.github.com/users/keymon/gists{/gist_id}","starred_url":"https://api.github.com/users/keymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keymon/subscriptions","organizations_url":"https://api.github.com/users/keymon/orgs","repos_url":"https://api.github.com/users/keymon/repos","events_url":"https://api.github.com/users/keymon/events{/privacy}","received_events_url":"https://api.github.com/users/keymon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/22","html_url":"https://github.com/golang/go/milestones/Unreleased","labels_url":"https://api.github.com/repos/golang/go/milestones/22/labels","id":1067491,"number":22,"title":"Unreleased","description":"Issues that do not affect released Go code and binaries.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":536,"closed_issues":567,"state":"open","created_at":"2015-04-14T18:48:22Z","updated_at":"2016-07-29T20:13:27Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":3,"created_at":"2016-07-29T00:20:29Z","updated_at":"2016-07-29T20:15:00Z","closed_at":null,"body":"## Context and problem to solve \r\n\r\nCurrently `guru` will abort if any package in the scope has some I/O, parser or type error. There is no way to disable this behaviour. \r\n\r\n`guru` is used for multiple plugins in different editors and IDEs (e.g. [vim-go](https://github.com/fatih/vim-go), [vscode-go](https://github.com/Microsoft/vscode-go), [go-plus for atom](https://atom.io/packages/go-plus)). In development environments it is common to be used in code trees where there might be files which some errors, missing dependencies, etc.\r\n\r\nIt is quite inconvenient not be able to use `guru` for code analysis simply because some `.go` fails. It would be desirable if `guru` had some option to ignore such error, ignoring the package during analysis. \r\n\r\n## Proposal\r\n\r\nI propose  add an option `-allowerrors` which would enable the [flag `loader.Config.AllowErrors`](https://github.com/golang/tools/blob/master/go/loader/loader.go#L80-L84):\r\n\r\n>  If AllowErrors is true, Load will return a Program even\r\n> if some of the its packages contained I/O, parser or type\r\n> errors; such errors are accessible via PackageInfo.Errors.  If\r\n> false, Load will fail if any package had an error.\r\n\r\nWith this option `guru` will still print the errors in stderr, but ignore the packages with errors and perform the analysis."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/236282272","html_url":"https://github.com/golang/go/issues/16533#issuecomment-236282272","issue_url":"https://api.github.com/repos/golang/go/issues/16533","id":236282272,"user":{"login":"quentinmit","id":115761,"avatar_url":"https://avatars.githubusercontent.com/u/115761?v=3","gravatar_id":"","url":"https://api.github.com/users/quentinmit","html_url":"https://github.com/quentinmit","followers_url":"https://api.github.com/users/quentinmit/followers","following_url":"https://api.github.com/users/quentinmit/following{/other_user}","gists_url":"https://api.github.com/users/quentinmit/gists{/gist_id}","starred_url":"https://api.github.com/users/quentinmit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quentinmit/subscriptions","organizations_url":"https://api.github.com/users/quentinmit/orgs","repos_url":"https://api.github.com/users/quentinmit/repos","events_url":"https://api.github.com/users/quentinmit/events{/privacy}","received_events_url":"https://api.github.com/users/quentinmit/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T20:14:59Z","updated_at":"2016-07-29T20:14:59Z","body":"This seems dangerous to me; if the packages fail to parse, the output of guru will be incomplete. This might cause more problems than it solves if e.g. someone is using guru to help with a refactoring."}}
{"actor":{"display_login":"quentinmit"}}