Skip to content

Commit 926208f

Browse files
pedrocallejaasottile
authored andcommitted
hotfix: the user may be define an extra arguments for a removed hook
1 parent 37d0e19 commit 926208f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pre_commit_hooks/removed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def main(argv: Optional[Sequence[str]] = None) -> int:
77
argv = argv if argv is not None else sys.argv[1:]
8-
hookid, new_hookid, url = argv
8+
hookid, new_hookid, url = argv[:3]
99
raise SystemExit(
1010
f'`{hookid}` has been removed -- use `{new_hookid}` from {url}',
1111
)

tests/removed_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def test_always_fails():
88
main((
99
'autopep8-wrapper', 'autopep8',
1010
'https://github.com/pre-commit/mirrors-autopep8',
11+
'--foo', 'bar',
1112
))
1213
msg, = excinfo.value.args
1314
assert msg == (

0 commit comments

Comments
 (0)