From 926208fb31c7f4b6e718e20fc1f5789fd74dc3df Mon Sep 17 00:00:00 2001 From: Pedro Calleja Date: Mon, 18 May 2020 21:27:24 -0500 Subject: [PATCH] hotfix: the user may be define an extra arguments for a removed hook --- pre_commit_hooks/removed.py | 2 +- tests/removed_test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pre_commit_hooks/removed.py b/pre_commit_hooks/removed.py index 9710b2d..60df096 100644 --- a/pre_commit_hooks/removed.py +++ b/pre_commit_hooks/removed.py @@ -5,7 +5,7 @@ from typing import Sequence def main(argv: Optional[Sequence[str]] = None) -> int: argv = argv if argv is not None else sys.argv[1:] - hookid, new_hookid, url = argv + hookid, new_hookid, url = argv[:3] raise SystemExit( f'`{hookid}` has been removed -- use `{new_hookid}` from {url}', ) diff --git a/tests/removed_test.py b/tests/removed_test.py index 83df164..d635eb1 100644 --- a/tests/removed_test.py +++ b/tests/removed_test.py @@ -8,6 +8,7 @@ def test_always_fails(): main(( 'autopep8-wrapper', 'autopep8', 'https://github.com/pre-commit/mirrors-autopep8', + '--foo', 'bar', )) msg, = excinfo.value.args assert msg == (