chore(lint): clear all deny-level clippy findings across the workspace - #1885
Merged
Conversation
`correctness` and `suspicious` are deny-level in `[workspace.lints.clippy]`, but several crates failed to compile under `--all-targets`, so clippy short-circuited before reaching them. Fixing the compile blockers exposed a backlog of hard errors that CI would reject. Compile blockers: - relay-server `library_compat` test: `AppState` initializer had fallen behind the struct (missing `page_browser_auth`), and `let _ = server_info();` built an unpolled future instead of pinning the symbol. - rmcp API drift: `SseStream::from_byte_stream` -> `from_bytes_stream`. Deny-level fixes: - `await_holding_lock` (25): the subscription-auth and account-context test serialization locks now use `tokio::sync::Mutex` (matching the existing `store_lock` precedent); the remaining sites scope their guard in a block so it is provably released before the await. Explicit `drop()` did not satisfy the lint, which reasons over lexical scope. - `suspicious_open_options`: the json-store lock file now states `truncate(false)` — it must never be truncated while another process holds the flock on that inode. - `items_after_test_module`, `never_loop`, `octal_escapes`, `unnecessary_get_then_check`, `drop_non_drop`. Also documents the previously undocumented `unsafe` blocks in the SSH plugin source, terminal exec, and webdriver capture/evaluator paths, and records why `client_info` keeps advertising the SEP-2577-deprecated `roots`/`sampling` capabilities: dropping them is a protocol-visible change pinned by an existing contract test, not a lint cleanup. `stat_local_path_metadata` keeps its expanded symlink check behind an explicit `#[allow]`: clippy only sees the `#[cfg(not(windows))]` arm and would collapse away the Windows reparse-point detection. No behavior change otherwise. Remaining warnings (`too_many_arguments`, `large_enum_variant`, `type_complexity`, and the macOS accessibility FFI's undocumented `unsafe` blocks) need design judgment and are left alone.
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.
Why
[workspace.lints.clippy]setscorrectnessandsuspiciousto deny, but several crates fail to compile undercargo clippy --workspace --all-targets. Clippy short-circuits on the first compile error, so it never reached those crates — which had accumulated a backlog of hard errors that a green--all-targetsrun would reject.cargo clippy --workspace --all-targetsnow reports 0 errors.Compile blockers
relay-server/tests/library_compat.rs: theAppStateinitializer had fallen behind the struct (missingpage_browser_auth), andlet _ = routes::api::server_info();built an unpolled future instead of pinning the symbol.SseStream::from_byte_stream→from_bytes_stream.Deny-level fixes
await_holding_lock(25 sites). The subscription-auth and account-context test serialization locks now usetokio::sync::Mutex, matching thestore_lockprecedent already in the same file; the plain#[test]cases take them withblocking_lock, which cannot stall without an ambient runtime. The remaining sites scope their guard in a block. Note that an explicitdrop(guard)before the await does not satisfy this lint — it reasons over lexical scope.suspicious_open_options. The json-store lock file now statestruncate(false): it carries no payload and must never be truncated while another process holds theflockon that inode.items_after_test_module,never_loop,octal_escapes,unnecessary_get_then_check,drop_non_drop, plus the mechanicalstyle/complexity/perffixes fromclippy --fixin the crates that were previously unreachable.Two judgment calls worth a look
client_info.rskeeps advertising the SEP-2577-deprecatedroots/samplingcapabilities behind a scoped#[allow(deprecated)]with the rationale recorded inline. Dropping them is a protocol-visible behavior change pinned bymcp_remote_client_info_declares_supported_client_capabilities, not a lint cleanup.stat_local_path_metadatakeeps its expanded symlink check behind#[allow(clippy::needless_bool)]. Clippy only sees the#[cfg(not(windows))] { false }arm and would otherwise collapse away the Windows reparse-point detection — a silent platform regression.Scope
Unsafe blocks in the SSH plugin source, terminal exec, and webdriver capture/evaluator paths are now documented. No behavior change anywhere else.
Left alone deliberately, since they need design judgment rather than a mechanical fix:
too_many_arguments,large_enum_variant,type_complexity, and the ~195 undocumentedunsafeblocks in the macOS accessibility FFI underdesktop/src/computer_use/macos_*.