Repository navigation
Conversation
paldepind
force-pushed
the
paldepind-cargo-clippy-ci
branch
2 times, most recently
from
November 27, 2026 09:25
2895105 to
0d036d7
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Setting SWIFT_SYNTAX_RS_CHECK_ONLY=1 skips the native Swift build, so cargo check and cargo clippy work without a Swift toolchain. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the per-project Clippy steps with one workflow that lints only the root workspace packages affected by a change, including their reverse dependencies. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
paldepind
force-pushed
the
paldepind-cargo-clippy-ci
branch
from
November 27, 2026 09:28
0d036d7 to
5c5ff8c
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
After a force-push, an unavailable base commit causes the unchecked git diff to abort package selection before Clippy runs instead of conservatively selecting all packages.
1 open issue
What changed in this PR
Centralizes Rust linting in a Cargo-based workflow that selects affected root-workspace packages and their dependents, replacing scattered Clippy checks.
Changes:
- Adds package selection, selection tests, and cached Clippy runs for PRs and pushes.
- Removes redundant Clippy steps from existing workflows.
- Adds a Rust-only Swift shim check mode and resolves newly exposed Rust lint warnings.
| File | Description |
|---|---|
unified/swift-syntax-rs/README.md |
Documents Rust-only checks without building the native shim. |
unified/swift-syntax-rs/build.rs |
Adds an environment-controlled native build bypass. |
unified/extractor/src/languages/swift/swift.rs |
Renames bindings and simplifies optional-value handling for lint compliance. |
misc/scripts/cargo-clippy/test_cargo_clippy.py |
Tests package selection and dependency propagation. |
misc/scripts/cargo-clippy/cargo_clippy.py |
Selects affected workspace packages and invokes Clippy. |
.github/workflows/tree-sitter-extractor-test.yml |
Removes the separate Clippy job. |
.github/workflows/rust.yml |
Removes redundant Clippy steps. |
.github/workflows/cpp-bmn.yml |
Removes the local Clippy step. |
.github/workflows/cargo-clippy.yml |
Adds centralized selection, caching, source preparation, and linting. |
Review effort: Balanced (adaptive)
Comment on lines
+92
to
+95
| return subprocess.check_output( | ||
| ["git", "diff", "--name-only", "--no-renames", "-z", base, "HEAD"], | ||
| cwd=root, | ||
| ).decode().split("\0") |
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This PR adds a single action that lints all Rust code in the repo. Previously some specific actions had
cargo clippycommands and others didn't, so linting was ad-hoc and incomplete.The new action only lints Rust projects that are actually touched by a PR. It runs Clippy through Cargo. An alternative would have been to run Clippy through Bazel. I wasn't sure which approach was best, so I had Copilot try both. There's a sibling PR that does the same as this PR but through Bazel. My conclusion is:
cargo clippyis much faster. Here are the numbers from the experiments that Copilot ran. The numbers are from inserting a lint error in the Rust extractor:Single-run observations; job times exclude the separate selection job. Cached runs reused the same PR's cache.
Since Cargo is much faster, I went with that approach. No need to waste Action minutes. I've only lightly skimmed over the
cargo_clippy.pyscript.