From 301ad8ebafd2bdc8fede7336416a038178578f01 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Wed, 6 Dec 2023 14:39:33 +0100 Subject: [PATCH] Lint against leftover dbg/todo macros only in CI --- .cargo/config.toml | 2 -- crates/infra/utils/src/cargo/workspace.rs | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 4008ad84ab..1bdce1cd79 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -18,8 +18,6 @@ rustflags = [ # 📎 Lints that are enabled (warn/deny) by default "-Wclippy::all", # Restriction (optional, neutral lints) - "-Wclippy::dbg_macro", # Lint against leftover `dbg!` macros - "-Wclippy::todo", # Lint against leftover `todo!` macros "-Wclippy::exit", # Prefer not `process::exit`ing directly "-Wclippy::rest_pat_in_fully_bound_structs", # Prefer not to use `..` in fully bound structs "-Wclippy::verbose_file_reads", # Prefer simpler and more concise `fs::read_to_string` diff --git a/crates/infra/utils/src/cargo/workspace.rs b/crates/infra/utils/src/cargo/workspace.rs index b4174b839d..7fc425bd56 100644 --- a/crates/infra/utils/src/cargo/workspace.rs +++ b/crates/infra/utils/src/cargo/workspace.rs @@ -112,7 +112,13 @@ impl CargoWorkspace { "--config", format!( "build.rustflags = {rustflags}", - rustflags = serde_json::to_string(&["--deny", "warnings"])?, + rustflags = serde_json::to_string(&[ + "--deny", + "warnings", + // Lint against leftover `dbg/todo!` macros in CI: + "-Wclippy::dbg_macro", + "-Wclippy::todo" + ])?, ), ); }