Skip to content

Commit

Permalink
chore: use universal set of lints across crates
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Nov 29, 2023
1 parent 7c3b8a5 commit bfac30c
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 21 deletions.
21 changes: 21 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ categories.workspace = true
members = ["crates/*"]
resolver = "2"

[workspace.lints.rust]
rust_2018_idioms = "warn"
# unsafe code is sometimes fine but in general we don't want to use it.
unsafe_code = "warn"
# clearly denote where you are using unsafe code in unsafe fns. in a future rust edition this will become a hard error.
unsafe_op_in_unsafe_fn = "forbid"

[workspace.lints.clippy]
all = "warn"
panic = "warn"
panic_in_result_fn = "warn"
panicking_unwrap = "warn"
unnecessary_wraps = "warn"

missing_errors_doc = "allow"
doc_markdown = "allow"
missing_panics_doc = "allow"
too_many_lines = "allow"
# you must provide a safety doc.
missing_safety_doc = "forbid"

[workspace.package]
version = "0.4.0"
authors = [
Expand Down
3 changes: 3 additions & 0 deletions crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
4 changes: 3 additions & 1 deletion crates/audio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ categories.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
[lints]
workspace = true

[dependencies]
rustysynth = "1.3.1"

strum.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ categories.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lints]
workspace = true

[dependencies]
luminol-audio.workspace = true
luminol-core.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ categories.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lints]
workspace = true

[dependencies]
rust-ini.workspace = true

Expand Down
3 changes: 3 additions & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ categories.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lints]
workspace = true

[dependencies]
egui.workspace = true

Expand Down
3 changes: 3 additions & 0 deletions crates/data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ categories.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lints]
workspace = true

[dependencies]
num-derive = "0.4.0"
num_enum = "0.7.0"
Expand Down
3 changes: 3 additions & 0 deletions crates/filesystem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ categories.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lints]
workspace = true

[dependencies]
rfd.workspace = true

Expand Down
3 changes: 3 additions & 0 deletions crates/graphics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ repository.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions crates/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ repository.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
3 changes: 3 additions & 0 deletions crates/modals/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ repository.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions crates/term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ repository.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions crates/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ repository.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions crates/web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
20 changes: 0 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,6 @@
// it with Steamworks API by Valve Corporation, containing parts covered by
// terms of the Steamworks API by Valve Corporation, the licensors of this
// Program grant you additional permission to convey the resulting work.
#![warn(rust_2018_idioms)]
#![warn(
clippy::all,
clippy::panic,
clippy::panic_in_result_fn,
clippy::panicking_unwrap,
clippy::unnecessary_wraps,
// unsafe code is sometimes fine but in general we don't want to use it.
unsafe_code,
)]
// These may be turned on in the future.
// #![warn(clippy::unwrap, clippy::pedantic)]
#![allow(
clippy::missing_errors_doc,
clippy::doc_markdown,
clippy::missing_panics_doc,
clippy::too_many_lines
)]
// You must provide a safety doc.
#![forbid(clippy::missing_safety_doc, unsafe_op_in_unsafe_fn)]
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release

#[cfg(target_arch = "wasm32")]
Expand Down

0 comments on commit bfac30c

Please sign in to comment.