From 07992b8a1bd4c5f0992079711eb9385527dc6a96 Mon Sep 17 00:00:00 2001 From: Yeachan-Heo Date: Tue, 28 Apr 2026 09:38:08 +0000 Subject: [PATCH] Make Rust formatting guidance runnable from repo root The Rust crate layout expects formatting to run from the rust directory, so add a root-level wrapper that preserves the working command while forwarding user flags like --check. Documentation now points contributors at the wrapper instead of the misleading virtual-workspace manifest invocation. Constraint: Root-level cargo fmt --manifest-path rust/Cargo.toml is misleading for this virtual workspace Rejected: Document cd rust && cargo fmt directly | a root wrapper gives one stable repo-root command Confidence: high Scope-risk: narrow Tested: scripts/fmt.sh --check Tested: git diff --check --- CLAUDE.md | 2 +- scripts/fmt.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 scripts/fmt.sh diff --git a/CLAUDE.md b/CLAUDE.md index d56da6e..bc3e2b6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - Frameworks: none detected from the supported starter markers. ## Verification -- Run Rust verification from `rust/`: `cargo fmt`, `cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace` +- Run Rust verification from repo root: `scripts/fmt.sh --check`; for formatting use `scripts/fmt.sh`. Run Rust clippy/tests from `rust/`: `cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace` - `src/` and `tests/` are both present; update both surfaces together when behavior changes. ## Repository shape diff --git a/scripts/fmt.sh b/scripts/fmt.sh new file mode 100755 index 0000000..e46e46e --- /dev/null +++ b/scripts/fmt.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")/../rust" +exec cargo fmt "$@"