A framework for managing and maintaining multi-language pre-commit hooks.
Find a file
Noah Pendleton 451e042835 Permit installing to core.hooksPath if within repo
### Summary

There's [several
threads](https://github.com/pre-commit/pre-commit/issues?q=is%3Aissue+core+hooksPath+is%3Aclosed)
around using pre-commit with global git hooks directories, but I didn't
see anything around setting `core.hooksPath` to a directory within the
repo, as the `husky` tool does.

This patch adds support for installing/uninstalling pre-commit when
`core.hooksPath` references a path within the git repo.

 ### Testing

- add a couple of simple tests
- a repo with core.hooksPath set within the repo, install/uninstall does
  the right thing
- a repo with core.hooksPath set to `../hooks`, install/uninstall fails
- a repo with core.hooksPath unset, install/uninstall works as before
2021-08-05 13:02:19 -04:00
.github Add link to GitHub Sponsors + Open Collective 2020-11-19 17:13:02 -08:00
pre_commit Permit installing to core.hooksPath if within repo 2021-08-05 13:02:19 -04:00
testing Expose local branch ref as an environment variable 2021-06-19 18:18:14 +02:00
tests Permit installing to core.hooksPath if within repo 2021-08-05 13:02:19 -04:00
.gitignore add initial dotnet support 2020-09-27 15:04:35 -07:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate 2021-08-02 18:01:06 +00:00
.pre-commit-hooks.yaml fix casing in .pre-commit-hooks.yaml 2021-07-03 11:14:05 -07:00
azure-pipelines.yml Update azure-pipelines template repositories 2021-04-08 19:22:17 -07:00
CHANGELOG.md v2.13.0 2021-05-21 14:04:43 -07:00
CONTRIBUTING.md Add foor missing required dependencies in CONTRIBUTING.md 2020-06-12 18:38:44 +02:00
LICENSE MIT 2014-06-05 08:57:40 -07:00
README.md Add pre-commit.ci 2020-10-26 16:11:27 -07:00
requirements-dev.txt make an exe stub for windows 2020-09-28 18:37:10 -07:00
setup.cfg stricter mypy settings 2021-06-21 19:15:37 -07:00
setup.py Migrate setup.py to setup.cfg declarative metadata 2019-02-27 22:12:03 -08:00
tox.ini add initial dotnet support 2020-09-27 15:04:35 -07:00

Build Status Azure DevOps coverage pre-commit.ci status

pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

For more information see: https://pre-commit.com/