#git-hook #git #yaml-config #git-configuration #config-file #cargo-build

bin+lib monk

Monk is a simple Git hooks manager written in Rust. It allows you to manage and automate Git hooks easily using a YAML configuration file.

11 releases

0.1.10 Sep 23, 2024
0.1.9 Sep 23, 2024

#2783 in Command line utilities

Download history 21/week @ 2024-09-13 769/week @ 2024-09-20 57/week @ 2024-09-27 6/week @ 2024-10-04 12/week @ 2024-10-11 1/week @ 2024-10-18 3/week @ 2024-10-25 3/week @ 2024-11-01 2/week @ 2024-11-08 8/week @ 2024-11-15 11/week @ 2024-11-22 53/week @ 2024-12-06 24/week @ 2024-12-13 4/week @ 2024-12-20 2/week @ 2024-12-27

83 downloads per month

MIT license

68KB
112 lines

Monk is a simple Git hooks manager

License GitHub Issues Crates.io

Monk's features:

  • 🦀 Easily set up in your Rust project. No need to install additional package managers.
  • ⚙️ Works with custom build.rs files. Automate the hooks installation process.
  • 💻 Run your hooks via CLI. Test your hooks without triggering them via Git.

Keep calm, monk will protect your repo!

Installation

You can install it using cargo:

cargo install monk

Usage

Create a configuration file monk.yaml in your project:

pre-commit:
  commands:
    - cargo fmt -- --check
    - cargo clippy -- -D warnings

pre-push:
  commands:
    - cargo test

Then, install the hooks manually:

monk install

Or

Install monk as a build dependency (this is the preferred way):

cargo add --build monk

and create a build script build.rs:

pub fn main() {
    monk::init();
}

This way, monk will automatically install hooks for every team member during the build process.

Running hooks hooks manually

If you want to run specific hooks, use the run command:

monk run pre-commit

Dependencies

~2.7–3.5MB
~72K SLoC