Repository navigation
Mark deprecated types and fields with annotation #123
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to detect when deprecated members have been referenced, and emit the directive automatically? It's unfortunate that we have to add in a plugin option for this.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in a great way - the biggest reason is this is a string printer with a bit of pythonic functionality, not an AST-builder etc type of thing. So a user can just string interpolate some reference (e.g., connect-py generates a full function signature with a potentially deprecated RPC method as a single string) and we have no way of knowing that. On top of that, without an AST we can't determine if a deprecated thing is being referenced or just declared, the latter would cause a lint error on unused suppression. And while types may be closer to being detectable, fields are even harder.
Our of curiosity, FWIU protobuf-es generates
@deprecated, I'm guessing it is checked by eslint etc so suppressing lint globally (similar to how we suppress ruff globally) handles it, here it's type-checker so we need type-checker suppression here, with unused suppressions themselves flagged.