Sha256: 36d57e949c49dd5396e7051b50740f8eda0f76e46fc5f823838c448807789a4d

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

A better pre-commit hook for git.

## Installation

Install the gem
    $ gem install pre-commit

Use the pre-commit command to generate a stub pre-commit hook

    # In your git repo
    $ pre-commit install

This creates a .git/hooks/pre-commit script which will check your git config and run checks that are enabled.

## Configuration

These are the available checks:

* white_space
* console_log
* debugger
* tabs
* jshint
* js\_lint\_all (Runs JSLint on all staged JS files)
* js\_lint\_new (Runs JSLint on all new staged JS files)
* closure\_syntax\_check

To configure which checks you would like to run, simply set the `pre-commit.checks` git configuration setting. 

To enable `white_space` and `tab` checks:

    # From your git repo
    $ git config "pre-commit.checks" "white_space, tabs"

To enable `white_space`, `console_log` and `debugger` checks:

    # From your git repo
    $ git config "pre-commit.checks" "white_space, console_log, debugger"

Note: If no checks are configured, a default set of checks is run:

    white_space, console_log, debugger, tabs, jshint, migrations

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pre-commit-0.1.16 README.md
pre-commit-0.1.15 README.md
pre-commit-0.1.14 README.md
pre-commit-0.1.13 README.md
pre-commit-0.1.12 README.md
pre-commit-0.1.11 README.md
pre-commit-0.1.10 README.md