Repository navigation
ci(rust): lint every target and the cli feature with clippy - #1152
Merged
Merged
Conversation
The clippy step ran `cargo clippy --workspace`, which skipped every `#[cfg(test)]` module, everything under `packages/rust/tests/`, and the whole `cli` feature. Widen it to `--all-targets --features cli` and fix the 12 violations that surfaces, including a `MutexGuard` held across an await in `tests/async_sdk.rs`. skip-changelog: lint fixes in test code plus a CI invocation change; no observable behavior change Fixes #1148
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.
Fixes #1148
dirsql-rust-ci.ymlrancargo clippy --workspace -- -D warnings, which lints the library under default features and nothing else: every#[cfg(test)]module, everything underpackages/rust/tests/, and the wholeclifeature went unlinted.This widens the invocation to
cargo clippy --workspace --all-targets --features cli -- -D warningsand fixes the 12 violations that surfaces. Both halves have to land together — widening alone turns the job red, fixing alone leaves nothing preventing a regression.Fixes
All mechanical, taking clippy's own suggestion:
expect_err(3),io::Error::other, needless borrows informat!(2), redundantuse rusqlite;, redundant closure, elided lifetime,let_and_return, collapsibleif(a let-chain, edition 2024).The one that is not a style nit is
tests/async_sdk.rs:289, aMutexGuardheld across an.await. The test already calleddrop(state)beforedb.ready().await, but the binding's lexical scope still spanned the await point, which is what clippy models. The guard's acquisition, thetimed_outassertion,state.released = trueandcvar.notify_all()are now wrapped in a block, so the guard drops at exactly the pointdrop(state)dropped it and the await sits outside its scope. No assertion changed, no test added, removed, or weakened. No#[allow]was added anywhere in this PR.Cost
The wider invocation adds the test targets, the napi/py-ext crates' test targets, and the
clifeature to the check. Locally, on a warm target dir, the widened run finishes in ~2s versus ~1s narrow; cold, it is dominated by the dependency build the job already pays for (clap is the only feature-gated addition). Not enough to matter for the job's runtime.Verification
cargo clippy --workspace --all-targets --features cli -- -D warnings— exit 0cargo test --workspace --features cli— all suites pass, 0 failedjust preflight— 0 failing pairs, 3 skippedE2E Verification
N/A - CI/config only
The
e2e-verifygate still demands receipts (anypackages/rust/srcdiff scopes both bindings), so both were written:cargo test --workspace --features cli)packages/python/e2e-attestations/claude-1148-clippy-all-targets.jsonreceipt writtenpackages/ts/e2e-attestations/claude-1148-clippy-all-targets.jsonreceipt writtenjust e2e-attest-python,just e2e-attest-ts,cargo test --workspace --features cliChangelog / Migrations
skip-changelogon the implementation commit: lint fixes in test code plus a CI invocation change, no observable behavior change