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

Revert "also ignore Gemfile in project" #2740

Merged
merged 2 commits into from Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion pre_commit/languages/ruby.py
Expand Up @@ -39,7 +39,6 @@ def get_env_patch(
('GEM_HOME', os.path.join(venv, 'gems')),
('GEM_PATH', UNSET),
('BUNDLE_IGNORE_CONFIG', '1'),
('BUNDLE_GEMFILE', os.devnull),
)
if language_version == 'system':
patches += (
Expand Down
7 changes: 4 additions & 3 deletions tests/languages/ruby_test.py
Expand Up @@ -123,8 +123,9 @@ def test_ruby_hook_language_version(tmp_path):
def test_ruby_with_bundle_disable_shared_gems(tmp_path):
workdir = tmp_path.joinpath('workdir')
workdir.mkdir()
# this Gemfile is missing `source`
workdir.joinpath('Gemfile').write_text('gem "lol_hai"\n')
# this needs a `source` or there's a deprecation warning
# silencing this with `BUNDLE_GEMFILE` breaks some tools (#2739)
workdir.joinpath('Gemfile').write_text('source ""\ngem "lol_hai"\n')
# this bundle config causes things to be written elsewhere
bundle = workdir.joinpath('.bundle')
bundle.mkdir()
Expand All @@ -134,5 +135,5 @@ def test_ruby_with_bundle_disable_shared_gems(tmp_path):
)

with cwd(workdir):
# `3.2.0` has new enough `gem` requiring `source` and reading `.bundle`
# `3.2.0` has new enough `gem` reading `.bundle`
test_ruby_hook_language_version(tmp_path)