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
case
I get this as an violation, but I don't think it should be:
case columns.size when 0 fail ArgumentError, 'No columns specified for Query#pluck' when 1 column = columns[0] query.map { |row| row[column] } else query.map do |row| columns.map do |column| row[column] end end end
The violation is for the columns.map do |column| in the else, but the column variable is in the other branch of the case. Valid?
columns.map do |column|
else
column
The text was updated successfully, but these errors were encountered:
This is a duplicate of #1518 because this is another situation in which ruby and rubocop report the same problem.
ruby
rubocop
/tmp$ ruby -wc shadow2.rb shadow2.rb:9: warning: shadowing outer local variable - column Syntax OK /tmp$ rubocop -f s shadow2.rb == shadow2.rb == W: 9: 21: Shadowing outer local variable - column. 1 file inspected, 1 offense detected
Sorry, something went wrong.
Cool, thanks for rubocop!
No branches or pull requests
I get this as an violation, but I don't think it should be:
The violation is for the
columns.map do |column|
in theelse
, but thecolumn
variable is in the other branch of thecase
. Valid?The text was updated successfully, but these errors were encountered: