I am interested in adopting the pre-commit framework. I would like to create hooks for common errors that I tend make. For example, I want to:
- stop myself committing to a branch named "main" or "master" even in projects that have not (yet) adopted pre-commit
- use the correct Git persona (personal vs work) when committing
- confirm I have made a signed commit even in projects that have not (yet) adopted pre-commit or signing conventions
- ...and more
These hooks are likely not appropriate for inclusion in project-specific repos, so they should not be stored in $PROJECT/.pre-commit-config.yaml
. Additionally, I don't want to have to copy them into every single repo I clone.
Is there a local location (in $XDG_CONFIG_HOME maybe?) for a "universal" .pre-commit-config.yaml
?
(Ideally the solution should be compatible with projects that do define their own pre-commit config.)