From fdb2db02fda3cf31821d1ab9f81a9d706cbec729 Mon Sep 17 00:00:00 2001 From: Mystic <215104920@qq.com> Date: Mon, 30 Sep 2024 20:12:57 +0800 Subject: [PATCH] feat: introduce husky-rs --- .cargo-husky/hooks/pre-push | 1 - .husky/hooks/commit-msg | 3 +++ {.cargo-husky => .husky}/hooks/pre-commit | 2 ++ .husky/hooks/pre-push | 3 +++ .pre-commit-config.yaml | 4 ++-- Cargo.lock | 14 +++++++------- Cargo.toml | 6 ++---- 7 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644 .cargo-husky/hooks/pre-push create mode 100644 .husky/hooks/commit-msg rename {.cargo-husky => .husky}/hooks/pre-commit (51%) create mode 100644 .husky/hooks/pre-push diff --git a/.cargo-husky/hooks/pre-push b/.cargo-husky/hooks/pre-push deleted file mode 100644 index 2045d17..0000000 --- a/.cargo-husky/hooks/pre-push +++ /dev/null @@ -1 +0,0 @@ -echo "hi, pre-push" diff --git a/.husky/hooks/commit-msg b/.husky/hooks/commit-msg new file mode 100644 index 0000000..345baf8 --- /dev/null +++ b/.husky/hooks/commit-msg @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo "hi, commit-msg" diff --git a/.cargo-husky/hooks/pre-commit b/.husky/hooks/pre-commit similarity index 51% rename from .cargo-husky/hooks/pre-commit rename to .husky/hooks/pre-commit index 46ee2e1..955604c 100644 --- a/.cargo-husky/hooks/pre-commit +++ b/.husky/hooks/pre-commit @@ -1 +1,3 @@ +#!/usr/bin/env bash + echo "hi, pre-commit" diff --git a/.husky/hooks/pre-push b/.husky/hooks/pre-push new file mode 100644 index 0000000..a836e1d --- /dev/null +++ b/.husky/hooks/pre-push @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo "hi, pre-push" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f2de07..4b06257 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: end-of-file-fixer - id: mixed-line-ending @@ -13,6 +13,6 @@ repos: args: - "--allow-multiple-documents" - repo: https://github.com/commitizen-tools/commitizen - rev: v3.13.0 + rev: v3.29.1 hooks: - id: commitizen diff --git a/Cargo.lock b/Cargo.lock index 2df19c6..b7f2c3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,12 +50,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "cargo-husky" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" - [[package]] name = "clap" version = "4.4.12" @@ -108,6 +102,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "husky-rs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ddfac7246a1c6d67c96502a5668a70b7aa6c0c454dca96527af90bfcaf15218" + [[package]] name = "proc-macro2" version = "1.0.71" @@ -121,8 +121,8 @@ dependencies = [ name = "proxy-x" version = "0.2.2" dependencies = [ - "cargo-husky", "clap", + "husky-rs", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index aa1a968..1fe9c54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,5 @@ license = "MIT OR Apache-2.0" [dependencies] clap = { version = "~4.4.12", features = ["cargo", "derive"] } -[dev-dependencies.cargo-husky] -version = "1" -default-features = false # Disable features which are enabled by default -features = ["precommit-hook", "prepush-hook"] +[dev-dependencies] +husky-rs = "^0.1.1"