Skip to content

[DOC] Deprecate ruby2_keywords in documentation - #18044

Merged
shugo merged 1 commit into
ruby:masterfrom
shugo:feature/deprecate-ruby2_keywords
Aug 6, 2026
Merged

[DOC] Deprecate ruby2_keywords in documentation#18044
shugo merged 1 commit into
ruby:masterfrom
shugo:feature/deprecate-ruby2_keywords

Conversation

@shugo

@shugo shugo commented Jul 24, 2026

Copy link
Copy Markdown
Member

Add documentation-only deprecation notices to Module#ruby2_keywords, main.ruby2_keywords, Proc#ruby2_keywords, Hash.ruby2_keywords_hash?, and Hash.ruby2_keywords_hash, as the first phase of the schedule proposed at https://bugs.ruby-lang.org/issues/22205.

Copilot AI review requested due to automatic review settings July 24, 2026 01:37

Copilot AI 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.

Pull request overview

This PR updates core documentation to add explicit deprecation notices for the ruby2_keywords-related APIs (Module / main / Proc / Hash helpers), aligning with the deprecation schedule proposed in https://bugs.ruby-lang.org/issues/22205.

Changes:

  • Add deprecation notice text to Module#ruby2_keywords and main.ruby2_keywords documentation.
  • Add deprecation notice text to Proc#ruby2_keywords documentation.
  • Add deprecation notice text to Hash.ruby2_keywords_hash? and Hash.ruby2_keywords_hash documentation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
vm_method.c Adds deprecation notes to the ruby2_keywords docs for modules and top-level.
proc.c Adds a deprecation note to Proc#ruby2_keywords documentation.
hash.c Adds deprecation notes to Hash helper APIs that inspect/apply the ruby2_keywords flag.
Comments suppressed due to low confidence (1)

hash.c:1949

  • Same wording issue as above: "one version after the ruby2_keywords mechanism" is grammatically incomplete and a little unclear. Consider explicitly stating that the +ruby2_keywords+ mechanism is removed first.
 *  Deprecated: will be removed in Ruby 4.5, one version after the
 *  ruby2_keywords mechanism.  See
 *  https://bugs.ruby-lang.org/issues/22205 for the schedule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hash.c
@shugo
shugo force-pushed the feature/deprecate-ruby2_keywords branch 2 times, most recently from 28a8eb0 to cba1c8e Compare July 24, 2026 01:53
Copilot AI review requested due to automatic review settings July 24, 2026 01:53
@shugo shugo changed the title Deprecate ruby2_keywords in documentation [DOC] Deprecate ruby2_keywords in documentation Jul 24, 2026

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

vm_method.c:3313

  • Same wording issue as Module#ruby2_keywords above: **kwargs by itself isn’t a full forwarding replacement, and “since 3.0” reads like a feature-availability claim. Consider pointing to ... or explicit *args, **kwargs, &block forwarding and describing it as working on Ruby 3.0+.
 *  Deprecated: will be removed in Ruby 4.4.  Use a keyword splat
 *  (<tt>**kwargs</tt>) or <tt>...</tt> argument forwarding instead;
 *  they work on all Ruby versions since 3.0.  See
 *  https://bugs.ruby-lang.org/issues/22205 for the schedule.

Comment thread vm_method.c Outdated
Comment thread proc.c Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 02:04
@shugo
shugo force-pushed the feature/deprecate-ruby2_keywords branch from cba1c8e to 07f13f1 Compare July 24, 2026 02:04

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@jeremyevans jeremyevans 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.

Looks good (pending Matz approval of course). Probably should update NEWS.md as well.

Comment thread vm_method.c Outdated
* ruby2_keywords(method_name, ...) -> nil
*
* Deprecated: will be removed in Ruby 4.4. Use <tt>...</tt> argument
* forwarding or explicit delegation (<tt>*args, **kwargs</tt>)

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 seems good. We could also mention anonymous delegation *, ** or add an rdoc reference to syntax/methods.rdoc, as that discusses the different types of delegations. However, I'm not sure that is worth it. I'm fine with this text as-is.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for your review. I've just added a reference to syntax/methods.rdoc, and removed the mention of specific delegation styles other than ..., because listing all styles may be too verbose.

Copilot AI review requested due to automatic review settings July 24, 2026 02:52
@shugo
shugo marked this pull request as ready for review July 24, 2026 02:54

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

vm_method.c:3316

  • Same as Module#ruby2_keywords docs above: prefer the existing RDoc style "Deprecated." (see vm_eval.c:2889), and keep a brief note that the method was introduced in Ruby 2.7 so callers supporting Ruby 2.6 and earlier should guard with respond_to?.
 *  Deprecated: will be removed in Ruby 4.4.  Use <tt>...</tt>
 *  {argument forwarding}[rdoc-ref:syntax/methods.rdoc@Argument+Forwarding]
 *  or other delegation styles instead; they work correctly on Ruby 3.0
 *  and later.  See https://bugs.ruby-lang.org/issues/22205 for the
 *  schedule.
 *

hash.c:1950

  • Same as Hash.ruby2_keywords_hash?: prefer the standard RDoc style "Deprecated." (see vm_eval.c:2889) instead of "Deprecated:".
 *  Deprecated: will be removed in Ruby 4.5, one version after the
 *  removal of the ruby2_keywords mechanism.  See
 *  https://bugs.ruby-lang.org/issues/22205 for the schedule.
 *

Comment thread vm_method.c
Comment thread proc.c
Comment thread hash.c
@shugo

shugo commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

Looks good (pending Matz approval of course). Probably should update NEWS.md as well.

Thanks!
I've added a NEWS entry. I'll squash the commits after your review.

@shugo
shugo force-pushed the feature/deprecate-ruby2_keywords branch from 6a7dd72 to 26c9307 Compare July 29, 2026 05:55
Add documentation-only deprecation notices to Module#ruby2_keywords,
main.ruby2_keywords, Proc#ruby2_keywords, Hash.ruby2_keywords_hash?,
and Hash.ruby2_keywords_hash, as the first phase of the schedule
proposed at https://bugs.ruby-lang.org/issues/22205.
@shugo
shugo force-pushed the feature/deprecate-ruby2_keywords branch from 26c9307 to 1c71794 Compare July 29, 2026 05:56
@shugo
shugo merged commit 1d9b129 into ruby:master Aug 6, 2026
59 checks passed
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.

3 participants