Skip to content
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

Style/RescueModifier redundant correction #8507

Closed
marcandre opened this issue Aug 10, 2020 · 0 comments · Fixed by #8550
Closed

Style/RescueModifier redundant correction #8507

marcandre opened this issue Aug 10, 2020 · 0 comments · Fixed by #8550
Labels

Comments

@marcandre
Copy link
Contributor

I got this auto-correction:

-        Ext::RegexpNode.parsed_cache[str] ||= (Regexp::Parser.parse(str) rescue nil)
+        Ext::RegexpNode.parsed_cache[str] ||= begin
+                                                begin
+                                                 Regexp::Parser.parse(str)
+                                                rescue StandardError
+                                                  nil
+                                               end
+                                              end

There's a redundant begin-end pair...

@bbatsov bbatsov added the bug label Aug 10, 2020
dmytro-savochkin pushed a commit to dmytro-savochkin/rubocop that referenced this issue Aug 16, 2020
koic added a commit that referenced this issue Aug 16, 2020
[Fix #8507] Fix Style/RescueModifier to handle parentheses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants