修复(CI追绿·fix-ci-obs续): static_scan解释器回落——runner PATH只有python3(闸脚本横幅python:python3为证),硬编码python三处调用=127 command not found审计零输出静默判红(run15实证:S9/S10/S13三FAIL零明细行); 加PY_BIN解析(python→python3→无则显式红),三调用改$PY_BIN; 本地全量跑复核
This commit is contained in:
1 parent
03d53b1fc4
commit
be1f3c07f0
1 file changed
+13
-3
@@ -20,6 +20,16 @@ fail=0
|
||||
DIR_CORE="game/core"
|
||||
DIR_PRES="game/presentation"
|
||||
|
||||
# python 解释器解析:PATH 有 python 用 python,只有 python3(runner 常态)回落 python3——
|
||||
# 硬编码 python 在无别名机器上=127 command not found,三审计零输出静默判红(CI run15 实证)。
|
||||
PY_BIN=""
|
||||
if command -v python >/dev/null 2>&1; then PY_BIN="python"
|
||||
elif command -v python3 >/dev/null 2>&1; then PY_BIN="python3"
|
||||
else
|
||||
echo "[static_scan] FAIL: 无 python 解释器(PATH 上既无 python 也无 python3)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
scan_files() { # scan_files <目录> — 该目录下 .gd 文件数
|
||||
find "$1" -name '*.gd' 2>/dev/null | wc -l
|
||||
}
|
||||
@@ -36,7 +46,7 @@ require_scan_face() { # require_scan_face <规则名> <目录> — 扫描面
|
||||
}
|
||||
|
||||
# S9 — 类型闸(code-conventions §4 机器闸:产品码无类型容器/有值返回缺类型/参数缺类型)
|
||||
if python tools/audit_type_hints.py; then
|
||||
if "$PY_BIN" tools/audit_type_hints.py; then
|
||||
echo "[static_scan] S9 ok"
|
||||
else
|
||||
echo "[static_scan] S9 FAIL: 类型闸存量未归零(R1/R2/R3 见上清单)"
|
||||
@@ -44,7 +54,7 @@ else
|
||||
fi
|
||||
|
||||
# S10 — 文件头闸(code-conventions §1.4.1:## 载体+日期/变更叙事黑名单;行数上限已停用)
|
||||
if python tools/audit_file_headers.py; then
|
||||
if "$PY_BIN" tools/audit_file_headers.py; then
|
||||
echo "[static_scan] S10 ok"
|
||||
else
|
||||
echo "[static_scan] S10 FAIL: 文件头存量见上清单"
|
||||
@@ -296,7 +306,7 @@ fi
|
||||
# 簿,登记值只准随还债下降,禁抬高到现状。基线重生成=人工专用(python tools/gdstyle_gate.py
|
||||
# --refresh,附对账;键数骤降逾 10% 或登记值被抬高均拒写,须 --force),禁清基线换绿。二进制本机固定路径
|
||||
# D:/code/gdstyle/gdstyle.exe(不入库),GDSTYLE_BIN 环境变量覆盖;版本与钉定版不符即红(升级须重测)。
|
||||
if python tools/gdstyle_gate.py; then
|
||||
if "$PY_BIN" tools/gdstyle_gate.py; then
|
||||
echo "[static_scan] S13 ok"
|
||||
else
|
||||
echo "[static_scan] S13 FAIL: 基线外新违规/指标恶化或二进制/版本/扫描面问题(清单见上)"
|
||||
|
||||
Reference in new issue
Block a user