pre-commit

Crates.iopre-commit
lib.rspre-commit
version0.5.2
sourcesrc
created_at2016-12-28 23:15:16.310395
updated_at2016-12-29 16:03:49.982413
descriptionReads hooks metadata from Cargo.toml and executes on commit
homepage
repositoryhttps://github.com/rustation/pre-commit
max_upload_size
id7827
size3,285
Joe Grund (jgrund)

documentation

README

pre-commit

Reads hooks metadata from Cargo.toml and executes on commit

Installing

$ cargo install pre-commit

Usage

Add a table like the following to your Cargo.toml

[package.metadata.precommit]
fmt = "cargo fmt -- --write-mode diff 2>&1"
test = "cargo test 2>&1"

Then run:

cargo clean; cargo build;

You should now have a pre-commit file in your ./git/hooks that will run the listed pre-commit entries.

Commit count: 10

cargo fmt