Repository navigation
Conversation
Each library crate (eggshell-ui, eggshell-ui-shadcn, eggshell-ui-extras) denies, outside cfg(test), clippy's panic, unwrap_used, expect_used, unreachable, todo, unimplemented, panic_in_result_fn, unwrap_in_result, get_unwrap, string_slice, indexing_slicing and unchecked_time_subtraction, plus disallowed_macros and disallowed_methods. clippy.toml disallows the assert and debug_assert macros, f32/f64/Ord clamp, the panicking Duration float constructors and arithmetic, and Mutex::lock. The workspace lints table allows the two disallowed lints, so tests, examples and benches keep using assertions; only the library crates' attributes deny them. The remaining hits, fixed without a behaviour change: - Mutex::lock goes through one poison-tolerant helper, sync::lock, the pattern the three call sites already spelled out. - arc_segments clamps through finite::clamp (constant bounds, same result). - The tooltip delay subtracts with saturating_sub; zero remaining is the waited >= delay case it replaces. - The compile-time assertion in tw::merge carries an #[expect]: it fails the build, never a run. Fixes #289 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
clippy::fn_params_excessive_bools (pedantic) is denied in the library crates with max-fn-params-bools = 1: a sole, self-describing bool is allowed, a second one is not. No function in the libraries has two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up
Owner
Author
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.
Part of #279. Fixes #289.
What
Each library crate (
eggshell-ui,eggshell-ui-shadcn,eggshell-ui-extras) denies these lints in itslib.rs, under#![cfg_attr(not(test), deny(...))]:clippy::panic,unwrap_used,expect_used,unreachable,todo,unimplemented,panic_in_result_fn,unwrap_in_result,get_unwrap,string_slice,indexing_slicing,unchecked_time_subtraction,disallowed_macros,disallowed_methodsandfn_params_excessive_bools.clippy.toml:max-fn-params-bools = 1: one bool parameter is allowed, a second is denied.disallowed-macros:assert!,assert_eq!,assert_ne!,debug_assert!,debug_assert_eq!anddebug_assert_ne!. The reason text points toreport, or toProblem::Internal.disallowed-methods:f32::clamp,f64::clampandOrd::clamp(usefinite::clamp); theDurationmethodsfrom_secs_f32,from_secs_f64,mul_f32,mul_f64,div_f32anddiv_f64(usetry_from_secs_*); andMutex::lock(usesync::lock).Why a crate attribute and not only
[lints]: Cargo's lint table applies to every target and can't exemptcfg(test). Integration tests, examples, benches and doctests are separate crates, so the library's attributes don't reach them. Unit tests are exempt throughnot(test). The twodisallowed_*lints warn by default, so[workspace.lints.clippy]sets them toallow(every member useslints.workspace = true). Without that, tests usingassert!would fail under-D warnings. The library crates deny them again in their attributes.cargo xtask cialready runsclippy --workspace --all-targets -- -D warnings, and the CI workflow runscargo xtask ci, so neither needed a change.Hits fixed (no behaviour change)
Mutex::lock(3 sites): thelock().unwrap_or_else(PoisonError::into_inner)pattern moved into one helper,src/sync.rs::lock. It is the only place that carries an#[expect].Ord::clamp(4, 32)inshadow_corners::arc_segmentsnow usesfinite::clamp. The result is the same;max().min()would tripmanual_clamp.delay - waitedintooltip.rsis nowdelay.saturating_sub(waited). A zero result is thewaited >= delaycase it replaces.const _: () = assert!(…)intw/merge.rsgets an#[expect(clippy::disallowed_macros)], because it fails the build, never a run.fn_params_excessive_bools: 0 hits.The
#[expect(clippy::panic)]exemptions WP7 put intesting.rsandcontinuity.rsstill compile.Gate check
In a scratch commit that was not pushed, an added
Some(1).unwrap()insrc/sync.rsmadecargo xtask cifail its clippy step (exit 1) withclippy::unwrap_used, at the lint level set insrc/lib.rs.Adding a justified exemption
Put
#[expect(clippy::<lint>, reason = "…")]on the narrowest item or statement that needs it, never on a module or the crate. Use#[expect], not#[allow]: an exemption that is no longer needed then fails the build.🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKe8zfqGfVMCSC5L3up