clean up the clippy.toml:s (#7594)

This commit is contained in:
Emil Ernerfeldt 2025-10-07 14:12:51 +02:00 committed by GitHub
parent 0281b95bd9
commit 78fffc7707
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 20 deletions

View File

@ -35,17 +35,13 @@ disallowed-macros = [
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
disallowed-methods = [ disallowed-methods = [
"std::env::temp_dir", # Use the tempdir crate instead # NOTE: There are many things that aren't allowed on wasm,
# There are many things that aren't allowed on wasm,
# but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406) # but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406)
# so we do that in `clipppy_wasm.toml` instead. # so we do that in `clipppy_wasm.toml` instead.
"std::thread::spawn", # Use `std::thread::Builder` and name the thread { path = "std::env::temp_dir", readon = "Use the tempdir crate instead" },
{ path = "std::panic::catch_unwind", reason = "We compile with `panic = abort" },
"sha1::Digest::new", # SHA1 is cryptographically broken { path = "std::thread::spawn", readon = "Use `std::thread::Builder` and name the thread" },
"std::panic::catch_unwind", # We compile with `panic = "abort"`
] ]
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names
@ -53,14 +49,12 @@ disallowed-names = []
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
disallowed-types = [ disallowed-types = [
# Use the faster & simpler non-poisonable primitives in `parking_lot` instead { path = "std::sync::Condvar", reason = "Use parking_lot instead" },
"std::sync::Mutex", { path = "std::sync::Mutex", reason = "Use epaint::mutex instead" },
"std::sync::RwLock", { path = "std::sync::RwLock", reason = "Use epaint::mutex instead" },
"std::sync::Condvar", { path = "winit::dpi::LogicalPosition", reason = "We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account" },
{ path = "winit::dpi::LogicalSize", reason = "We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account" },
# "std::sync::Once", # enabled for now as the `log_once` macro uses it internally # "std::sync::Once", # enabled for now as the `log_once` macro uses it internally
"winit::dpi::LogicalSize", # We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account
"winit::dpi::LogicalPosition", # We do our own pixels<->point conversion, taking `egui_ctx.zoom_factor` into account
] ]
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -26,12 +26,11 @@ type-complexity-threshold = 350
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
disallowed-methods = [ disallowed-methods = [
"std::time::Instant::now", # use `instant` crate instead for wasm/web compatibility { path = "std::time::Instant::elapsed", reason = "use `instant` crate instead for wasm/web compatibility" },
"std::time::Duration::elapsed", # use `instant` crate instead for wasm/web compatibility { path = "std::time::Instant::now", reason = "use `instant` crate instead for wasm/web compatibility" },
"std::time::SystemTime::now", # use `instant` or `time` crates instead for wasm/web compatibility { path = "std::time::SystemTime::now", reason = "use `instant` or `time` crates instead for wasm/web compatibility" },
# Cannot spawn threads on wasm: { path = "std::thread::spawn", reason = "Cannot spawn threads on wasm" },
"std::thread::spawn",
] ]
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types # https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types