From c903db5c533b4c047bb47740deb85ebfd467bdcc Mon Sep 17 00:00:00 2001 From: mo8it Date: Fri, 16 Aug 2024 00:15:33 +0200 Subject: [PATCH] Add project lints --- Cargo.toml | 14 +++++++++++++- rustlings-macros/Cargo.toml | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4ce639b604..7e353d6edf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,6 +69,18 @@ panic = "abort" [package.metadata.release] pre-release-hook = ["./release-hook.sh"] +[workspace.lints.rust] +unsafe_code = "forbid" +unstable_features = "forbid" + +[workspace.lints.clippy] +empty_loop = "forbid" +infinite_loop = "deny" +mem_forget = "deny" +dbg_macro = "warn" +todo = "warn" # TODO: Remove after the following fix is released: https://github.com/rust-lang/rust-clippy/pull/13102 -[lints.clippy] needless_option_as_deref = "allow" + +[lints] +workspace = true diff --git a/rustlings-macros/Cargo.toml b/rustlings-macros/Cargo.toml index f5ecfcc266..8a85201856 100644 --- a/rustlings-macros/Cargo.toml +++ b/rustlings-macros/Cargo.toml @@ -19,3 +19,6 @@ proc-macro = true quote = "1.0.36" serde.workspace = true toml_edit.workspace = true + +[lints] +workspace = true