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
Style/TrailingUnderscoreVariable
When this cop encounters destructuring code like:
_, *rest, _ = *arr
it incorrectly marks the trailing _ as an offense, but this is needed to indicate how many tail elements we want to drop when destructuring.
_
RuboCop does not register an offense.
C: Style/TrailingUnderscoreVariable: Do not use trailing _s in parallel assignment. Prefer _, *rest, = *arr. _, *rest, _ = *arr ^^
Run bundle exec rubocop --only Style/TrailingUnderscoreVariable, on:
bundle exec rubocop --only Style/TrailingUnderscoreVariable
Include the output of rubocop -V:
rubocop -V
$ rubocop -V 0.42.0 (using Parser 2.3.1.2, running on ruby 2.3.0 x86_64-darwin15)
The text was updated successfully, but these errors were encountered:
[Fix rubocop#3380] Fix false positive in `Style/TrailingUnderscoreVar…
9702a25
…iable` cop This cop would report offenses on destructuring code like: ``` _, *rest, _ = *arr ``` This change fixes that.
78de463
166e626
…iable` cop (rubocop#3381) This cop would report offenses on destructuring code like: ``` _, *rest, _ = *arr ``` This change fixes that.
No branches or pull requests
When this cop encounters destructuring code like:
it incorrectly marks the trailing
_
as an offense, but this is needed to indicate how many tail elements we want to drop when destructuring.Expected behavior
RuboCop does not register an offense.
Actual behavior
Steps to reproduce the problem
Run
bundle exec rubocop --only Style/TrailingUnderscoreVariable
, on:RuboCop version
Include the output of
rubocop -V
:The text was updated successfully, but these errors were encountered: