-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Closed
Copy link
Labels
T: bugSomething isn't workingSomething isn't working
Description
Describe the bug
When the pre-commit hook is installed and I commit, I get:
An error has occurred: InvalidManifestError:
==> File /home/martin/.cache/pre-commit/repolc31_gpb/.pre-commit-hooks.yaml
==> At Hook(id='black')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
To Reproduce
$ python --version
3.11.1
$ python -m venv venv
$ source venv/bin/activate
$ vim .pre-commit-config.yaml
# Add this:
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
$ echo "a = 'b'" > c.py
$ git init
$ git add .pre-commit-config.yaml c.py
$ pip install pre-commit
$ pre-commit install
$ pre-commit --version
pre-commit 3.5.0
$ git commit -m "Example"
The resulting error is:
An error has occurred: InvalidManifestError:
==> File /home/martin/.cache/pre-commit/repolc31_gpb/.pre-commit-hooks.yaml
==> At Hook(id='black')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
Expected behavior
A pre-commit fixes c.py
Environment
- Black's version: 23.11.0
- OS and Python version: Linux / Python 3.11.1
Additional context
Vassai, sevdog, rr-tomas-henriquez, robert-7, ankitgola005 and 3 moreeggplants and ierezell
Metadata
Metadata
Assignees
Labels
T: bugSomething isn't workingSomething isn't working