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
Kernel.tap
Kernel.tap ignores the return value of the passed block. Rubocop should know about this.
The following code should emit a linting error, since it was clearly the programmer's intent to write a program that outputs 7:
7
a = 4.tap do |x| x = x + 3 x end puts a
However, the actual behavior is that Rubocop (from master) is completely fine with that code.
I think the fix is trivial, since rubocop does analysis like this for each already. Will open a PR soon
each
The text was updated successfully, but these errors were encountered:
2030c91
Merge pull request #5513 from untitaker/bugfix/5512-tap-as-void-conte…
068d38c
…xt-method [Fix #5512] Make Kernel#tap a void-context-method
No branches or pull requests
Kernel.tap
ignores the return value of the passed block. Rubocop should know about this.The following code should emit a linting error, since it was clearly the programmer's intent to write a program that outputs
7
:However, the actual behavior is that Rubocop (from master) is completely fine with that code.
I think the fix is trivial, since rubocop does analysis like this for
each
already. Will open a PR soonThe text was updated successfully, but these errors were encountered: