feat: Enable git hooks with husky (#4984)

* build(deps): Adds husky for Git hooks

- Integrates the husky package as a development dependency.
- Enables the configuration and enforcement of pre-commit and pre-push Git hooks.
- Improves code quality and consistency by automating checks before commits.

Signed-off-by: Dragon1573 <49941141+Dragon1573@users.noreply.github.com>

* feat: Add Husky prepare hook

- Automatically installs Git hooks for developers
- Ensures consistent code quality checks before commits or pushes
- Streamlines the developer setup process

Signed-off-by: Dragon1573 <49941141+Dragon1573@users.noreply.github.com>

* ci: Avoid installing Git Hooks on GitHub Workflows

- Adds `HUSKY: 0` environment variable to all workflow definitions.
- Prevents local development hooks from executing in CI, which can cause unnecessary failures or overhead.
- See https://typicode.github.io/husky/how-to.html#ci-server-and-docker

Signed-off-by: Dragon1573 <49941141+Dragon1573@users.noreply.github.com>

---------

Signed-off-by: Dragon1573 <49941141+Dragon1573@users.noreply.github.com>
This commit is contained in:
❤是纱雾酱哟~
2025-10-09 05:10:03 +08:00
committed by GitHub
parent 9750cd3ce6
commit 936764e6ce
10 changed files with 27 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
"version": "2.4.3",
"license": "GPL-3.0-only",
"scripts": {
"prepare": "husky || true",
"dev": "cross-env RUST_BACKTRACE=full tauri dev -f verge-dev",
"dev:diff": "cross-env RUST_BACKTRACE=full tauri dev -f verge-dev",
"dev:trace": "cross-env RUST_BACKTRACE=full RUSTFLAGS=\"--cfg tokio_unstable\" tauri dev -f verge-dev tokio-trace",
@@ -105,6 +106,7 @@
"glob": "^11.0.3",
"globals": "^16.4.0",
"https-proxy-agent": "^7.0.6",
"husky": "^9.1.7",
"jiti": "^2.6.1",
"lint-staged": "^16.2.3",
"meta-json-schema": "^1.19.14",