{"id":27985085,"url":"https://github.com/boreplusplus/whippet","last_synced_at":"2025-05-08T06:40:41.732Z","repository":{"id":62588857,"uuid":"207461134","full_name":"BorePlusPlus/whippet","owner":"BorePlusPlus","description":"Install make based hooks with ease. ","archived":false,"fork":false,"pushed_at":"2020-01-13T17:10:38.000Z","size":66,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T12:45:33.123Z","etag":null,"topics":["git","git-hooks","hooks","make","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BorePlusPlus.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-10T03:54:35.000Z","updated_at":"2023-08-29T15:36:05.000Z","dependencies_parsed_at":"2022-11-03T17:01:33.054Z","dependency_job_id":null,"html_url":"https://github.com/BorePlusPlus/whippet","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorePlusPlus%2Fwhippet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorePlusPlus%2Fwhippet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorePlusPlus%2Fwhippet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorePlusPlus%2Fwhippet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorePlusPlus","download_url":"https://codeload.github.com/BorePlusPlus/whippet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253017012,"owners_count":21840881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","git-hooks","hooks","make","python"],"created_at":"2025-05-08T06:40:40.803Z","updated_at":"2025-05-08T06:40:41.717Z","avatar_url":"https://github.com/BorePlusPlus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Whippet - like husky, but leaner\n################################\nUse `make \u003chttps://www.gnu.org/software/make/\u003e`_ targets to execute git hooks. Inspired by `husky \u003chttps://github.com/typicode/husky#readme\u003e`_.\n\n.. image:: https://travis-ci.org/BorePlusPlus/whippet.svg?branch=master\n    :target: https://travis-ci.org/BorePlusPlus/whippet\n    :alt: Automatic build\n\n.. image:: https://img.shields.io/pypi/v/whippet\n    :target: https://pypi.org/project/whippet/\n    :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/dw/whippet\n    :target: https://pypi.org/project/whippet/\n    :alt: PyPI downloads\n\n\nRationale\n*********\nWhen working on `Node.js \u003chttps://nodejs.org\u003e`_ projects, I liked the simplicity of setting up git hooks using husky. Since I failed to find a similar tool in python ecosystem, I decided to write one myself.\n\nAs far as I know, there is no standard equivalent to `npm scripts \u003chttps://docs.npmjs.com/misc/scripts\u003e`_ 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.\n\nNote\n----\nDevelopment follows my needs at work, which means whippet might be a bit light on features. Feel free to make a suggestion if you're missing something.\n\nInstallation\n************\nWhippet is available as a `PyPI package \u003chttps://pypi.org/project/whippet/\u003e`_. Use a tool that can install packages from it, like for instance `pip \u003chttps://pip.pypa.io/en/stable/\u003e`_.\n\n.. code-block:: bash\n\n    $ pip install whippet\n\nUsage\n*****\n\nInstall hooks\n-------------\nOnce 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.\n\n.. code-block:: bash\n\n    $ cd demo\n    $ whippet\n    whippet - Are you sure you want to install hooks in /home/bpp/demo/.git? [Y/n] y\n\nSetup target\n------------\nWhippet 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:\n\n.. code-block:: make\n\n    pre-commit:\n        @echo \"Whippet says: Woof!\"\n\n\nThen the target will be executed on ``pre-commit``:\n\n.. code-block:: bash\n\n    $ git commit -m 'Testing whippet'\n    pre-commit\n    Whippet says: Woof!\n    [master d654d33] Bar\n    1 file changed, 12 insertions(+)\n    create mode 100644 Makefile\n    $\n\n\nUninstall hooks\n---------------\nIf you had enough and want to remove whippet git hooks invoke ``whippet`` and pass ``uninstall`` command\n\n.. code-block:: bash\n\n    $ whippet uninstall\n    whippet - Are you sure you want to uninstall hooks in /home/bpp/demo/.git? [Y/n] y\n\n\nNon-interactive\n---------------\nTo avoid the prompt pass the ``--assume-yes`` argument to whippet. This can be useful when adding whippet to initialisation target in Makefile. Example:\n\n.. code-block:: make\n\n    init:\n        pip install -r requirements.txt\n        whippet --assume-yes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboreplusplus%2Fwhippet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboreplusplus%2Fwhippet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboreplusplus%2Fwhippet/lists"}