Crates.io | husky-rs |
lib.rs | husky-rs |
version | |
source | src |
created_at | 2024-09-28 15:45:27.632362 |
updated_at | 2024-12-17 04:11:58.525959 |
description | husky for cargo |
homepage | https://github.com/pplmx/husky-rs |
repository | https://github.com/pplmx/husky-rs |
max_upload_size | |
id | 1390191 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
husky-rs
is a Git hooks management tool for Rust projects, inspired by Husky.
Adding husky-rs
to your project:
You have several options:
# Option 1: Add as a Regular Dependency
cargo add husky-rs
# Option 2: Add as a Dev Dependency
cargo add --dev husky-rs
# Option 3: Use the Main Branch
cargo add --git https://github.com/pplmx/husky-rs --branch main
cargo add --dev --git https://github.com/pplmx/husky-rs --branch main
Create hooks directory:
mkdir -p .husky/hooks
Add a hook (e.g., pre-commit
):
echo '#!/bin/sh\necho "Running pre-commit hook"' > .husky/hooks/pre-commit
Install hooks:
Note: Due to the execution mechanism of
build.rs
, runningcargo clean
is required when installing or updating hooks.
cargo clean && cargo test
Tip: If you add this library to the [dependencies]
section, both cargo build
and cargo test
will work. However, if it's added under [dev-dependencies]
, only cargo test
will function as expected.
husky-rs
aims to support a wide range of Git hooks, including:
pre-commit
prepare-commit-msg
commit-msg
post-commit
pre-push
For a complete list of supported hooks, refer to the Git documentation.
If you encounter any unsupported hooks, please don't hesitate to open an issue.
To skip hook installation:
NO_HUSKY_HOOKS=1 cargo build
For information on setting up the development environment, running tests, and contributing to the project, please refer to our Development Guide.
If you encounter any issues while using husky-rs
, please check our Troubleshooting Guide for common problems and their solutions. If you can't find a solution to your problem, please open an issue on our GitHub repository.
We welcome contributions! Please see our Contributing Guide for details on how to submit pull requests, report issues, or suggest improvements.
This project is licensed under either of:
at your option.
For a detailed history of changes to this project, please refer to our CHANGELOG.md.