mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 10:16:52 +00:00
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:
commit
e37b2795ff
2 changed files with 2 additions and 1 deletions
|
|
@ -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}',
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 == (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue