hotfix: the user may be define an extra arguments for a removed hook

This commit is contained in:
Pedro Calleja 2020-05-18 21:27:24 -05:00 committed by Anthony Sottile
parent 37d0e19fd8
commit 926208fb31
2 changed files with 2 additions and 1 deletions

View File

@ -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}',
)

View File

@ -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 == (