Conversation
b977dc9 to
af3f6cb
Compare
1f748b1 to
d4f9746
Compare
bolinfest
added a commit
that referenced
this pull request
Mar 31, 2026
## Why Bazel clippy now catches lints that `cargo clippy` can still miss when a crate under `codex-rs` forgets to opt into workspace lints. The concrete example here was `codex-rs/app-server/tests/common/Cargo.toml`: Bazel flagged a clippy violation in `models_cache.rs`, but Cargo did not because that crate inherited workspace package metadata without declaring `[lints] workspace = true`. We already mirror the workspace clippy deny list into Bazel after [#15955](#15955), so we also need a repo-side check that keeps every `codex-rs` manifest opted into the same workspace settings. ## What changed - add `.github/scripts/verify_cargo_workspace_manifests.py`, which parses every `codex-rs/**/Cargo.toml` with `tomllib` and verifies: - `version.workspace = true` - `edition.workspace = true` - `license.workspace = true` - `[lints] workspace = true` - top-level crate names follow the `codex-*` / `codex-utils-*` conventions, with explicit exceptions for `windows-sandbox-rs` and `utils/path-utils` - run that script in `.github/workflows/ci.yml` - update the current outlier manifests so the check is enforceable immediately - fix the newly exposed clippy violations in the affected crates (`app-server/tests/common`, `file-search`, `feedback`, `shell-escalation`, and `debug-client`) --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16353). * #16351 * __->__ #16353
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to #16345, the Bazel clippy rollout in #15955, and the cleanup pass in #16353.
cargo clippywas enforcing the workspace deny-list fromcodex-rs/Cargo.tomlbecause the member crates opt into[lints] workspace = true, but Bazel clippy was only usingrules_rustplusclippy.toml. That left the Bazel lane vulnerable to drift:clippy.tomlcan tune lint behavior, but it cannot set allow/warn/deny/forbid levels.This PR now closes both sides of the follow-up. It keeps
.bazelrcin sync with[workspace.lints.clippy], and it fixes the real clippy violations that the newly-synced Windows Bazel lane surfaced once that deny-list started matching Cargo.What Changed
.github/scripts/verify_bazel_clippy_lints.py, a Python check that parsescodex-rs/Cargo.tomlwithtomllib, reads the Bazelbuild:clippyclippy_flagentries from.bazelrc, and reports missing, extra, or mismatched lint levelsci.ymlworkflow so the sync check does not depend on a Rust toolchain being installed first.bazelrccomment to explain the Cargoworkspace = truelinkage and why Bazel needs the deny-list duplicated explicitlycodex-windows-sandboxviolations that Bazel clippy reported after the sync, using the same style as ci: verify codex-rs Cargo manifests inherit workspace settings #16353: inlineformat!args, method references instead of trivial closures, removed redundant clones, and replaced SID conversionunwrapandexpectcalls with proper errorscodex-backend-clientandcore_test_supportTesting
Key new test introduced by this PR:
python3 .github/scripts/verify_bazel_clippy_lints.py