Skip to content

Commit bfe1a72

Browse files
authored
Merge pull request #2740 from pre-commit/gem-file-bleh
Revert "also ignore Gemfile in project"
2 parents 9868b1a + 1129e7d commit bfe1a72

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pre_commit/languages/ruby.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def get_env_patch(
3939
('GEM_HOME', os.path.join(venv, 'gems')),
4040
('GEM_PATH', UNSET),
4141
('BUNDLE_IGNORE_CONFIG', '1'),
42-
('BUNDLE_GEMFILE', os.devnull),
4342
)
4443
if language_version == 'system':
4544
patches += (

tests/languages/ruby_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ def test_ruby_hook_language_version(tmp_path):
123123
def test_ruby_with_bundle_disable_shared_gems(tmp_path):
124124
workdir = tmp_path.joinpath('workdir')
125125
workdir.mkdir()
126-
# this Gemfile is missing `source`
127-
workdir.joinpath('Gemfile').write_text('gem "lol_hai"\n')
126+
# this needs a `source` or there's a deprecation warning
127+
# silencing this with `BUNDLE_GEMFILE` breaks some tools (#2739)
128+
workdir.joinpath('Gemfile').write_text('source ""\ngem "lol_hai"\n')
128129
# this bundle config causes things to be written elsewhere
129130
bundle = workdir.joinpath('.bundle')
130131
bundle.mkdir()
@@ -134,5 +135,5 @@ def test_ruby_with_bundle_disable_shared_gems(tmp_path):
134135
)
135136

136137
with cwd(workdir):
137-
# `3.2.0` has new enough `gem` requiring `source` and reading `.bundle`
138+
# `3.2.0` has new enough `gem` reading `.bundle`
138139
test_ruby_hook_language_version(tmp_path)

0 commit comments

Comments
 (0)