-
Notifications
You must be signed in to change notification settings - Fork 48
Support automatic deprecation inheritance for enum members #899
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?
Support automatic deprecation inheritance for enum members #899
Conversation
When an attribute with enum type is deprecated enum members now automatically inherit the deprecated status. This eliminates the need to manually deprecate each enum member individually, reducing maintenance overhead and preventing inconsistencies. Fixes open-telemetry#878
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #899 +/- ##
=====================================
Coverage 77.9% 78.0%
=====================================
Files 76 76
Lines 5971 5995 +24
=====================================
+ Hits 4656 4680 +24
Misses 1315 1315 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@lmolkova Would you mind taking a look at this feature before we review the rust code? The idea is simple - deprecated is inherited down automatically instead of requiring users to do so manually. |
// Only inherit deprecation if member doesn't have explicit deprecation | ||
if member.deprecated.is_none() { | ||
// Inherit the parent's deprecation status | ||
member.deprecated = deprecated.clone(); |
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.
@rpotluri-f5 i think we need to extend this logic to be such that if the attribute deprecation reason is obsoleted, then it is cloned otherwise the enum member deprecation reason should be uncategorised, note/brief should be copied across and nothing else. This is to handle the fact that an attribute rename is different to a member rename as the renamed to have different targets.
Thanks for the contribution, @rpotluri-f5! |
Your explanation makes sense. I will pick another open item to contribute to. |
When an attribute with enum type is deprecated enum members now automatically inherit the deprecated status. This eliminates the need to manually deprecate each enum member individually, reducing maintenance overhead and preventing inconsistencies.
Fixes #878