mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Allow commit-msg hooks to be uninstalled
This commit is contained in:
parent
49366f1c4a
commit
5491f8b5eb
1 changed files with 9 additions and 8 deletions
|
|
@ -45,6 +45,13 @@ def _add_config_option(parser):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _add_hook_type_option(parser):
|
||||||
|
parser.add_argument(
|
||||||
|
'-t', '--hook-type', choices=('pre-commit', 'pre-push', 'commit-msg'),
|
||||||
|
default='pre-commit',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main(argv=None):
|
def main(argv=None):
|
||||||
argv = argv if argv is not None else sys.argv[1:]
|
argv = argv if argv is not None else sys.argv[1:]
|
||||||
argv = [five.to_text(arg) for arg in argv]
|
argv = [five.to_text(arg) for arg in argv]
|
||||||
|
|
@ -75,10 +82,7 @@ def main(argv=None):
|
||||||
'in the config file.'
|
'in the config file.'
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
install_parser.add_argument(
|
_add_hook_type_option(install_parser)
|
||||||
'-t', '--hook-type', choices=('pre-commit', 'pre-push', 'commit-msg'),
|
|
||||||
default='pre-commit',
|
|
||||||
)
|
|
||||||
install_parser.add_argument(
|
install_parser.add_argument(
|
||||||
'--allow-missing-config', action='store_true', default=False,
|
'--allow-missing-config', action='store_true', default=False,
|
||||||
help=(
|
help=(
|
||||||
|
|
@ -103,10 +107,7 @@ def main(argv=None):
|
||||||
)
|
)
|
||||||
_add_color_option(uninstall_parser)
|
_add_color_option(uninstall_parser)
|
||||||
_add_config_option(uninstall_parser)
|
_add_config_option(uninstall_parser)
|
||||||
uninstall_parser.add_argument(
|
_add_hook_type_option(uninstall_parser)
|
||||||
'-t', '--hook-type', choices=('pre-commit', 'pre-push'),
|
|
||||||
default='pre-commit',
|
|
||||||
)
|
|
||||||
|
|
||||||
clean_parser = subparsers.add_parser(
|
clean_parser = subparsers.add_parser(
|
||||||
'clean', help='Clean out pre-commit files.',
|
'clean', help='Clean out pre-commit files.',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue