From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 2/5] CLAUDE.md: Add Rust code quality requirements
Date: Fri, 17 Oct 2025 19:32:14 -0700 [thread overview]
Message-ID: <20251018023218.2240269-3-mcgrof@kernel.org> (raw)
In-Reply-To: <20251018023218.2240269-1-mcgrof@kernel.org>
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 <mcgrof@kernel.org>
---
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
next prev parent reply other threads:[~2025-10-18 2:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 2:32 [PATCH 0/5] rust + rcloud support Luis Chamberlain
2025-10-18 2:32 ` [PATCH 1/5] install-rust-deps: Add generic Rust toolchain role Luis Chamberlain
2025-10-18 2:32 ` Luis Chamberlain [this message]
2025-10-18 2:32 ` [PATCH 3/5] bootlinux: Integrate Rust toolchain dependencies Luis Chamberlain
2025-10-18 2:32 ` [PATCH 4/5] install-go-deps: Add generic Go toolchain role Luis Chamberlain
2025-10-18 2:32 ` [PATCH 5/5] rcloud: Add experimental private cloud infrastructure for bare metal Luis Chamberlain
2025-10-18 18:22 ` [PATCH 0/5] rust + rcloud support Chuck Lever
2025-10-21 16:58 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251018023218.2240269-3-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=cel@kernel.org \
--cc=da.gomez@kruces.com \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox