-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 2.5 assigned block rescue alignment #6437
Conversation
90090b8
to
dff0e52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, you need to add a link to your GH handle name at the end of the CHANGELOG.md
file to make the test pass.
There is also an edge case that I think isn't covered by this patch but TBH I'm not even sure what would be the right syntax
if a = something do
test
rescue => e
puts 'hello'
end; end
5ae32a1
to
52bcd2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙇
52bcd2d
to
a7e28b7
Compare
Fix Ruby 2.5 Layout/RescueEnsureAlignment error on assigned blocks.
a7e28b7
to
3df6685
Compare
Thanks! |
… on assigned begin-end We were missing some test cases for this cop, and accidentally introduced a regression in rubocop#6437. This change adds a relevant test case and fixes the issue.
Fixes #6433.
Currently,
Layout/RescueEnsureAlignment
rejects blocks withrescue
s that are assigned to a variable. In Ruby 2.5, this is valid:Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
rake default
. It executes all tests and RuboCop for itself, and generates the documentation.