Enable clippy and disallow duplicate crate versions#142
Open
ReinierMaas wants to merge 10 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables workspace-level Clippy linting (including denying multiple crate versions) and updates Rust + PyO3 binding code to satisfy the newly enforced lints without changing core functionality.
Changes:
- Enable workspace lints in member crates and deny
clippy::multiple_crate_versions, with an explicit allowlist inclippy.toml. - Update
just clippyto lint--all-targetsacross feature combinations so Clippy actually triggers consistently. - Apply widespread small refactors and documentation/attribute tweaks (e.g.,
#[must_use], explicit drops, select patterns, type conversions, doc clarifications) to resolve Clippy findings.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| opsqueue/src/tracing.rs | Adds #[must_use] and minor cleanup to satisfy Clippy. |
| opsqueue/src/server.rs | Adjusts router plumbing, shutdown handling, and Clippy suppressions/docs. |
| opsqueue/src/prometheus.rs | Adds lint allows/docs and minor numeric conversion cleanup for Clippy. |
| opsqueue/src/producer/server.rs | Doc/comment cleanup and minor match tightening for lint compliance. |
| opsqueue/src/producer/client.rs | Adds docs/#[must_use], refines retry logic and option handling per Clippy. |
| opsqueue/src/object_store/mod.rs | Refines error imports, stream API, and adds docs/#[must_use]. |
| opsqueue/src/lib.rs | Marks version_info() as #[must_use] and adjusts doc link formatting. |
| opsqueue/src/db/mod.rs | Adds docs/#[must_use], improves logging, and refactors for Clippy. |
| opsqueue/src/db/conn.rs | Narrows imports to satisfy linting. |
| opsqueue/src/consumer/strategy.rs | Refines imports/formatting and updates test formatting per Clippy. |
| opsqueue/src/consumer/server/state.rs | Adds #[must_use] and clarifying docs for error/panic behavior. |
| opsqueue/src/consumer/server/mod.rs | Adds docs/#[must_use] and minor metric recording statement fixes. |
| opsqueue/src/consumer/server/conn.rs | Refactors match arms/imports and adds docs/#[must_use]. |
| opsqueue/src/consumer/dispatcher/reserver.rs | Tweaks defaults/types for metrics and tokio::select! patterns. |
| opsqueue/src/consumer/dispatcher/mod.rs | Refactors reservation flow to satisfy stream/lint constraints. |
| opsqueue/src/consumer/dispatcher/metastate.rs | Adjusts APIs to pass Copy values by value and adds docs/#[must_use]. |
| opsqueue/src/consumer/common.rs | Doc formatting improvements for Rustdoc links/code formatting. |
| opsqueue/src/consumer/client.rs | Clarifies docs, refines control flow, and updates tests for lint compliance. |
| opsqueue/src/config.rs | Doc formatting tweaks and adds docs/#[must_use] on helper APIs. |
| opsqueue/src/common/submission.rs | Adds docs/#[must_use], refactors branches/logging, and updates conversions for Clippy. |
| opsqueue/src/common/mod.rs | Adds docs and refines invariants documentation for MaxSubmissions. |
| opsqueue/src/common/chunk.rs | Doc formatting cleanup and adds docs/#[must_use] on constructors/helpers. |
| opsqueue/Cargo.toml | Enables workspace lints via [lints] workspace = true. |
| opsqueue/app/main.rs | Minor control-flow / select pattern refinements and adds runtime docs. |
| libs/opsqueue_python/src/producer.rs | Renames field, adds extensive error docs, and refactors chunk streaming glue. |
| libs/opsqueue_python/src/errors.rs | Doc formatting improvements for PyErr-related text. |
| libs/opsqueue_python/src/consumer.rs | Adds error docs and minor lint suppressions for bindings. |
| libs/opsqueue_python/src/common.rs | Doc additions, small refactors, and runtime/docs improvements. |
| libs/opsqueue_python/src/async_util.rs | Doc formatting tweaks and clearer PyO3 wording. |
| libs/opsqueue_python/Cargo.toml | Enables workspace lints via [lints] workspace = true. |
| justfile | Ensures Clippy runs with --all-targets across feature sets. |
| clippy.toml | Adds allowed-duplicate-crates allowlist supporting multiple_crate_versions = deny. |
| Cargo.toml | Denies clippy::multiple_crate_versions at workspace lint level. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The AI caught it this time, let's enforce it using something more stable.
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.
The current set of duplicated crates is whitelisted. This set of duplicated dependencies can be reduced in an upcoming PR instead. When I wanted to run
just clippyI discovered it was never enabled in the repository due to it not triggering. This was because of a missing boolean in the specificCargo.tomls....