ci: add whole-tree Python syntax gate (compileall) to fail fast on unparseable .py (#4643)

The ruff E9 gate is diff-scoped, so a SyntaxError/IndentationError reported on
an untouched line can slip the filter and only surface as a mass-failure of
every test shard at the conftest server-boot fixture. compileall fails in ~2s
with a clear file:line, before the matrix suite runs. Python analog of the JS
node --check pass. Prompted by #4641.

Co-authored-by: nesquena-hermes <nesquena-hermes@users.noreply.github.com>
This commit is contained in:
nesquena-hermes
2026-06-21 17:21:30 -07:00
committed by GitHub
parent f7e144d59f
commit 3ba5d4dd67
+11
View File
@@ -30,6 +30,17 @@ jobs:
- name: Ensure origin/master ref is available for the diff gate
run: git fetch --no-tags --depth=1 origin master || true
# Whole-tree Python syntax gate. The Python analog of the JS `node --check`
# pass. The ruff E9 gate below is diff-scoped (new/changed lines only), so a
# SyntaxError/IndentationError whose parser-reported line sits on an UNTOUCHED
# line (e.g. a dedented `try:` above an unchanged import) can slip the diff
# filter and only surface as a confusing mass-failure of every test shard at
# the conftest server-boot fixture. compileall fails in ~2s with a clear
# file:line, before the matrix suite runs. Whole-tree + unconditional so it
# cannot be bypassed by the diff scope. (#4641)
- name: Python syntax gate (whole tree — fails fast on any unparseable .py)
run: python3 -m compileall -q api server.py bootstrap.py mcp_server.py tests scripts
- name: Ruff forward gate (new/changed lines only)
run: python3 scripts/ruff_lint.py --diff origin/master