pre-commit-hooks/pre_commit_hooks/removed.py

17 lines
390 B
Python
Raw Normal View History

from __future__ import annotations
2020-05-15 07:00:29 +08:00
import sys
from collections.abc import Sequence
2020-05-15 07:00:29 +08:00
def main(argv: Sequence[str] | None = None) -> int:
2020-05-15 07:00:29 +08:00
argv = argv if argv is not None else sys.argv[1:]
hookid, new_hookid, url = argv[:3]
2020-05-15 07:00:29 +08:00
raise SystemExit(
f'`{hookid}` has been removed -- use `{new_hookid}` from {url}',
)
if __name__ == '__main__':
raise SystemExit(main())