neurobagel/api

Current pre-commit version no longer works with latest hooks

Closed this issue · 0 comments

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:

To fix

  • Easiest way would be to upgrade pre-commit to the latest version