-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Support for RPC Comments #91
Comments
@evanlknapp - I see, though I'm not sure about storing literal comments in the I would love to have support for
Though there could be a big difference between an "incubated" RPC being addressed with a warning, and a generally "skipped" RPC which you simply want protolock to ignore. I'd gladly accept a PR that implements the above (or something similar if you have other ideas) -- I personally will have limited time to look into this for a couple weeks. Let me know what you think, thanks! |
@nilslice I think I may have confused you. Here's an example of what I have.
So my intention is to make sure that any "incubating" RPC's are left out of the proto.lock file. So my custom rule would basically say that if it finds any RPC's with the "incubating" option throw a warning suggesting to add the "@protolock:skip" comment. However more and more as I think about this, this doesn't sound like a version compatibility rule as much as a linter type rule. So while adding the ability for RPC's to have comments and skip logic may be valid, I am going to back off from this feature suggestion as my use case doesn't feel valid. Feel free to either keep this issue open for future development or close. Thanks again for your input. |
Hey @nilslice so I am circling back to this one to revisit the inclusion of comments. Generally I would agree with you about being skeptical about including comments in the I was hoping to implement a rule for my custom plugin that would prevent adding required fields to a message. To do this I would need to have comments accessible in the |
That is something we could certainly consider... If you have some time to take a stab at this, feel free. If you find a solution that meets your needs this way, we can merge it. If not, I'm mainly concerned with the possibility of bloating file size, and needing to deserialize excess data in the form of comments. I understand your use case completely, but have to reject the inclusion of comments (at least for now, in lieu of what might be a ton of testing to see how comments impact parsing speed, file size, etc). Alternatively, I would suggest adding another There may be other ways to consider. Would you be able to share an example of a message with fields that you'd like to check for? And if possible, include the warning you'd like to issue when/if the plugin finds a problematic field? |
As an example:
Updated version:
I would like the updated version to show and error as it has added a required field saying something like: |
I would like to use protolock with a plugin that I plan to use to verify custom logic in my .proto files. Specifically, for some of our RPC's we have an internal way of decorating them as "Incubating" (under development) and therefor we want to have them skipped when doing validation as they may be in flux a bit. My intention was to mark each of these RPC's with a "@protolock:skip" comment and make a rule that if protolock finds an RPC with the "Incubating" tag to make a warning for it.
But I noticed that RPC's don't have Comments right now. Was there any plan to add support for this? Or should I go ahead with adding support for this myself?
The text was updated successfully, but these errors were encountered: