Sha256: cb88a1beaf54ec2e59b33ff7ab55f07ac1e1901225ae7d4d0bde8c3d95f74b48

Contents?: true

Size: 1.07 KB

Versions: 6

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
* closure\_syntax\_check
* js_lint_all (Runs JSLint on all staged JS files)
* js_lint_new (Runs JSLint on all new staged JS files)

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, closure_syntax_check and js_lint_new.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pre-commit-0.1.6 README.md
pre-commit-0.1.5 README.md
pre-commit-0.1.4 README.md
pre-commit-0.1.3 README.md
pre-commit-0.1.2 README.md
pre-commit-0.1.1 README.md