Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d849d5e545
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
.github/workflows/rust-ci.yml
Outdated
| if: ${{ runner.os != 'macOS' }} | ||
| shell: bash | ||
| run: ./tools/argument-comment-lint/run-prebuilt-linter.sh -- --lib --bins | ||
| run: ./tools/argument-comment-lint/run-prebuilt-linter.py -- --lib --bins |
There was a problem hiding this comment.
Pin Python runtime before running lint wrapper
This step now executes run-prebuilt-linter.py directly, which depends on python3 via the shebang, but the job does not install or pin a Python runtime. Because this matrix includes self-hosted Windows runners (runner.os != 'macOS'), any runner image without a python3 shim will fail before linting starts; the previous .sh wrapper did not introduce that dependency. Please add an explicit Python setup (or invoke a guaranteed interpreter) in this job.
Useful? React with 👍 / 👎.
Why
The
argument-comment-lintentrypoints had grown into two shell wrappers with duplicated parsing, environment setup, and Cargo forwarding logic. The recent--separator regression was a good example of the problem: the behavior was subtle, easy to break, and hard to verify.This change rewrites those wrappers in Python so the control flow is easier to follow, the shared behavior lives in one place, and the tricky argument/defaulting paths have direct test coverage.
What changed
tools/argument-comment-lint/run.shandtools/argument-comment-lint/run-prebuilt-linter.shwith Python entrypoints:run.pyandrun-prebuilt-linter.pytools/argument-comment-lint/wrapper_common.py, including:----manifest-path codex-rs/Cargo.toml --workspace --no-deps--fixruns to--all-targetsunless the caller explicitly narrows the target setDYLINT_RUSTFLAGSandCARGO_INCREMENTALrustupshims first onPATH, infersRUSTUP_HOMEwhen needed, and then launches the packagedcargo-dylintpathjustfile,rust-ci.yml, andtools/argument-comment-lint/README.mdto use the Python entrypointsrust-ciso the package job runs Python syntax checks plus the new wrapper unit tests, and the OS-specific lint jobs invoke the wrappers through an explicit Python interpreterThis is a follow-up to #16054: it keeps the current lint semantics while making the wrapper logic maintainable enough to iterate on safely.
Validation
python3 -m py_compile tools/argument-comment-lint/wrapper_common.py tools/argument-comment-lint/run.py tools/argument-comment-lint/run-prebuilt-linter.py tools/argument-comment-lint/test_wrapper_common.pypython3 -m unittest discover -s tools/argument-comment-lint -p 'test_*.py'python3 ./tools/argument-comment-lint/run-prebuilt-linter.py -p codex-terminal-detection -- --libpython3 ./tools/argument-comment-lint/run.py -p codex-terminal-detection -- --lib