Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add --no-allow-missing-config option to init-templatedir #1539
Conversation
|
still seems a little odd, it's very unlikely that you'll never clone a repo without pre-commit |
|
I'm fine adding the option, let's remove the warning though |
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.
56bf3b4
to
1b435f1
Thanks! It's too bad you figured out I'm actually a dog, though. |
woof, woof woof! WOOF woof! |

The hook template created by
pre-commit init-templatediracts like it was installed bypre-commit install --allow-missing-config. That behavior makes sense for most people: if you're working with some repos that have pre-commit and some that don't, it's annoying to uninstall pre-commit from the repos that don't use it. However, for people trying to adopt a policy of using pre-commit in every repo, it's easier to catch repos that are missing the config if pre-commit fails hard.To support this special case, add a
--no-allow-missing-configoption to theinit-templatedircommand. When that option is set, create a template hook that fails in repos where the pre-commit config is missing.