Skip to content
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

Update KernelWarnTracker#warn signature to match Kernel#warn #82

Merged
merged 4 commits into from
Mar 3, 2023

Conversation

mateusdeap
Copy link
Member

Description

This fixes a bug that arises when we set up the deprecation tracker with a transform_message option that manipulates messages as if they were Strings.

Motivation and Context

Fixes #81

Although manipulating the messages as if they were Strings is expected, as of Ruby 2.5, calls to Kernel.warn, which we override, may be given an optional uplevel keyword argument. Since our override doesn't account for this in the signature, the keyword arg get's passed to the callback method as a Hash and will cause an error.

How Has This Been Tested?

This PR adds the appropriate test case

I will abide by the code of conduct

@mateusdeap mateusdeap requested a review from a team as a code owner February 6, 2023 13:47
@mateusdeap mateusdeap requested review from ashwinisukale and KostiantynPopovych and removed request for a team February 6, 2023 13:47
@mateusdeap mateusdeap requested review from etagwerker and removed request for KostiantynPopovych February 7, 2023 09:11
Copy link
Member

@etagwerker etagwerker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mateusdeap Looks good to me, thank you!

@etagwerker etagwerker merged commit 3eb41a2 into main Mar 3, 2023
@etagwerker etagwerker deleted the bug/fix-warn-override-signature branch March 3, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] KernelWarnTracker#warn signature is incorrect
2 participants