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

Incorrect case for Style/SafeNavigation #6915

Closed
AlexWayfer opened this issue Apr 9, 2019 · 1 comment · Fixed by #6959
Closed

Incorrect case for Style/SafeNavigation #6915

AlexWayfer opened this issue Apr 9, 2019 · 1 comment · Fixed by #6959

Comments

@AlexWayfer
Copy link
Contributor

Hello.

There is wrong behavior of Style/SafeNavigation cop.


Expected behavior

No offenses.

Actual behavior

Offense from Style/SafeNavigation.

Steps to reproduce the problem

@providers.find do |service|
  break service.lookup(lat, lng) if service
rescue ZoneNotFoundError, Net::OpenTimeout
  next
end

RuboCop version

$ [bundle exec] rubocop -V
0.67.2 (using Parser 2.6.2.1, running on ruby 2.5.5 x86_64-linux)
@rrosenblum
Copy link
Contributor

rrosenblum commented Apr 12, 2019

Thanks for submitting the issue. I have confirmed that this is a bug. The same issue would occur with return, next, and yield as well. It should be a straight forward fix, but I haven't dug through that code in a while.

rrosenblum added a commit to rrosenblum/rubocop that referenced this issue Apr 23, 2019
…modifier condition safe guarding a logic jump keyword
bbatsov pushed a commit that referenced this issue Apr 24, 2019
…r condition safe guarding a logic jump keyword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants