-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: x/tools/go/analysis/passes/shadow: option to ignore generated code #61574
Comments
An already available option is post processing the json output to filter the list/regex of files to ignore. But going more broadly, how do you want to be able to specify this option? My personal preference would be an annotation in the function or package, e.g. |
In any way, really. The existing tools our projects use have a wild variety of ways to ignore things from the command line:
I personally think that On a more finegrained level, one could specify an identifier the same way
I think there is a way to customize the gRPC code generator by either forking it or using some kind of a plugin, but that feels like on overkill to just add an annotation. |
Ignoring based on a regexp at the file level makes sense to me. I think a combination of the package and the file's base name sounds fairly robust and helpful ( If someone deeply wanted fine grained filtering, they could use multiple files to contain the 'ignore shadow' functions. |
protoc-gen-go-grpc
, in particular, generates code like:Another, more generic option would be providing a list of ignored files.
The text was updated successfully, but these errors were encountered: