summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands/hook_impl.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 04:23:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-09-06 04:24:09 +0000
commit1968ada2d36e4508ef787e57f0e5f63214bcbad7 (patch)
tree69c01b5108b09faafa39e56ae48add8a2439f9db /pre_commit/commands/hook_impl.py
parentReleasing debian version 2.14.0-2. (diff)
downloadpre-commit-1968ada2d36e4508ef787e57f0e5f63214bcbad7.tar.xz
pre-commit-1968ada2d36e4508ef787e57f0e5f63214bcbad7.zip
Merging upstream version 2.15.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/commands/hook_impl.py')
-rw-r--r--pre_commit/commands/hook_impl.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pre_commit/commands/hook_impl.py b/pre_commit/commands/hook_impl.py
index c544167..90bb33b 100644
--- a/pre_commit/commands/hook_impl.py
+++ b/pre_commit/commands/hook_impl.py
@@ -78,6 +78,7 @@ def _ns(
commit_msg_filename: Optional[str] = None,
checkout_type: Optional[str] = None,
is_squash_merge: Optional[str] = None,
+ rewrite_command: Optional[str] = None,
) -> argparse.Namespace:
return argparse.Namespace(
color=color,
@@ -92,6 +93,7 @@ def _ns(
all_files=all_files,
checkout_type=checkout_type,
is_squash_merge=is_squash_merge,
+ rewrite_command=rewrite_command,
files=(),
hook=None,
verbose=False,
@@ -166,6 +168,7 @@ _EXPECTED_ARG_LENGTH_BY_HOOK = {
'pre-commit': 0,
'pre-merge-commit': 0,
'post-merge': 1,
+ 'post-rewrite': 1,
'pre-push': 2,
}
@@ -209,6 +212,8 @@ def _run_ns(
)
elif hook_type == 'post-merge':
return _ns(hook_type, color, is_squash_merge=args[0])
+ elif hook_type == 'post-rewrite':
+ return _ns(hook_type, color, rewrite_command=args[0])
else:
raise AssertionError(f'unexpected hook type: {hook_type}')