mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04: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:
parent
0e851bdf75
commit
1b435f1f1f
4 changed files with 83 additions and 2 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue