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