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

Introduce BundlerSetupInTests cop #18

Merged
merged 4 commits into from Aug 23, 2020
Merged

Introduce BundlerSetupInTests cop #18

merged 4 commits into from Aug 23, 2020

Conversation

utkarsh2102
Copy link
Owner

This PR adds a new cop, namely, BundlerSetupInTests.
Having "bundler/setup" inside tests directory doesn't make
much sense. On the other hand, it becomes a problem
for downstream as they constantly have to keep patching
this from all the libraries.

cf: rubygems/rubygems#3791:

If you run bundle exec rspec, it's redundant. If on the
other hand, you run rspec, it might be too late and the
wrong version might be already activated.

This cop flags `require "bundler/setup"` calls if
they're inside the tests directory (either test,
tests, spec, or specs).

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
Update documentation to include a good and
a bad example. And also update the docs/.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
Copy link
Collaborator

@terceiro terceiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

None yet

2 participants