mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add: post-rewrite hook support
This commit is contained in:
parent
3bab1514c3
commit
4cd8b364dd
9 changed files with 70 additions and 1 deletions
|
|
@ -69,6 +69,7 @@ def _add_hook_type_option(parser: argparse.ArgumentParser) -> None:
|
|||
'-t', '--hook-type', choices=(
|
||||
'pre-commit', 'pre-merge-commit', 'pre-push', 'prepare-commit-msg',
|
||||
'commit-msg', 'post-commit', 'post-checkout', 'post-merge',
|
||||
'post-rewrite',
|
||||
),
|
||||
action=AppendReplaceDefault,
|
||||
default=['pre-commit'],
|
||||
|
|
@ -146,6 +147,13 @@ def _add_run_options(parser: argparse.ArgumentParser) -> None:
|
|||
'squash merge'
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
'--rewrite-command',
|
||||
help=(
|
||||
'During a post-rewrite hook, specifies the command that invoked '
|
||||
'the rewrite'
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def _adjust_args_and_chdir(args: argparse.Namespace) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue