Skip to content

Commit 3d5e3e0

Browse files
committed
fix(gate): mvnw 感知块 ruff 三违规清零——隐式串接加括号、except 收窄并记录 UNVERIFIED 决策日志(分析失败不再静默 pass)
1 parent 4960670 commit 3d5e3e0

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎hooks/gate_lib.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,16 @@ def check(lang: str):
468468
_jp = _jp_analyze(str(project_root))
469469
if _jp.get("status") == "UNVERIFIED":
470470
return (lang, None,
471-
f"{lang} 项目分析 UNVERIFIED({_jp.get('build_system', '?')}),"
472-
f"原因: {'; '.join(_jp.get('reasons', []))},本次未验证")
471+
(f"{lang} 项目分析 UNVERIFIED({_jp.get('build_system', '?')}),"
472+
f"原因: {'; '.join(_jp.get('reasons', []))},本次未验证"))
473473
exe = _jp.get("executable")
474474
if exe and base_cmd and base_cmd[0] in ("mvn", "gradle"):
475475
base_cmd = [exe] + base_cmd[1:]
476-
except Exception:
477-
pass # java_project 分析失败不阻塞门禁,走原路径
476+
except Exception as exc: # noqa: BLE001 — 分析失败不阻塞门禁,走原路径
477+
print(f"[codeguard] java_project 分析失败(走原路径): {exc!r}",
478+
file=sys.stderr)
479+
record_gate_decision(project_root, lang, base_cmd, -1,
480+
"UNVERIFIED", f"java_project 分析失败: {exc!r}")
478481

479482
outputs: list[tuple[int, str, str]] = []
480483
stale_notes: list[str] = []

0 commit comments

Comments
 (0)