Skip to main content

A set of useful hooks for Mercurial

Project description

hghooks

hghooks is a simple module that adds several useful hooks for use in Mercurial hooks system.

Right now it includes hooks for:

  • pep8 checking of python files

  • pyflakes checking of python files

  • checking for forgotten pdb statements in python files

Documentation

Installation

hghooks is distributed as a Python egg so is quite easy to install. You just need to type the following command:

easy_install hghooks

And Easy Install will go to the Cheeseshop and grab the last hghooks for you. It will also install it for you at no extra cost :-)

Usage

To use one of the hooks provided by this package edit your hgrc file of your Mercurial repository and add these lines:

[hooks]
pretxncommit.pep8 = python:hghooks.pep8hook
pretxncommit.pyflakes = python:hghooks.pyflakeshook
pretxncommit.pdb = python:hghooks.pdbhook

You can add as many hooks as you need. From version 0.2.0 it supports the pretxnchangegroup hook too.

How to skip the hooks

If you need to avoid a hook for a specific changeset you can add one or more of the following keywords to the commit message: no-pep8, no-pyflakes and no-pdb.

On the other hand, if you want to avoid a hook in a specific file you can add a comment somewhere in the file saying so. For example:

# hghooks: no-pyflakes no-pdb

in this case the pyflakes and pdb hooks will skip this file. The “# hghooks:” prolog is important and you have to type it exactly like that. Then add the skip keyworkds separated by spaces.

Changes

0.2.1 (2010-10-14)

  • Fixes installation problem because setup.py was importing pep8 and pyflakes

  • Fixes bug in pdb checker when adding new files

0.2.0 (2010-10-14)

  • Support for the pretxnchangegroup hook

0.1.2 (2010-08-31)

  • Fixes issue #2 about erros when removing files

0.1.1 (2010-06-13)

  • Add documentatin about how to skip the checks

0.1.0 (2010-06-13)

  • Initial release

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

hghooks-0.2.1.tar.gz (7.2 kB view details)

Uploaded Source

File details

Details for the file hghooks-0.2.1.tar.gz.

File metadata

  • Download URL: hghooks-0.2.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hghooks-0.2.1.tar.gz
Algorithm Hash digest
SHA256 025d3517efce4173e9a45106f70f7ef2c7d71ece690d4037a9ac4f44929ae64d
MD5 46f043fc59e1ec2d3b317e7bc42a876f
BLAKE2b-256 84407436cbfb7bd0f0c42a0925d904354993de5ba3acf2df9b151ffbdbd0b8ba

See more details on using hashes here.

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