#cargo-toml #execute #metadata #commit #hook #read #table

build pre-commit

Reads hooks metadata from Cargo.toml and executes on commit

2 unstable releases

Uses old Rust 2015

0.5.2 Dec 29, 2016
0.5.1 Dec 29, 2016
0.3.0 Dec 29, 2016
0.2.0 Dec 29, 2016
0.1.0 Dec 28, 2016

#30 in #reads

Download history 68/week @ 2024-11-16 117/week @ 2024-11-23 129/week @ 2024-11-30 102/week @ 2024-12-07 84/week @ 2024-12-14 14/week @ 2024-12-21 26/week @ 2024-12-28 115/week @ 2025-01-04 52/week @ 2025-01-11 67/week @ 2025-01-18 90/week @ 2025-01-25 172/week @ 2025-02-01 181/week @ 2025-02-08 73/week @ 2025-02-15 110/week @ 2025-02-22 136/week @ 2025-03-01

543 downloads per month
Used in 3 crates

MIT license

4KB
90 lines

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.

No runtime deps

~37KB