From 9ed1cad4348b098ac10fd73e6f59026020fa9ac5 Mon Sep 17 00:00:00 2001 From: tallyhuhu Date: Mon, 20 Apr 2026 14:18:02 +0700 Subject: [PATCH 1/2] chore: scope pre-commit to staged files --- .husky/pre-commit | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 6c3309d..d180a2a 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,15 @@ -pnpm biome check --write ./src ./tests +files=$(git diff --cached --name-only --diff-filter=ACMR | grep -E '^(src|tests)/.*\.(ts|tsx|js|jsx)$' || true) + +if [ -z "$files" ]; then + exit 0 +fi + +set -- +while IFS= read -r file; do + set -- "$@" "$file" +done < Date: Mon, 20 Apr 2026 14:49:43 +0700 Subject: [PATCH 2/2] fix: block partial staged files in pre-commit hook --- .husky/pre-commit | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index d180a2a..5587c4d 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -11,5 +11,20 @@ done <