Fix "Using the last argument as keyword parameters is deprecated" - #49447
Merged
Conversation
Minitest 5.16 made some improvements to the way keyword arguments are handled, which means we need to update a few implementations in reponse. https://github.com/minitest/minitest/blob/master/History.rdoc#label-5.16.0+-2F+2022-06-14 Also fixed a couple `Using the last argument as keyword parameters is deprecated` warnings
…re itself. Don't update this method call after all
As of Ruby 2.7, inferring keyword parameters by position is deprecated and starting in Ruby 3.0 automatic conversion between positional and keyword argumenets is entirely removed. This PR aims to update all existing violations of the new standard in our codebase, in preparation for an eventual update to Ruby 3.0. https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
To pick up the fix for keyword arguments warning in Ruby 2.7, added in CanCanCommunity/cancancan#612 https://github.com/CanCanCommunity/cancancan/blob/develop/CHANGELOG.md#310
To pick up fix for Ruby 2.7 named parameter warnings, added in minimagick/minimagick#496 https://github.com/minimagick/minimagick/releases
Hamms
force-pushed
the
update-last-arg-keyword-params
branch
from
December 13, 2022 22:36
29b345e to
abde47a
Compare
…ll otherwise treat the last parameter as kwargs
Hamms
marked this pull request as ready for review
January 3, 2023 23:24
pablo-code-org
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me!
This is a great thing for that super long output we already have.
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of Ruby 2.7, inferring keyword parameters by position is deprecated and starting in Ruby 3.0 automatic conversion between positional and keyword argumenets is entirely removed. This PR aims to update all existing violations of the new standard in our codebase, in preparation for an eventual update to Ruby 3.0.
Links
Testing story
My method for identifying instances of this warning in our codebase was to search the drone logs for instances of the warning, which means I am entirely relying on existing test coverage. We may want to look into doing some kind of one-off static code analysis of the whole codebase prior to the actual upgrade to Ruby 3.0; this PR is just going to focus on addressing active deprecation warnings.
PR Checklist: