mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
support pre-merge-commit
This commit is contained in:
parent
bf68512e7d
commit
c699e255a1
6 changed files with 39 additions and 6 deletions
|
|
@ -26,6 +26,9 @@ LOCAL_REPO_VERSION = '1'
|
|||
VERSION = importlib_metadata.version('pre_commit')
|
||||
|
||||
# `manual` is not invoked by any installed git hook. See #719
|
||||
STAGES = ('commit', 'prepare-commit-msg', 'commit-msg', 'manual', 'push')
|
||||
STAGES = (
|
||||
'commit', 'merge-commit', 'prepare-commit-msg', 'commit-msg', 'manual',
|
||||
'push',
|
||||
)
|
||||
|
||||
DEFAULT = 'default'
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ class AppendReplaceDefault(argparse.Action):
|
|||
def _add_hook_type_option(parser):
|
||||
parser.add_argument(
|
||||
'-t', '--hook-type', choices=(
|
||||
'pre-commit', 'pre-push', 'prepare-commit-msg', 'commit-msg',
|
||||
'pre-commit', 'pre-merge-commit', 'pre-push',
|
||||
'prepare-commit-msg', 'commit-msg',
|
||||
),
|
||||
action=AppendReplaceDefault,
|
||||
default=['pre-commit'],
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ def _opts(stdin):
|
|||
fns = {
|
||||
'prepare-commit-msg': lambda _: ('--commit-msg-filename', sys.argv[1]),
|
||||
'commit-msg': lambda _: ('--commit-msg-filename', sys.argv[1]),
|
||||
'pre-merge-commit': lambda _: (),
|
||||
'pre-commit': lambda _: (),
|
||||
'pre-push': _pre_push,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue