Skip to main content

Extensible Hook System for GIT

Project description

hooks4git

Build Status Coverage Status PyPI version

Fully configurable language agnostic git hooks. Auto checks your code before you ship it. Works with any programmning language.

Availability

Production module is available from https://test.pypi.org/project/hooks4git/, and development branch is also published by Travis-CI to https://test.pypi.org/project/hooks4git/. Both are provided as EGG packages, since there is a Post Install section which creates the hook files on your local directory. Wheel packaging is not intented to do that.

Both can be downloaded and installed via the pip command.

Getting started

These instructions will show you how to install and use the application.

Installation

pip install hooks4git

Usage

After you install the package, your repo is automatically hooked for all events. You just need to open .hooks4git.yml file on the root of your project and configure it the way you want. Example section is meant for Python, but you can use any tool you want, at any given git hook event.

Example section for pre-commit, for Python:

hooks:
 pre-commit:
   scripts:
     # - echo Running "pre-commit" hook
     - flake8 --max-line-length=120 --exclude .git,__pycache__,build,dist

But it could be for NodeJS:

hooks:
 pre-commit:
   scripts:
     # - echo Running "pre-commit" hook
     - eslint server.js
     - jshint *.js

Output

Here is a sample output (black and white... it has actually a full colored output):

hooks4git v0.1 :: Pre-Commit :: hook triggered
———————————————————————————————————————————————————————————————————————————————
STEP | $ flake8 --max-line-length=120 --exclude .git,__pycache__,build,dist
OUT  | None
PASS | 'flake8' step executed successfully ✔
———————————————————————————————————————————————————————————————————————————————
STEPS| 1 were executed
TIME | Execution took 0:00:00.684762
PASS | All green! Good!

License

License: MIT

This project is licensed under MIT license. See the LICENSE file for details

Authors

See list of contributors who participated in this project.

Credits

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

hooks4git-0.1.45.tar.gz (6.2 kB view hashes)

Uploaded Source

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