Skip to main content

Install make based hooks with ease.

Project description

A simple git hooks installer. Inspired by husky.

I liked simplicity of setting up git hooks using husky and since I failed to find a similar tool in python ecosystem, I decided to write one myself.

As far as I know there is no standard equivalent to npm scripts in python, so I chose to rely on make which seems to be a popular way to organise project related tasks in python world.

Install

Whippet is available as a pypi package. Use a tool that can install packages from it, like for instance pip.

$ pip install requests

Usage

Once whippet is installed, it is used by invoking whippet executable in the directory where you wish to install hooks. Whippet will check if that directory (or its ancestor) contains a .git directory and offer to install hooks into it.

$ cd demo
$ whippet
whippet - Are you sure you want to install hooks in /home/bpp/demo/.git? [Y/n] y

Whippet hooks are scripts that check for existence of make targets with the same name as git hooks. If such a target exists, script will execute it. Let’s take pre-commit as an example. Once whippet hooks are installed, we simply add pre-commit target to the Makefile like so:

pre-commit:
    @echo "Hello from whippet"

Then o

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whippet-0.2.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

whippet-0.2.3-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page