16 releases (6 breaking)
✓ Uses Rust 2018 edition
|0.9.0||Jul 11, 2019|
|0.8.3||May 20, 2019|
|0.4.1||Mar 14, 2019|
|0.1.2||Dec 27, 2018|
#31 in Development tools
281 downloads per month
Used in 1 crate
Git hook utility for Rust codebases that lets you run any script for any git hook.
Functional, but still in Beta!
rusty-hookas a dev dependency in your Cargo.toml file
cargo test(to build your dev dependencies, including
- Update the generated
.rusty-hook.tomlfile with the commands you want to run
git commit(or equivalent to trigger your git hook)! note the very first (and only) time you do this will take an extra ~30 seconds or so to finalize the setup
rusty-hook as a dev dependency in your Cargo.toml file:
[dev-dependencies] rusty-hook = "0.9.0"
When you add
rusty-hook as a dev-dependency in your project, it will automatically configure the git hooks once it is built (for example the first time you run
This will ensure that all of the client side git hooks are setup and available, and it will create a
rusty-hook configuration file if one does not already exist.
The git hook script will ensure that the
rusty-hook cli is available, so the very first time a git hook is triggered on your machine you will see a message indicating that the
rusty-hook setup is being finalized which may take ~30 seconds or so:
Finalizing rusty-hook configuration... This may take a few seconds...
You can also install the
rusty-hook cli with cargo:
cargo install rusty-hook
You can optionally manually initialize any git directory by running the
init command in any git directory to set it up:
You define your desired git hook configuration in the
rusty-hook configuration file (a TOML file named
[hooks] pre-commit = "cargo test" pre-push = "cargo fmt -- --check" post-commit = "echo yay" [logging] verbose = true
[hooks] table, you can add an entry for any and every git hook you want to run by adding a key using the name of the git hook, and then specify the command/script you want to run for that hook. Whenever that git hook is triggered,
rusty-hook will run your specified command!
[logging] table, you can control whether to log the output of running your specified hook commands. By default
rusty-hook will log the results of your hook script, but you can disable this behavior by setting the
verbose key to
[logging] verbose = false
There's a few other git hook utilities available on crates.io, but none of them quite suited our needs so we made rusty-hook!
All contributions are welcome and appreciated! Check out our Contributing Guidelines for more information about opening issues, developing, and more.