hooksmith 1.3.0

Trivial git hook management tool
Documentation
hooksmith-1.3.0 has been yanked.

Crates.io Docs.rs

Features

  • ⚙️ Automate the hooks installation process with build.rs files.
  • 💻 Run hooks locally without triggering them via Git.
  • ⚙️ Dry-run mode to preview changes without applying them.

Installation

With Cargo

You can install it using cargo:

cargo install hooksmith

Build Dependency

You can add it as a build dependency:

cargo add --build hooksmith

Then create a build.rs file:

use std::path::Path;

pub fn main() {
    let config_path = Path::new("hooksmith.yaml");

    hooksmith::init(&config_path);
}

Usage

Create a configuration file named monk.yaml in your project root:

pre-commit:
  commands:
    - cargo fmt --all -- --check
    - cargo clippy --workspace --release --all-targets --all-features -- --deny warnings

pre-push:
  commands:
    - cargo test

Commands

  • hooksmith install: Install the hooks from the configuration file.
  • hooksmith uninstall [hook_name]: Uninstall a hook (all if no name is provided).
  • hooksmith run <hook_name>: Run a hook.

All commands can be preceded by the --dry-run flag to preview changes without applying them.