Whippet - like husky, but leaner
Use make targets to execute git hooks. Inspired by husky.
Rationale
I liked the 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 the python world.
Installation
Whippet is available as a PyPI package. Use a tool that can install packages from it, like for instance pip.
$ pip install whippet
Usage
Install hooks
Once whippet is installed, it is used by invoking whippet executable in the directory where you wish to install hooks. Whippet checks if that directory (or its ancestor) contains a .git directory and offers 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
Setup target
Whippet hooks are scripts that check for the existence of make targets with the same name as git hooks. If such a target exists, the script executes 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 "Whippet says: Woof!"
Then the target will be executed on pre-commit:
$ git commit -m 'Testing whippet'
pre-commit
Whippet says: Woof!
[master d654d33] Bar
1 file changed, 12 insertions(+)
create mode 100644 Makefile
$
Non-interactive
To avoid the prompt pass the --assume-yes argument to whippet. This can be useful when adding whippet to initialisation target in Makefile. Example:
init:
poetry install
whippet --assume-yes
Metadata
Release files for whippet 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whippet-0.3.0.tar.gz | 4.7 kB | Without provenance | Details for whippet-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| whippet-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for whippet-0.3.0-py3-none-any.whl |
Total release size: 10.2 kB
Release files / whippet-0.3.0.tar.gz
| Download URL | whippet-0.3.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08479f37470e8f34fd3e3cb93e875e384309d4a994d2b27a10c0daf68efac397
|
|
BLAKE2b-256 checksum How to use checksums |
c0b72c676f045cbfd8d6488dbe4d4e2fc978513b43c513eac354f0b1d0cdeb3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.6.8 Linux/4.15.0-60-generic
|
Release files / whippet-0.3.0-py3-none-any.whl
| Download URL | whippet-0.3.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a940d5ca58e40fa2e1ce765a8efae7865eb2cb279b62f3645d650a0851408179
|
|
BLAKE2b-256 checksum How to use checksums |
724c29350c8e533b53135686384a5634f107582a2456320beb94c236c3cdba26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.6.8 Linux/4.15.0-60-generic
|
Security for whippet 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.