From e67c1576e73a7e0d61d3fd54bbc962d90291cdde Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Thu, 24 Jul 2025 08:38:19 +0100 Subject: [PATCH] fix(pre-commit): support RUNFILES_MANIFEST_FILE We can't load a runfiles folder when `RUNFILES_MANIFEST_FILE` is set, as it won't be listed explicitly there. --- pre-commit/__main__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pre-commit/__main__.py b/pre-commit/__main__.py index dfd57fd..275eb9a 100644 --- a/pre-commit/__main__.py +++ b/pre-commit/__main__.py @@ -173,8 +173,7 @@ except KeyError: argv.insert(1, arg) # Patch our Bazel into the commands -bazel, *rest = runfile("pre-commit/pre-commit/bazel").glob("bazel*") -assert not rest, "extra unexpected Bazel runfiles" +bazel = runfile("pre-commit/pre-commit/bazel/bazel") @patch("pre_commit.lang_base:hook_cmd") @@ -187,8 +186,7 @@ def hook_cmd(func, *k, **kw): # Patch our `git` into `pre-commit` -git, *rest = runfile("pre-commit/pre-commit/git").glob("git*") -assert not rest, "extra unexpected `git` runfiles" +git = runfile("pre-commit/pre-commit/git/git") @patch("pre_commit.parse_shebang:normexe") -- GitLab