Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Set of Git hooks for pep8, pyflakes, jslint and trac integration

Project Description

githooks is a simple module that adds several python related useful hooks to use with Git hooks system.

It’s still alpha software!

It uses the hghooks module as backend. It implements part of the Mercurial API for hooks, and calls hghooks for the heavy lifting. It supports what hghooks module supports, currently:

  • pep8 checking of python files
  • pyflakes checking of python files
  • Checking for forgotten pdb statements in python files
  • JSLint checking of JavaScript and HTML files
  • Trac integration. This includes:
    • Making sure at least a ticket is mentioned in the changeset message
    • Updating the Trac ticket with the changeset

PyPi package:


hghooks is being developed by Lorenzo Gil Sanchez. It’s released under a LGPLv3, and it’s hosted on:

Extra dependencies

It uses pyjslint, who requires nodejs. You can find more details on this in


How to use

Soon :P


Githooks has serveral options. It uses git config as configuration backend.

All githooks options has “githooks” as family, so a git configuration file looks like similar to this:

        name = John Doe
        email =
[githooks "pep8"]
        ignore = E501
[githooks "trac"]
        hook-active = False

How to read:

$ git config --global githooks.pep8.ignore

How to set:

$ git config --global githooks.pep8.ignore E501

You can find more details about git configuration on the git help:

$ git config --help

In git configuration there are several contexts. Githooks uses two of them.


Global context is user level. This configuration is common for all the repositories of the user.

  • pep8.ignore
    • pep8 error list to ignore
    • defaults to None


Local context is repository level. This configuration only affects one repository.

  • trac.hook-active
    • activate trac integration hook
    • defaults to False
  • trac.repo-name
  • trac.changeset-style
  • trac.msg-template


More and better documentation soon :P

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(19.1 kB) Copy SHA256 Hash SHA256
Source None Dec 6, 2011

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers