← All projects

sloughi

by @01walid

29

Shareable git hooks for Rust project. Sloughi is a friend of Husky from North Africa! :algeria:

About this project

Sloughi A tiny crate to make it easy to share and apply Git hooks for Rust projects. Inspired by Husky. Zero dependencies. No magic, uses Git's config core.hooksPath to set a custom hooks path. Use native/regular shell scripts for git hooks. Makes use of Cargo's build script. IDE/Code editor agnostic. Customizable setup. Sloughi is an ancient breed of domesticated dog originating from North Africa (i.e. Algeria, where I live 👋). Install Add sloughi to your build-dependencies (not dev-dependencies): Create a build.rs file at the root of your project to install Sloughi (besides Cargo.toml, not inside src/): That's it! The next time cargo build is triggered (by VSCode, or by running cargo run/cargo test), you will notice a .sloughi folder is created with a sample pre-commit hook inside. Customizing the install This crate uses the builder pattern, you can chain options on top ::new() to adjust the install: Fail the build The above snippets for build.rs will not interrupt the build in case Sloughi install failed (e.g. not a git repo, permission error ..etc). It's explicitly silenced with let =, you can handle the error however you like, or just yell with: F.A.Q Why use build.rs?

From the project README on GitHub

Stars
29
Forks
2
License
Apache-2.0
Last push
28 Mar 2022

Add this badge to your README

Show that your project is listed on Made in Algeria.

Made in Algeria
[![Made in Algeria](https://www.madeinalgeria.dev/badge/sloughi.svg)](https://www.madeinalgeria.dev/projects/sloughi)

Related projects