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
Layout/RescueEnsureAlignment incorrect behaviour when used as assignment #6918
Comments
Should probably behave in the same way as |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
This bot makes no sense. Why are you closing legitimate issues? To create to appearance that the project is maintained? If you have lots of bugs and nobody's fixing them, then you should have a high issue count. |
I have a similar example of bad output but not from assignment: coerce_input(lambda do |value, _ctx|
URI(value)
rescue URI::InvalidURIError
nil
end)
# Was autocorrected to:
coerce_input(lambda do |value, _ctx|
URI(value)
rescue URI::InvalidURIError
nil
end) |
I'm still seeing this. I agree with @rhys-vdw that it should have an option similar to the |
Agree with the previous commentators, this is burning us too, even in 0.75.1. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
FYI issue is still there |
…eEnsureAlignment
There's now Layout/BeginEndAlignment which, when enabled, should make the examples given here be flagged and/or corrected correctly. |
via #7531 (comment) I'm curious if this fix extends to cases with private memoize def do_something
"Something"
rescue NameError
nil
end but without private def do_something
"Something"
rescue NameError
nil
end |
The originally reported expected behavior is now the actual behavior with default configuration. Closing this issue. |
Layout/RescueEnsureAlignment
does not support assignmentExpected behavior
Should consider indentation difference from first non-whitespace character in line containing
begin
.Actual behavior
(for actual use case, example is simplified)
Steps to reproduce the problem
Follow example.
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:The text was updated successfully, but these errors were encountered: