Merge pull request #585 from pre-commit/uninstall_commit_msg

Allow commit-msg hooks to be uninstalled
This commit is contained in:
Anthony Sottile 2017-08-10 23:55:56 -04:00 committed by GitHub
commit cb8fb8c7c8

View file

@ -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.',