Skip to content
Latchkey

pre-commit "Hook id ... not present in repo" in CI

pre-commit checked the hook repo manifest at your pinned rev and the id you referenced is not defined there. A typo, a renamed hook, or a rev that predates the hook is the cause.

What this error means

The run fails with "Hook id <id> not present in repository <repo>" before running, listing the ids the repo does provide.

pre-commit
An error has occurred: InvalidConfigError:
Hook id `black-formatter` not present in repository https://github.com/psf/black
=> Available hook ids: black, black-jupyter

Common causes

The hook id is misspelled or renamed

The id in the config does not match any id the repo publishes at the pinned rev; the manifest lists the valid ones.

The rev predates the hook

You pinned an older rev where that hook id did not yet exist, so it is not in the manifest.

How to fix it

Use a valid hook id

  1. Read the "Available hook ids" list in the error.
  2. Correct the id in your config to a published one.
  3. Bump rev if the hook was added in a newer release.
.pre-commit-config.yaml
- repo: https://github.com/psf/black
  rev: 24.4.2
  hooks:
    - id: black

Validate the config early

Run the validator so an unknown id fails fast with the valid list.

Terminal
pre-commit validate-config .pre-commit-config.yaml

How to prevent it

  • Copy hook ids from the repo README, do not guess.
  • Bump rev when adopting a newly added hook.
  • Run pre-commit validate-config in CI.

Frequently asked questions

What causes ""not present in repo""?
The id in the config does not match any id the repo publishes at the pinned rev; the manifest lists the valid ones.
How do I fix "not present in repo"?
Use a valid hook id

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card