-
Notifications
You must be signed in to change notification settings - Fork 38
STJ-23: BUGFIX: deprecation_tracker breaking with unknown keywords #157 #158
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?
STJ-23: BUGFIX: deprecation_tracker breaking with unknown keywords #157 #158
Conversation
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.
@julioalucero looks good to me 👍🏼
(spoke too soon)
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.
Once you've addressed my one comment, please add an entry to the CHANGELOG
lib/deprecation_tracker.rb
Outdated
super(*messages, **keyword_args, **kwargs) | ||
rescue ArgumentError | ||
super(*messages, **keyword_args) | ||
end |
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.
@julioalucero if you know when the signature of the method changed, it would be best to use if/else vs. begin/rescue
@etagwerker, adding the changelog like this is ok? 99576c2 |
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.
@julioalucero You can add a line like this one to the CHANGELOG and we should be all good to go: 3d35c23#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR4
@etagwerker added! Thanks for the review! |
STJ-23: BUGFIX: deprecation_tracker breaking with unknown keywords
Description
BUGFIX: Prevent DeprecationTracker from crashing when receiving unknown keyword arguments.
In certain environments (e.g. when using sass-embedded), the warn method receives unexpected keyword arguments such as :deprecation, :span, or :stack. Previously, these unrecognized keywords would raise an ArgumentError and interrupt execution. This patch safely handles unknown keyword arguments while preserving known ones.
Motivation and Context
Fixes #152 — DeprecationTracker was breaking during setup in projects using sass-embedded due to unhandled keyword arguments in warn.
This update ensures that warn forwards all known and unknown keyword arguments safely to super, and gracefully falls back to known keywords if the parent method does not accept extras.
How Has This Been Tested?
Screenshots:
I will abide by the code of conduct