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:
cat = Cat.new [1, 2, 3].map { |_i| cat.meow }
Should not register any offenses.
Rubocop registers Style/SymbolProc offense: [Correctable] Style/SymbolProc: Pass &:meow as an argument to map instead of a block.
[Correctable] Style/SymbolProc: Pass &:meow as an argument to map instead of a block.
With the -A option, it autocorrects to:
-A
cat = Cat.new [1, 2, 3].map(&:meow)
NOTE: this appears to be a regression because version 1.4.2 doesn't exhibit this behavior. Likely related to: #9232
1.6.1 (using Parser 2.7.2.0, rubocop-ast 1.3.0, running on ruby 2.4.5 x86_64-darwin19) - rubocop-minitest 0.10.1 - rubocop-performance 1.9.1 - rubocop-rails 2.9.1
The text was updated successfully, but these errors were encountered:
Thanks for the report. I don't think this was caused by #9232, but maybe by #9127? @dvandersluis would you like to check this out?
Sorry, something went wrong.
Sure thing!
[Fix rubocop#9257] Fix false positive for Style/SymbolProc when the…
Style/SymbolProc
3be6668
… block uses a variable from outside the block.
_
[Fix #9257] Fix false positive for Style/SymbolProc when the block …
65b3814
…uses a variable from outside the block.
Successfully merging a pull request may close this issue.
Consider:
Expected behavior
Should not register any offenses.
Actual behavior
Rubocop registers Style/SymbolProc offense:
[Correctable] Style/SymbolProc: Pass &:meow as an argument to map instead of a block.
With the
-A
option, it autocorrects to:RuboCop version
NOTE: this appears to be a regression because version 1.4.2 doesn't exhibit this behavior. Likely related to: #9232
The text was updated successfully, but these errors were encountered: