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

Detect single-use shared_{context,examples} (or other setup?) #24

Open
dgollahon opened this issue Feb 22, 2019 · 2 comments
Open

Detect single-use shared_{context,examples} (or other setup?) #24

dgollahon opened this issue Feb 22, 2019 · 2 comments

Comments

@dgollahon
Copy link
Owner

After reading rubocop/rubocop#6786 (comment), it occurred to me that rspectre could also count single-use setup. For lets or similar this might be slightly aggressive (but maybe worth an optional flag), but it's almost certainly helpful for shared_* tools. Inlining is almost always better when something is used ones.

@jaynetics
Copy link
Contributor

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.

@bquorning
Copy link
Contributor

An option to detect single-use lets (and let me turn them into local variables) would be neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants