mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 16:44:42 +04:00
Allow global core.hooksPath via --allow-global-hooks
This commit is contained in:
parent
e2c6a822c7
commit
f67f64306b
2 changed files with 14 additions and 1 deletions
|
|
@ -278,6 +278,13 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|||
'or exit with a failure code.'
|
||||
),
|
||||
)
|
||||
install_parser.add_argument(
|
||||
'--allow-global-hooks', action='store_true',
|
||||
help=(
|
||||
'Whether to allow installation of hooks if core.hooksPath '
|
||||
'is configured in the global git configuration.'
|
||||
),
|
||||
)
|
||||
|
||||
install_hooks_parser = _add_cmd(
|
||||
'install-hooks',
|
||||
|
|
@ -399,6 +406,7 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|||
overwrite=args.overwrite,
|
||||
hooks=args.install_hooks,
|
||||
skip_on_missing_config=args.allow_missing_config,
|
||||
allow_global_hooks=args.allow_global_hooks,
|
||||
)
|
||||
elif args.command == 'init-templatedir':
|
||||
return init_templatedir(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue