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
Consider this code:
array.each do |_item| 42 end
Rubocop should emit a Lint/Void for the second line.
Lint/Void
Rubocop considers this code valid.
master, or 0.52
The following code is linted as expected, until the second int literal is removed:
array.each do |_item| 42 42 end
The text was updated successfully, but these errors were encountered:
array.each do |_item| 42 end array.each do |_item| 42 42 end
$ ruby-parse test.rb (begin (block (send (send nil :array) :each) (args (procarg0 :_item)) (int 42)) (block (send (send nil :array) :each) (args (procarg0 :_item)) (begin (int 42) (int 42))))
When a block body has one sentence, it does not have a begin node. The cop's checks begin and kwbegin node only, so the cop can't catch it now. https://github.com/bbatsov/rubocop/blob/031b29b495ad435dc69172fb7603042894faae53/lib/rubocop/cop/lint/void.rb#L82-L85
begin
kwbegin
Sorry, something went wrong.
f6da8f8
No branches or pull requests
Consider this code:
Expected behavior
Rubocop should emit a
Lint/Void
for the second line.Actual behavior
Rubocop considers this code valid.
RuboCop version
master, or 0.52
Notes
The following code is linted as expected, until the second int literal is removed:
The text was updated successfully, but these errors were encountered: