Skip to content
New issue

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

while and UselessAssignment #15

Open
pocke opened this issue Nov 12, 2017 · 0 comments
Open

while and UselessAssignment #15

pocke opened this issue Nov 12, 2017 · 0 comments
Labels

Comments

@pocke
Copy link
Contributor

pocke commented Nov 12, 2017

while cond
  x = 1 # これが UselessAssignment として検出されない
  x = 1
  p x
end

https://github.com/bbatsov/rubocop/blob/245155158db2d4e0d3d0da918d3e7f3bf6291e78/lib/rubocop/cop/variable_force.rb#L310

このへんを見ると、ループ内で使っている変数は問答無用で全部マークされている。

どうやって実装したらいいかは正直わからないので、ちゃんと調査する必要があると思います。

@pocke pocke added the bug label Nov 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant