From b3ff568bd4f0b5a8e5c365136dd5bd41dbee281c Mon Sep 17 00:00:00 2001 From: nutcas3 Date: Wed, 29 Apr 2026 04:21:33 +0300 Subject: [PATCH] feat: Add workspace-level linting rules and cargo-audit configuration - Add cargo-audit metadata section with placeholder for ignored advisories - Forbid unsafe_code at workspace level - Enable all and pedantic clippy warnings - Deny unwrap_used, expect_used, and panic to enforce error handling - Add thiserror dependency to charging-engine for improved error handling --- Cargo.toml | 14 ++++++++++++++ apps/charging-engine/Cargo.toml | 1 + 2 files changed, 15 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index e25e9fc..d4630ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,20 @@ edition = "2021" rust-version = "1.94" license = "MIT" +[workspace.metadata.cargo-audit] +# Ignore advisories that are not relevant to this project +# advisories = [] + +[workspace.lints.rust] +unsafe_code = "forbid" + +[workspace.lints.clippy] +all = "warn" +pedantic = "warn" +unwrap_used = "deny" +expect_used = "deny" +panic = "deny" + [workspace.dependencies] # Async runtime tokio = { version = "1.52.1", features = ["full"] } diff --git a/apps/charging-engine/Cargo.toml b/apps/charging-engine/Cargo.toml index ea8d4b6..44f2c13 100644 --- a/apps/charging-engine/Cargo.toml +++ b/apps/charging-engine/Cargo.toml @@ -25,6 +25,7 @@ serde_json = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } anyhow = { workspace = true } +thiserror = "2.0.18" dotenv = { workspace = true } uuid = { workspace = true } jsonwebtoken = "10.3.0"