Skip to content

Fix "Using the last argument as keyword parameters is deprecated" - #49447

Merged
Hamms merged 15 commits into
stagingfrom
update-last-arg-keyword-params
Jan 5, 2023
Merged

Fix "Using the last argument as keyword parameters is deprecated"#49447
Hamms merged 15 commits into
stagingfrom
update-last-arg-keyword-params

Conversation

@Hamms

@Hamms Hamms commented Dec 12, 2022

Copy link
Copy Markdown
Contributor

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:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Hamms added 9 commits December 6, 2022 12:13
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/
@Hamms
Hamms force-pushed the update-last-arg-keyword-params branch from 29b345e to abde47a Compare December 13, 2022 22:36
@Hamms
Hamms marked this pull request as ready for review January 3, 2023 23:24
@Hamms
Hamms requested review from a team January 3, 2023 23:24

@pablo-code-org pablo-code-org left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me!

This is a great thing for that super long output we already have.

@Hamms
Hamms merged commit 99ccddf into staging Jan 5, 2023
@Hamms
Hamms deleted the update-last-arg-keyword-params branch January 5, 2023 21:23
@Hamms Hamms added the Ruby Update Everything related to work to update the version of Ruby our codebase runs on label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ruby Update Everything related to work to update the version of Ruby our codebase runs on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants