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
I have this line of code that counts the number of lines in a file
File.foreach(filename).reduce(0) { |a, e| a + 1 }
but I get complaints from the Lint/UnusedBlockArgument cop.
Lint/UnusedBlockArgument
W: Lint/UnusedBlockArgument: Unused block argument - e. If it's necessary, use _ or _e as an argument name to indicate that it won't be used.
So I change it to
File.foreach(filename).reduce(0) { |a, _e| a + 1 }
but now the Style/SingleLineBlockParams cop complains...
Style/SingleLineBlockParams
C: Style/SingleLineBlockParams: Name reduce block params |a, e|.
Maybe the block param names should not be enforced if they start with an underscore?
The text was updated successfully, but these errors were encountered:
374fbc6
Merge pull request #1469 from jonas054/1466_unused_reduce_args
7a6dc7f
[Fix #1466] Allow underscored parameters in SingleLineBlockParams
Thanks @jonas054 !
Sorry, something went wrong.
No branches or pull requests
I have this line of code that counts the number of lines in a file
but I get complaints from the
Lint/UnusedBlockArgument
cop.So I change it to
but now the
Style/SingleLineBlockParams
cop complains...Maybe the block param names should not be enforced if they start with an underscore?
The text was updated successfully, but these errors were encountered: