You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rust pack: seed unwrap_used/expect_used lint levels and document the test-helper exemption #2103
The pack seeds clippy.toml with "unwrap/expect allowed in tests", and the crate lints unsafe_code = forbid, missing_docs = warn and clippy::all. But the lint levelsclippy::unwrap_used / clippy::expect_used aren't in the seeded workspace [lints] table. So clippy.toml's test allowance has nothing to relax, and shipped code can still unwrap() freely.
Also, allow-unwrap-in-tests / allow-expect-in-tests cover only #[test] functions. Helpers in integration-test files, test-only binaries and proptest strategy modules are flagged once the lints are on. Every adopter then writes the same file-level allow.
Found while adopting devkit 1.19.2 in a private workspace (2026-12-01).
Proposal
Seed [workspace.lints.clippy] with unwrap_used = "warn" and expect_used = "warn". CI's clippy -D warnings makes them errors.
Document the standard exemption for test helpers and dev binaries in the pack: a file-level #![allow(clippy::unwrap_used, clippy::expect_used)] with a one-line reason. Or have the seeded crate template put it into tests/*.rs helpers from the start.
Make sure every workspace member gets [lints] workspace = true when it's scaffolded or detected, so the table applies.
Acceptance
A new adopter's library code with .unwrap() fails CI.
Test helpers following the documented pattern don't fail it.
Activity