You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently 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.
guru is used for multiple plugins in different editors and IDEs (e.g. vim-go, vscode-go, go-plus for atom). In development environments it is common to be used in code trees where there might be files which some errors, missing dependencies, etc.
It 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.
If AllowErrors is true, Load will return a Program even
if some of the its packages contained I/O, parser or type
errors; such errors are accessible via PackageInfo.Errors. If
false, Load will fail if any package had an error.
With this option guru will still print the errors in stderr, but ignore the packages with errors and perform the analysis.
The text was updated successfully, but these errors were encountered:
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.
I'm not sure what you mean by "Currently guru will abort if any package ... has some I/O, parser or type error." Guru has always set the AllowErrors flag for type-based queries such as describe, definition, and implements. For queries that need pointer analysis (callers, callees, pointsto, and others), there is no point setting this flag since SSA construction and pointer analysis require a well-formed program.
Context and problem to solve
Currently
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.guru
is used for multiple plugins in different editors and IDEs (e.g. vim-go, vscode-go, go-plus for atom). In development environments it is common to be used in code trees where there might be files which some errors, missing dependencies, etc.It is quite inconvenient not be able to use
guru
for code analysis simply because some.go
fails. It would be desirable ifguru
had some option to ignore such error, ignoring the package during analysis.Proposal
I propose add an option
-allowerrors
which would enable the flagloader.Config.AllowErrors
:With this option
guru
will still print the errors in stderr, but ignore the packages with errors and perform the analysis.The text was updated successfully, but these errors were encountered: