Open dgollahon opened 5 years ago
I think both would be nice to have. I'd argue that even for shared_*
, it should only happen when passing a flag, though.
Right now rspectre
is a zero config tool that finds/removes clearly wrong things, and that makes it refreshingly straightforward to use and to convince people of "accepting" its suggestions, compared to e.g. rubocop.
A shared example might also be created on purpose for the first use case if more use cases are very likely to come up in the future.
An option to detect single-use let
s (and let me turn them into local variables) would be neat.
After reading https://github.com/rubocop-hq/rubocop/pull/6786#issue-255200134, it occurred to me that
rspectre
could also count single-use setup. Forlet
s or similar this might be slightly aggressive (but maybe worth an optional flag), but it's almost certainly helpful forshared_*
tools. Inlining is almost always better when something is used ones.