Current pre-commit version no longer works with latest hooks
Closed this issue · 0 comments
alyssadai commented
pre-commit run
locally now gives the following error:
[INFO] Initializing environment for https://github.com/psf/black.
An error has occurred: InvalidManifestError:
==> File C:\Users\adai\.cache\pre-commit\repol_is_t8k\.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
This is happening because there was a change pre-commit v3.2.0 that resulted in some repos changing their hook syntax, e.g. psf/black#3940. Now that we have pre-commit.ci auto-updating all hooks, our (older) pre-commit version has become incompatible with the latest hooks.
See also:
- https://pre-commit.com/#confining-hooks-to-run-at-certain-stages
- pre-commit/pre-commit#3068 (comment)
- psf/black#4065
To fix
- Easiest way would be to upgrade pre-commit to the latest version