#git-hook #hook #git #cargo #git-repository

app cargo-hook

Add a hook to git which will fmt, clippy and test rust code prior to commit

3 releases

0.1.2 Feb 15, 2023
0.1.1 Jan 11, 2023
0.1.0 Jan 11, 2023

#421 in Cargo plugins

35 downloads per month

MIT/Apache

5KB
60 lines

Cargo Hook

Adds a git hook to your repository, which will format, lint and test your rust code, and ask you to fix any problems before you commit.

cargo install cargo-hook
cargo hook
---------------------------
- ✨  Running clippy   ✨ -
---------------------------
    Checking cargo-hook v0.1.0 (/Users/jacko/src/cargo-hook)
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
✅
---------------------------
- ✨ Running formatter ✨ -
------------------------------------------------------
- ✨   Running tests   ✨ -
---------------------------
   Compiling cargo-hook v0.1.0 (/Users/jacko/src/cargo-hook)
    Finished test [unoptimized + debuginfo] target(s) in 0.32s
     Running unittests src/main.rs (target/debug/deps/cargo_hook-23cd2685ff070753)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

✅
--------------------------------------
- 🎉 linted, formatted and tested 🎉 -
--------------------------------------

No runtime deps