From 83743de29347fad610f187fd2b22bbe8e4e75b1a Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 19 Apr 2026 20:43:23 -0400 Subject: [PATCH] chore(clippy): add unwrap-used baseline Enable clippy's unwrap_used lint at warn level, document the long-term policy carveouts for tests and LockResult, and localize the generated OpenAPI client exemption so the remaining warning surface is real repo code. --- Cargo.toml | 1 + clippy.toml | 2 ++ lib/crates/fabro-api/src/lib.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 16e756ec8..cb735d3c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,6 +106,7 @@ empty_structs_with_brackets = "warn" disallowed_methods = "deny" exit = "warn" get_unwrap = "warn" +unwrap_used = "warn" rc_buffer = "warn" rc_mutex = "warn" rest_pat_in_fully_bound_structs = "warn" diff --git a/clippy.toml b/clippy.toml index 0bca55679..0a19186f3 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,5 +1,7 @@ absolute-paths-max-segments = 2 absolute-paths-allowed-crates = ["std", "core", "alloc"] +allow-unwrap-in-tests = true +allow-unwrap-types = ["std::sync::LockResult"] disallowed-methods = [ { path = "std::thread::sleep", reason = "Prefer tokio::time::sleep on Tokio paths; document intentional blocking sleeps with #[expect(clippy::disallowed_methods, reason = \"...\")]", replacement = "tokio::time::sleep" }, { path = "std::thread::spawn", reason = "Prefer Tokio task APIs on async paths; document intentional dedicated OS threads with #[expect(clippy::disallowed_methods, reason = \"...\")]" }, diff --git a/lib/crates/fabro-api/src/lib.rs b/lib/crates/fabro-api/src/lib.rs index 26c550ba2..86ba4c414 100644 --- a/lib/crates/fabro-api/src/lib.rs +++ b/lib/crates/fabro-api/src/lib.rs @@ -5,6 +5,7 @@ clippy::disallowed_methods, clippy::disallowed_types, clippy::needless_lifetimes, + clippy::unwrap_used, unreachable_pub, unused_imports, reason = "Generated OpenAPI client code intentionally preserves codegen output."