From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12C1E211A35 for ; Sat, 18 Oct 2025 02:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760754741; cv=none; b=G6enVagTD3hXaogTE5PAUJlGJljOncYranbl6yPJfN14HbyNaoEdywP6q9hUjCT47ZPoQljBgGV8Jxeys4D3jOv1Bj0U3JeMkqPNrju4eyb2Vgu+A3qOQOddizFtZ2gm1yk6e3j0Frc812p09PPMYYnRNa6s7Enqdw0gqKsG5Dg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760754741; c=relaxed/simple; bh=vpvcFPFqW33rwEDiNq6G1tf93KlZAICPdMKhrKUd7R0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QTUTTXLT0T0aixuhln6q488GPiuqXS+ml46Y5kS/O/pibIVL3JaN+AcSZ9kq2dHJ7/pjQ5Z/heazZeZVUiL4425I2oLGuRXc5F+ZzLsLLCa4Vtc/lMLYSvXKrgSNpV9YEu4I6BUXcN47XaloUsMwBed0gr6z+zpoP9fzuwdHYTE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=IRiRUyux; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="IRiRUyux" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description; bh=N1+Mro8lcZ/5WXcAGjtkWIFelbIm1ZUYWfqG+aJA1PM=; b=IRiRUyuxXM5NPgRmf4QuyxDT/J AbC/nF+s/ezV6Yypzmsh1+hC+yVEvlyvvDZEz9CpOkLplCZqftbTpdtJ4AoY818ehv4WlAJiSFZDw q6/D2I/1OgxdU8W92cBx1wdptku36VIlTGnmXRxJFpv91c6SCxL+7Z9qOMUKMZEMhMg9Lz6ilGsGy TpX/fOHcjZanimtWGDEGX4oqTtiAuqoIdGQCOAPv8yNJf7Wy6WHbLPBO639NfbVD/iT/rh7IvR7eR zj6fCmOIoY4k9UQobYNSSH26U7tW+R1GTzxccjiD9/A/FXK7Wb9aragpsrSPHe2dKNK1GUGGpHmtJ a40FjGhg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9wjz-00000009Ons-2iBY; Sat, 18 Oct 2025 02:32:19 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 2/5] CLAUDE.md: Add Rust code quality requirements Date: Fri, 17 Oct 2025 19:32:14 -0700 Message-ID: <20251018023218.2240269-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251018023218.2240269-1-mcgrof@kernel.org> References: <20251018023218.2240269-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain Document mandatory use of cargo fmt and cargo clippy for all Rust code in kdevops workflows. This ensures consistent code quality and adherence to Linux kernel Rust standards. Quality checklist for Rust code: - cargo fmt: Auto-format using .rustfmt.toml configuration - cargo clippy: Lint with -D warnings (treat warnings as errors) - Fix all clippy warnings before committing Common clippy fixes include removing unnecessary casts, using .flatten() instead of manual if let Ok patterns, and removing unused imports. Generated-by: Claude AI Signed-off-by: Luis Chamberlain --- CLAUDE.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index a72836a2..1ca86b9e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -481,6 +481,28 @@ The style checker will identify: Fix all reported issues before submitting your work. The `make style` command checks both file whitespace and the most recent commit message format. +### Rust Code Quality + +For Rust code in kdevops (workflows/rcloud, etc.), ALWAYS run both: + +```bash +# Format code using Linux kernel rustfmt standards +cargo fmt + +# Check for common mistakes and idioms +cargo clippy --all-targets --all-features -- -D warnings +``` + +**Rust Quality Checklist**: +- ✅ Run `cargo fmt` to auto-format code according to .rustfmt.toml +- ✅ Run `cargo clippy` with `-D warnings` (treat warnings as errors) +- ✅ Fix ALL clippy warnings before committing +- ✅ Common clippy fixes: remove unnecessary casts, use `.flatten()` instead of manual `if let Ok`, remove unused imports + +The install-rust-deps role provides both cargo/rustc and the .rustfmt.toml +configuration from the Linux kernel, ensuring consistent Rust code quality +across all kdevops workflows. + ### Automatic Whitespace Fixing For convenience, you can automatically fix whitespace issues using: -- 2.51.0