Using this repository in your pre-commit config makes Black twice as fast.
pre-commit installs hooks by cloning the repo you specify and installing from source, as opposed to installing Black from PyPI.
However, Black uploads mypyc-accelerated extension modules to PyPI that make Black about twice as fast. Using this mirror in the repo field of your pre-commit config instead of https://github.com/psf/black tricks pre-commit into installing these prebuilt accelerated wheels instead, where possible.
The trick is very simple: just declare Black as a dependency of this fake black-pre-commit-mirror project. While pre-commit will install black-pre-commit-mirror from source, it will still install its dependencies from PyPI.
For example pre-commit
configs, please see the Black VCS integration docs