ci: parse every Python file under tools/startup #1571
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1578"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T14:33:12Z.
Refs #1149. Adds
startup_tools_lint: a device-free check that compiles everytools/startup/*.pywithout importing or running it, reportingpath:line: messagefor anything that cannot be parsed, and registers it in theprtest preset so it gates pull requests.The check
The self-test is what makes a passing run meaningful: a deliberately broken snippet must be rejected and a valid one accepted, so "0 problems" cannot come from a harness that never parsed anything.
Fail-first
With a file containing
def broken(:added undertools/startup:Removing it returns to
PASS: 7 files ...(exit 0).Two corrections inside this PR
utf-8and flagged a UTF-8 BOM as a syntax error. Python accepts a BOM in source, so that would have failed a file the interpreter runs; it now readsutf-8-sig, and a BOM-prefixed file whose body is valid passes.prpreset filters by test name (caught in review).startup_tools_lintis now inpr.filter.include.name, verified withctest --preset pr -N.What this does not establish
pe_package_import_closureskip, the fixture corpus). Those stay open; this PR does not touch the workflow or any tool.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T14:37:00Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
408ef09a18ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:52:20Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T14:33:26Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
408ef09ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T14:37:54Z.
Correct, and my PR description was wrong on that point: registering the test in
CMakeLists.txtdoes not put it in front of pull requests.ctest --preset prfilters by test name, and the allowlist did not include it. Fixed inf56b2c44by addingstartup_tools_linttopr.filter.include.name.Verified with the preset itself rather than by reasoning about the regex:
(The rest of the
prpreset fails in my tree because I only configured it and did not build its targets — that is unrelated to this check and I did not touch any of them.)I have corrected the PR description too: it now says the test is selected by the
prpreset instead of claiming CI picks it up automatically.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:49:06Z.
Updated the parser check at
ded0fa0eto compile source bytes so it follows Python BOM and encoding-cookie rules. The self-test now scans actual files, accepts UTF-8 BOM and Latin-1 declarations, and requires a syntax diagnostic on line 2 of the malformed file. Verified the Windows startup_tools_lint test with ctest --preset pr on the updated branch.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T14:37:00Z.
Code review location:
CMakeLists.txt; line 174For pull requests,
.github/workflows/windows.ymlrunsctest --preset pr(lines 174–177), butCMakePresets.json'spr.filter.include.nameallowlist (lines 42–45) omitsstartup_tools_lint; CMake documents this field as “a regex for test names” equivalent to--tests-regex. The check therefore runs in full non-PR suites but does not gate pull requests, so a syntax regression can merge before this check catches it. Add the test to the PR filter or invoke it separately.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:52:20Z.
Code review location:
CMakeLists.txt; line 174The PR preset already includes startup_tools_lint on this head. I verified the exact preset filter and ran ctest --preset pr --no-tests=error -R "^startup_tools_lint$" on the updated sources. The selected test passed 1/1 on Windows.