We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When auto correcting this:
def method begin do_some_stuff rescue # rubocop:disable Lint/RescueException end end
Rubocop produces the following output:
Offenses: rbfail_repro.rb:2:3: C: [Corrected] Style/RedundantBegin: Redundant begin block detected. begin ^^^^^ rbfail_repro.rb:3:8: E: unexpected token kEND rescue end ^^^ rbfail_repro.rb:4:10: W: Unnecessary disabling of Lint/RescueException. rescue # rubocop:disable Lint/RescueException ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
And the file is left looking like this, which as you can see is not valid:
def method do_some_stuff rescue end
Extra notes
=> e
It does work if there's any content in the rescue (with or without the comment) and when there's no comment present.
The text was updated successfully, but these errors were encountered:
Confirmed as a bug. I'll try to fix it.
Sorry, something went wrong.
f34cfa1
Merge pull request #1979 from jonas054/1964_redundant_begin_comment
4e120a8
[Fix #1964] Simplify RedundantBegin#autocorrect
Remove obsolete constants; fix code mangled by known error in rubocop (…
8865a98
…rubocop/rubocop#1964).
jonas054
No branches or pull requests
When auto correcting this:
Rubocop produces the following output:
And the file is left looking like this, which as you can see is not valid:
Extra notes
=> e
(or equivalent) after the rescue (assuming there's a trailing comment afterwards)It does work if there's any content in the rescue (with or without the comment) and when there's no comment present.
The text was updated successfully, but these errors were encountered: