mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Filtering of hooks for commit or push stages
This commit is contained in:
parent
e3a22061c5
commit
dd73ffd02f
8 changed files with 89 additions and 3 deletions
|
|
@ -87,7 +87,6 @@ def main(argv=None):
|
|||
run_parser.add_argument(
|
||||
'--verbose', '-v', action='store_true', default=False,
|
||||
)
|
||||
|
||||
run_parser.add_argument(
|
||||
'--origin', '-o',
|
||||
help='The origin branch\'s commit_id when using `git push`',
|
||||
|
|
@ -101,6 +100,10 @@ def main(argv=None):
|
|||
help='Allow an unstaged config to be present. Note that this will'
|
||||
'be stashed before parsing unless --no-stash is specified'
|
||||
)
|
||||
run_parser.add_argument(
|
||||
'--hook-stage', choices=('commit', 'push'), default='commit',
|
||||
help='The stage during which the hook is fired e.g. commit or push'
|
||||
)
|
||||
run_mutex_group = run_parser.add_mutually_exclusive_group(required=False)
|
||||
run_mutex_group.add_argument(
|
||||
'--all-files', '-a', action='store_true', default=False,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue