[#Fix 334] Make body consistent for RescueNode, EnsureNode and KeywordBeginNode#336
Draft
dvandersluis wants to merge 1 commit into
Draft
[#Fix 334] Make body consistent for RescueNode, EnsureNode and KeywordBeginNode#336dvandersluis wants to merge 1 commit into
body consistent for RescueNode, EnsureNode and KeywordBeginNode#336dvandersluis wants to merge 1 commit into
Conversation
Member
Author
|
I'm not sure when the plan for the next major version is, but getting this kicked off now so it's ready for whenever that'll be. |
dvandersluis
commented
Nov 11, 2024
| # Returns an the ensure branch in the exception handling statement. | ||
| # | ||
| # @return [Node, nil] the body of the ensure branch. | ||
| def branch |
Member
Author
There was a problem hiding this comment.
I used branch for the method to get the ensure branch body, similiar to how we have branches for RescueNode.
9f51d4c to
5c5d4ae
Compare
5c5d4ae to
0938ae7
Compare
Member
Author
|
I've gone through every rubocop-* repo in the @rubocop org. As far as I can see, only rubocop/rubocop and rubocop/rubocop-minitest are affected by this change. For tracking purposes, here are the PRs to update |
0938ae7 to
436c38b
Compare
a3d5b4a to
c045d3d
Compare
…`KeywordBeginNode`.
c045d3d to
c34aed5
Compare
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.
Renames
EnsureNode#bodyto#branch, and adds a new#bodymethod in line withRescueNodeandKeywordBeginNodeto return the body of code being executed before exception handling. For all three node types,bodywill now return a single node (which may be abegin/kwbeginnode containing multiple nodes).This is a breaking change, as existing code that calls
EnsureNode#bodywill need to be updated.Fixes #334.