ci: parse every Python file under tools/startup #1578
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1578
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1578/head"
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?
@triggered02 on GitHub · 2026-11-24 14:33 UTC · original
triggered02:ci/startup-tools-lint→main· +77 −1 · 3 files · 3 commits · merged 2026-11-24 14:54 UTCRefs #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).
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 14:33 UTC · original · edited 2026-11-24 14:37 UTC
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.
@ -171,0 +171,4 @@# Startup tooling lint (#1149): every Python file under tools/startup must parse. The check compiles each# source without running it and self-tests that a broken snippet is rejected, so a passing run means the# files were actually looked at. It needs no GPU and no game files.add_test(NAME startup_tools_lint COMMAND "${INTAKE_PYTHON}" -B@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 14:37 UTC · original
For 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 👍 / 👎.
@triggered02 on GitHub · 2026-11-24 14:37 UTC · original
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.@R0Y00 on GitHub · 2026-11-24 14:49 UTC · original
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.@ -171,0 +171,4 @@# Startup tooling lint (#1149): every Python file under tools/startup must parse. The check compiles each# source without running it and self-tests that a broken snippet is rejected, so a passing run means the# files were actually looked at. It needs no GPU and no game files.add_test(NAME startup_tools_lint COMMAND "${INTAKE_PYTHON}" -B@R0Y00 on GitHub · 2026-11-24 14:52 UTC · original
The 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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 14:37 UTC · original · reviewed
💡 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".