Autohooks#

Library for managing and writing git hooks in Python.

Looking for automatic formatting or linting, e.g., with black and pylint, while creating a git commit using a pure Python implementation? Welcome to autohooks!

Why?#

Several outstanding libraries for managing and executing git hooks exist already. To name a few: husky, lint-staged, precise-commits or pre-commit.

However, they either need another interpreter besides python (like husky) or are too ambiguous (like pre-commit). pre-commit is written in Python but has support hooks written in all kind of languages. Additionally, it maintains the dependencies by itself and does not install them in the current environment.

Solution#

autohooks is a pure Python library that installs a minimal executable git hook. It allows the decision of how to maintain the hook dependencies by supporting different modes.

Autohooks

Requirements#

Python 3.7+ is required for autohooks. It depends on tomlkit, pontos and rich.