From d1ab38c0891a14be7c226fb0c4aba6a4fe5d0f1d Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Sun, 19 Apr 2026 12:31:31 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=20pre-commit=20git?= =?UTF-8?q?=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- .githooks/pre-commit | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .githooks/pre-commit diff --git a/.githooks/pre-commit b/.githooks/pre-commit deleted file mode 100644 index b33792677..000000000 --- a/.githooks/pre-commit +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# pre-commit hook: 对暂存的文件运行 Biome 检查 -# 仅检查 src/ 下的 .ts/.tsx/.js/.jsx 文件 - -STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^src/.*\.(ts|tsx|js|jsx)$') - -if [ -z "$STAGED_FILES" ]; then - exit 0 -fi - -echo "Running Biome lint on staged files..." - -# 使用 biome lint 对暂存文件进行检查(仅 lint,不格式化,不自动修复) -echo "$STAGED_FILES" | xargs bunx biome lint --no-errors-on-unmatched - -if [ $? -ne 0 ]; then - echo "" - echo "Biome lint failed. Fix errors or use --no-verify to bypass." - exit 1 -fi - -exit 0