Merge pull request #487 from pedrocalleja/master

hotfix: the user may be define an extra arguments for a removed hook
This commit is contained in:
Anthony Sottile 2020-05-18 20:01:29 -07:00 committed by GitHub
commit e37b2795ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 == (