mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-14 13:00:10 -06:00
add init-templatedir --no-allow-missing-config
Add a `--no-allow-missing-config` option to the `init-templatedir` command. Enable configuration of a Git template that requires newly cloned repos to have a `pre-commit` config.
This commit is contained in:
committed by
Anthony Sottile
parent
0e851bdf75
commit
1b435f1f1f
@@ -15,10 +15,15 @@ def init_templatedir(
|
||||
store: Store,
|
||||
directory: str,
|
||||
hook_types: Sequence[str],
|
||||
skip_on_missing_config: bool = True,
|
||||
) -> int:
|
||||
install(
|
||||
config_file, store, hook_types=hook_types,
|
||||
overwrite=True, skip_on_missing_config=True, git_dir=directory,
|
||||
config_file,
|
||||
store,
|
||||
hook_types=hook_types,
|
||||
overwrite=True,
|
||||
skip_on_missing_config=skip_on_missing_config,
|
||||
git_dir=directory,
|
||||
)
|
||||
try:
|
||||
_, out, _ = cmd_output('git', 'config', 'init.templateDir')
|
||||
|
||||
Reference in New Issue
Block a user