Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Move lint configuration from .cargo/config.toml to Cargo.toml #14614

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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`
]
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions core/build_playerglobal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions core/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true
version.workspace = true

[lints]
workspace = true

[lib]
proc-macro = true

Expand Down
3 changes: 3 additions & 0 deletions desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true
version.workspace = true

[lints]
workspace = true

[dependencies]
ruffle_wstr = { path = "../wstr" }
swf = { path = "../swf"}
Expand Down
3 changes: 3 additions & 0 deletions render/canvas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions render/naga-agal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true
version.workspace = true

[lints]
workspace = true

[dependencies]
bitflags = "2.4.1"
naga = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions render/naga-pixelbender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true
version.workspace = true

[lints]
workspace = true

[dependencies]
ruffle_render = { path = "../" }
naga = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions render/webgl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions render/wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
3 changes: 3 additions & 0 deletions ruffle_gc_arena/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
3 changes: 3 additions & 0 deletions scanner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
3 changes: 3 additions & 0 deletions swf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
3 changes: 3 additions & 0 deletions tests/input-format/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions tests/mocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
3 changes: 3 additions & 0 deletions tests/socket-format/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions video/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true
version.workspace = true

[lints]
workspace = true

[dependencies]
swf = { path = "../swf" }
ruffle_render = { path = "../render" }
Expand Down
3 changes: 3 additions & 0 deletions video/software/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true
version.workspace = true

[lints]
workspace = true

[dependencies]
ruffle_render = { path = "../../render" }
ruffle_video = { path = ".." }
Expand Down
3 changes: 3 additions & 0 deletions web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
3 changes: 3 additions & 0 deletions web/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Ruffle LLC <[email protected]>"]
edition.workspace = true
license = "MIT OR Apache-2.0"

[lints]
workspace = true

[dependencies]
js-sys = "0.3.66"
tracing = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions web/packages/extension/safari/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions wstr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ homepage.workspace = true
license.workspace = true
repository.workspace = true
version.workspace = true

[lints]
workspace = true