b hai 4 meses
pai
achega
49533164d6
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      tool-trunk-checker.sh

+ 10 - 3
tool-trunk-checker.sh

@@ -145,10 +145,17 @@ else
 		ALL_FILES=""
 	fi
 fi
+echo "1:${ALL_FILES}"
 
-# 去重并过滤空行和隐藏文件(针对非数组模式
+# 去重并过滤空行和隐藏文件(仅在all模式下过滤隐藏文件
 if [ "${MODE}" = "all" ] || [ -n "${USER_FILES}" ]; then
-	ALL_FILES=$(echo "${ALL_FILES}" | grep -v '^$' | grep -v '/\.' | grep -v '^/\.' | sort | uniq || true)
+	# 始终过滤空行并去重
+	ALL_FILES=$(echo "${ALL_FILES}" | grep -v '^$' | sort | uniq || true)
+
+	# 仅在all模式下过滤隐藏文件(用户明确指定文件时不过滤)
+	if [ "${MODE}" = "all" ]; then
+		ALL_FILES=$(echo "${ALL_FILES}" | grep -v '/\.' | grep -v '^/\.' || true)
+	fi
 fi
 
 if [ -z "${ALL_FILES}" ]; then
@@ -190,4 +197,4 @@ echo "✅ 代码质量检查通过!可以安全提交。"
 echo "========================================"
 echo ""
 
-exit 0
+exit 0