From accaddfd280119fc741c7d15d9795a13450878d7 Mon Sep 17 00:00:00 2001 From: zhangaotian <8474238@qq.com> Date: Mon, 28 Oct 2024 13:43:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90Git=E3=80=91=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E5=8E=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Forest/Assets/Scripts/Gameplay/LevelState.cs | 1 + Tool/GitHook/pre-commit | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Forest/Assets/Scripts/Gameplay/LevelState.cs b/Forest/Assets/Scripts/Gameplay/LevelState.cs index 5506dc5..823044b 100644 --- a/Forest/Assets/Scripts/Gameplay/LevelState.cs +++ b/Forest/Assets/Scripts/Gameplay/LevelState.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using Gameplay.ForestLevel; using Object = UnityEngine.Object; using Vector3 = UnityEngine.Vector3; +using NPOI.SS.Formula.Functions; namespace Gameplay.Level { diff --git a/Tool/GitHook/pre-commit b/Tool/GitHook/pre-commit index 6c01a96..8f44969 100644 --- a/Tool/GitHook/pre-commit +++ b/Tool/GitHook/pre-commit @@ -13,10 +13,10 @@ check_commit() { exit 1 fi - # 仅对 'Forest/Assets/Scripts/' 路径下的文件进行额外检查 + # 检查所有以 'using NPOI.' 开头的引用 if [[ $FILE == *"Forest/Assets/Scripts/"* ]]; then - if git diff --cached --unified=0 -- "$FILE" | grep -v '^-' | grep -q "using NPOI.SS.Formula.Functions"; then - echo "Code 提交失败: $FILE 包含 'using NPOI.SS.Formula.Functions' 内容" + if git diff --cached --unified=0 -- "$FILE" | grep -v '^-' | grep -q "using NPOI\."; then + echo "Code 提交失败: $FILE 包含 'using NPOI.' 的内容" exit 1 fi fi