Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03ac3b0

Browse files
authored
Merge pull request #981 from tristan0x/fix/infinite-process-recursion
Do not run legacy script again when this is the one being executed
2 parents 2fbe359 + bbc3130 commit 03ac3b0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pre_commit/resources/hook-tmpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ def _norm_exe(exe):
4949

5050

5151
def _run_legacy():
52+
if __file__.endswith('.legacy'):
53+
raise SystemExit(
54+
"bug: pre-commit's script is installed in migration mode\n"
55+
'run `pre-commit install -f --hook-type {}` to fix this\n\n'
56+
'Please report this bug at '
57+
'https://github.com/pre-commit/pre-commit/issues'.format(
58+
HOOK_TYPE,
59+
),
60+
)
61+
5262
if HOOK_TYPE == 'pre-push':
5363
stdin = getattr(sys.stdin, 'buffer', sys.stdin).read()
5464
else:

0 commit comments

Comments
 (0)