diff --git a/.cargo/config.toml b/.cargo/config.toml index 4ef3189b2a02..d8d37cba3291 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,20 +4,4 @@ rustflags = [ # We need to specify this flag for all targets because Clippy checks all of our code against all targets # and our web code does not compile without this flag "--cfg=web_sys_unstable_apis", - - # CLIPPY LINT SETTINGS - # This is a workaround to configure lints for the entire workspace, pending the ability to configure this via TOML. - # See: https://github.com/rust-lang/cargo/issues/5034 - # https://github.com/EmbarkStudios/rust-ecosystem/issues/22#issuecomment-947011395 - # TODO: Move these to the root Cargo.toml once support is merged and stable - # See: https://github.com/rust-lang/cargo/pull/12148 - - # Clippy nightly often adds new/buggy lints that we want to ignore. - # Don't warn about these new lints on stable. - "-Arenamed_and_removed_lints", - "-Aunknown_lints", - - # LONG-TERM: These lints are unhelpful. - "-Aclippy::manual_map", # Less readable: Suggests `opt.map(..)` instsead of `if let Some(opt) { .. }` - "-Aclippy::manual_range_contains", # Less readable: Suggests `(a..b).contains(n)` instead of `n >= a && n < b` ] diff --git a/Cargo.toml b/Cargo.toml index 77f3fb4187ee..70270f65d1b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,17 @@ naga_oil = "0.11.0" wgpu = "0.18.0" egui = "0.24.1" +[workspace.lints.rust] +# Clippy nightly often adds new/buggy lints that we want to ignore. +# Don't warn about these new lints on stable. +renamed_and_removed_lints = "allow" +unknown_lints = "allow" + +[workspace.lints.clippy] +# LONG-TERM: These lints are unhelpful. +manual_map = "allow" # Less readable: Suggests `opt.map(..)` instsead of `if let Some(opt) { .. }` +manual_range_contains = "allow" # Less readable: Suggests `(a..b).contains(n)` instead of `n >= a && n < b` + # Don't optimize build scripts and macros. [profile.release.build-override] opt-level = 0 diff --git a/core/Cargo.toml b/core/Cargo.toml index f520fc9675e7..39e9d393512e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] linkme = { version = "0.3", optional = true } byteorder = "1.5" diff --git a/core/build_playerglobal/Cargo.toml b/core/build_playerglobal/Cargo.toml index f263b4c954c0..c6d361907201 100644 --- a/core/build_playerglobal/Cargo.toml +++ b/core/build_playerglobal/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] convert_case = "0.6.0" proc-macro2 = "1.0.73" diff --git a/core/macros/Cargo.toml b/core/macros/Cargo.toml index 5d4638cb027a..6134d8edebd3 100644 --- a/core/macros/Cargo.toml +++ b/core/macros/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [lib] proc-macro = true diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index 8f69839d0335..4fa56e52d4be 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] clap = { version = "4.4.12", features = ["derive"] } cpal = "0.15.2" diff --git a/exporter/Cargo.toml b/exporter/Cargo.toml index 60cf9b9c799d..e027b8038a92 100644 --- a/exporter/Cargo.toml +++ b/exporter/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] clap = { version = "4.4.12", features = ["derive"] } futures = "0.3" diff --git a/render/Cargo.toml b/render/Cargo.toml index 8bdeb655479d..dff87c297f62 100644 --- a/render/Cargo.toml +++ b/render/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] ruffle_wstr = { path = "../wstr" } swf = { path = "../swf"} diff --git a/render/canvas/Cargo.toml b/render/canvas/Cargo.toml index 3a18983a734f..d4a1bf07c62d 100644 --- a/render/canvas/Cargo.toml +++ b/render/canvas/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] js-sys = "0.3.66" log = "0.4" diff --git a/render/naga-agal/Cargo.toml b/render/naga-agal/Cargo.toml index 96d93209554a..779fdfb00c7b 100644 --- a/render/naga-agal/Cargo.toml +++ b/render/naga-agal/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] bitflags = "2.4.1" naga = { workspace = true } diff --git a/render/naga-pixelbender/Cargo.toml b/render/naga-pixelbender/Cargo.toml index 37c843d67e8a..0d380e203928 100644 --- a/render/naga-pixelbender/Cargo.toml +++ b/render/naga-pixelbender/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] ruffle_render = { path = "../" } naga = { workspace = true } diff --git a/render/webgl/Cargo.toml b/render/webgl/Cargo.toml index 6c8c2d331ca2..28717e76a17a 100644 --- a/render/webgl/Cargo.toml +++ b/render/webgl/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] js-sys = "0.3.66" log = "0.4" diff --git a/render/wgpu/Cargo.toml b/render/wgpu/Cargo.toml index f9dd98be52f7..82e23a66a224 100644 --- a/render/wgpu/Cargo.toml +++ b/render/wgpu/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] wgpu = { workspace = true, features = ["naga"] } tracing = { workspace = true } diff --git a/ruffle_gc_arena/Cargo.toml b/ruffle_gc_arena/Cargo.toml index 3a8719af18f1..8b8dae5fed02 100644 --- a/ruffle_gc_arena/Cargo.toml +++ b/ruffle_gc_arena/Cargo.toml @@ -8,5 +8,8 @@ homepage.workspace = true license.workspace = true repository.workspace = true +[lints] +workspace = true + [dependencies] gc-arena = { git = "https://github.com/kyren/gc-arena", rev = "efd89fc683c6bb456af3e226c33763cb822645e9", features = ["hashbrown"] } diff --git a/scanner/Cargo.toml b/scanner/Cargo.toml index 59c31c64bd60..fde87d9e839b 100644 --- a/scanner/Cargo.toml +++ b/scanner/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] clap = { version = "4.4.12", features = ["derive"] } ruffle_core = { path = "../core", features = ["deterministic"] } diff --git a/swf/Cargo.toml b/swf/Cargo.toml index b67e5bd4b285..6d85d4081ae9 100644 --- a/swf/Cargo.toml +++ b/swf/Cargo.toml @@ -8,6 +8,9 @@ homepage.workspace = true license.workspace = true repository.workspace = true +[lints] +workspace = true + [dependencies] bitflags = "2.4.1" bitstream-io = "2.2.0" diff --git a/tests/Cargo.toml b/tests/Cargo.toml index e1d90e3430b0..028e01e542b2 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [features] # Enable running image comparison tests. This is off by default, # since the images we compare against are generated on CI, and may diff --git a/tests/framework/Cargo.toml b/tests/framework/Cargo.toml index 4821a3e7a623..c7e4163995ee 100644 --- a/tests/framework/Cargo.toml +++ b/tests/framework/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] futures = "0.3.30" ruffle_core = { path = "../../core", features = ["deterministic", "timeline_debug", "avm_debug", "audio", "mp3", "default_font"] } diff --git a/tests/input-format/Cargo.toml b/tests/input-format/Cargo.toml index ca50bf0d2bed..a86a13f5183b 100644 --- a/tests/input-format/Cargo.toml +++ b/tests/input-format/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] serde = { version = "1.0.193", features = ["derive"] } serde_json = "1.0.109" diff --git a/tests/mocket/Cargo.toml b/tests/mocket/Cargo.toml index ee308ba6cfcd..9c29f980b4f3 100644 --- a/tests/mocket/Cargo.toml +++ b/tests/mocket/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] anyhow = "1.0.78" clap = { version = "4.4.12", features = ["derive"] } diff --git a/tests/socket-format/Cargo.toml b/tests/socket-format/Cargo.toml index 4484d7682169..8a7465096cc0 100644 --- a/tests/socket-format/Cargo.toml +++ b/tests/socket-format/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] serde = { version = "1.0.193", features = ["derive"] } serde_json = "1.0.109" diff --git a/video/Cargo.toml b/video/Cargo.toml index aaccbc9eccd8..ba0e0ab2337d 100644 --- a/video/Cargo.toml +++ b/video/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] swf = { path = "../swf" } ruffle_render = { path = "../render" } diff --git a/video/software/Cargo.toml b/video/software/Cargo.toml index 023878d4289e..f698b9985a3e 100644 --- a/video/software/Cargo.toml +++ b/video/software/Cargo.toml @@ -7,6 +7,9 @@ license.workspace = true repository.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] ruffle_render = { path = "../../render" } ruffle_video = { path = ".." } diff --git a/web/Cargo.toml b/web/Cargo.toml index 558d3c84fafd..cb09a69de533 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true version.workspace = true publish = false # This crate is useless alone, people should use the npm package +[lints] +workspace = true + [lib] crate-type = ["cdylib", "rlib"] diff --git a/web/common/Cargo.toml b/web/common/Cargo.toml index 0d24192d493f..49a188ce461a 100644 --- a/web/common/Cargo.toml +++ b/web/common/Cargo.toml @@ -5,6 +5,9 @@ authors = ["Ruffle LLC "] edition.workspace = true license = "MIT OR Apache-2.0" +[lints] +workspace = true + [dependencies] js-sys = "0.3.66" tracing = { workspace = true } diff --git a/web/packages/extension/safari/Cargo.toml b/web/packages/extension/safari/Cargo.toml index a4b5bddc0516..c988d7764ee7 100644 --- a/web/packages/extension/safari/Cargo.toml +++ b/web/packages/extension/safari/Cargo.toml @@ -9,5 +9,8 @@ repository.workspace = true version.workspace = true publish = false # This crate is useless unless packaged into an appex bundle +[lints] +workspace = true + [dependencies] objc = "0.2.7" diff --git a/wstr/Cargo.toml b/wstr/Cargo.toml index fb57274b8b9f..0b166ea71389 100644 --- a/wstr/Cargo.toml +++ b/wstr/Cargo.toml @@ -6,3 +6,6 @@ homepage.workspace = true license.workspace = true repository.workspace = true version.workspace = true + +[lints] +workspace = true