-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Performance/RedundantBlockCall is yield when "yield" keyword is not applicable #2986
Comments
timnew
changed the title
Performance/RedundantBlockCall warns when yield is not applicable
Performance/RedundantBlockCall still complain when yield keyword is not applicable
Mar 26, 2016
timnew
changed the title
Performance/RedundantBlockCall still complain when yield keyword is not applicable
Performance/RedundantBlockCall is yield when "yield" keyword is not applicable
Mar 26, 2016
This is also present on other code that it cannot apply to: def verify_destination(name, destination, ¬ify)
notify ||= ->(message) { warn message }
destination.dig(:path) ||
notify.("Destination #{name} invalid: No path present")
destination.dig(:credentials, :provider) ||
notify.("Destination #{name} invalid: No provider present")
end I cannot def foo(&block)
block ||= ->(m) { warn m }
yield "hello"
end
foo
LocalJumpError: no block given (yield) |
9 tasks
bbatsov
pushed a commit
that referenced
this issue
Jun 19, 2016
Neodelf
pushed a commit
to Neodelf/rubocop
that referenced
this issue
Oct 15, 2016
…overridden blocks (rubocop#3190)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have code described as following
Rubocop warns on the
block.call
, and ask to useyield
rather thanProc#call
.But in fact,
yield
is not applicable here sinceyield
doesn't accept block.So I think
Rubocop
should check whether another block is passed beforecomplains
Performance/RedundantBlockCall
RuboCop version
The text was updated successfully, but these errors were encountered: