Installation

Three steps are necessary for installing autohooks:

  1. Installing autohooks into the current environment

  2. Activating the git hook

  3. Installing and configuring the plugins to be run

For fulfilling these steps different tooling can be used. Most prominent and currently supported tools are:

Note

Using poetry is recommended for installing and maintaining autohooks.

1. Installing autohooks into the Current Environment

Fist of all autohooks needs to be installed to provide the CLI.

Hint

When using pip it might be necessary to adjust your PATH to allow executing the autohooks CLI without having to reference the full installation path later on.

export PATH=$PATH:~/.local/bin

To install autohooks as a development dependency run

poetry add --dev autohooks

2. Activating the Git Hook

To actually use autohooks when a git commit is created, it is required to activate the git hook in every cloned git repository. This can be done by running

poetry run autohooks activate --mode poetry

3. Installing and Configuring the Plugins to Be Run

To finally execute a hook on your git commits, autohooks plugins have to be installed and configured. E.g. set up the Python linting via pylint plugin by executing

poetry add --dev autohooks-plugin-pylint
poetry run autohooks plugins add autohooks.plugins.pylint