Skip to content

Enable Style/For rubocop cop

Grzegorz Bizon requested to merge rubocop/enable-style-for-cop into master

Do not use for, unless you know exactly why. Most of the time iterators should be used instead. for is implemented in terms of each (so you're adding a level of indirection), but with a twist - for doesn't introduce a new scope (unlike each) and variables defined in its block will be visible outside it.

See #17478 (closed)

Merge request reports

Loading