Skip to main content

Hassle free git hooks for python projects.

Project description

barb

Hassle-free, cross-platform git hooks for python projects

PyPi Download PyPi Download PyPi Download

Installation

pip install barb

Initializing a new project

barb init

Running this command both initializes the .barb directory as well as runs the barb install command.

Installing barb

To register the hooks under the .barb directory with git, run barb install

Creating a hook

Create a script under the .barb directory with the same name as the git hook you are attempting to create.

You can create two types of scripts to work as hooks:

  • The standard shell script, which will be executed by bash.
    ex.
./.barb/pre-commit
---
#!/bin/sh
echo "Hello, World!"
  • A python script. The script will enter at the hook() function
./.barb/pre-push.py
---
def hook():
  print('Hello, World!')

Exceptions and False return values from this function will be considered hook failures.

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

barb-0.0.9.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

barb-0.0.9-py3-none-any.whl (4.9 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