pre-commit: An error has occurred: InvalidManifestError
when i use pre-commit run --all-files i got this error
[INFO] Initializing environment for git@github.com:kobeTianSilk/py3-bundleb2b.git.
An error has occurred: InvalidManifestError:
=====> /Users/kobetian/.cache/pre-commit/repogfm2l6s7/.pre-commit-hooks.yaml does not exist
Check the log at /Users/kobetian/.cache/pre-commit/pre-commit.log
here is my code
default_language_version:
python: python3.7
default_stages: [commit, push]
repos:
- repo: git@github.com:kobeTianSilk/py3-bundleb2b.git
rev: 896b92dcdbf567c5c0197fc6575e0c8bf6d2b5b3
hooks:
- id: python-pylint
- id: python-isort
- id: autopep8
- id: black
language_version: python3.7
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (14 by maintainers)
I was running into this issue, and
rm -rf ~/.cache/pre-commit
followed by apre-commit install
fixed itI had the same issue and could resolve it in the same way. I think it was caused because the path to my home directory changed and pre-commit was still referring to the old path for some reason:
/Volumes/Home/blubb is the old path, /Users/jgosmann the new one.
Thanks @bagerard .
In the end I defaulted to using the docker image for the pre-commit cache — not ideal for image sizes, but saves enough time to make it worthwhile, and we can rely on a single approach for caching.
feel free to send a PR to the docs if they should be improved
On Thu, Dec 2, 2021, 5:03 PM Bastien Gérard @.***> wrote:
as the error says, you’re missing a
.pre-commit-hooks.yaml
in your repo