From 6ddd2fb8698f6f574204dddb506f6b63cfc6be40 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 28 Oct 2026 06:02:28 +0000 Subject: [PATCH] Enforce workspace Clippy standards and document lint policy --- CLAUDE.md | 4 ++++ Cargo.toml | 4 +++- clippy.toml | 1 + xtask/Cargo.toml | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 67853ff0..aae6e13f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -3,6 +3,10 @@ Read [AGENTS.md](AGENTS.md) first: its rules (asset policy, clean room, never crash) bind you and win over anything here. +New workspace crates must include `[lints] workspace = true` in `Cargo.toml` to inherit +`[workspace.lints]`. Production crate roots must declare the required crate-level lint attributes +before modules or other crate items; crate-level `//!` documentation may precede them. + ## Start every session 1. Read `plan/STATUS.md`, then the current milestone in `plan/execution-plan.md`. 2. Read `../../craftrules/AGENTS.md` and the standards it lists for your task. diff --git a/Cargo.toml b/Cargo.toml index d9b947c4..8d46cd43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,9 +80,11 @@ arboard = { version = "3.6", default-features = false } unsafe_code = "forbid" [workspace.lints.clippy] +cognitive_complexity = "deny" +too_many_arguments = "deny" +wildcard_imports = "deny" dbg_macro = "warn" todo = "warn" -too_many_arguments = "allow" type_complexity = "allow" self_named_constructors = "allow" large_enum_variant = "allow" diff --git a/clippy.toml b/clippy.toml index 287e14ed..3522a15b 100644 --- a/clippy.toml +++ b/clippy.toml @@ -5,3 +5,4 @@ allow-indexing-slicing-in-tests = true disallowed-types = [ { path = "egui::ComboBox", reason = "use craft_ui::ComboBox: egui's combo box menu can't grow back while open (egui#5225)" }, ] +cognitive-complexity-threshold = 30 diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index df7dfa87..6d935ae8 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -5,5 +5,8 @@ edition.workspace = true license.workspace = true publish = false +[lints] +workspace = true + [dependencies] serde_json = { workspace = true }