rubocop-rspec
rubocop-rspec copied to clipboard
RSpec/ScatteredLet autocorrect improvements
I have played recently with ScatteredLet autocorrects and noticed a couple of things.
First, it moves everything after the first let, which changes the order of lets. It would be better to move it after the last consecutive (non-offending let)
Also, it does not move comments - something that most likely applies to all cops that use the MoveNode helper. Note that this applies to inline comments, but also to comments directly before the node to be moved.