[DOC] Deprecate ruby2_keywords in documentation - #18044
Conversation
There was a problem hiding this comment.
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_keywordsandmain.ruby2_keywordsdocumentation. - Add deprecation notice text to
Proc#ruby2_keywordsdocumentation. - Add deprecation notice text to
Hash.ruby2_keywords_hash?andHash.ruby2_keywords_hashdocumentation.
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.
28a8eb0 to
cba1c8e
Compare
There was a problem hiding this comment.
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:
**kwargsby itself isn’t a full forwarding replacement, and “since 3.0” reads like a feature-availability claim. Consider pointing to...or explicit*args, **kwargs, &blockforwarding 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.
cba1c8e to
07f13f1
Compare
jeremyevans
left a comment
There was a problem hiding this comment.
Looks good (pending Matz approval of course). Probably should update NEWS.md as well.
| * 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>) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
*
Thanks! |
6a7dd72 to
26c9307
Compare
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.
26c9307 to
1c71794
Compare
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.