Skip to content

Commit 07992b8

Browse files
committed
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
1 parent 74ea754 commit 07992b8

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
77
- Frameworks: none detected from the supported starter markers.
88

99
## Verification
10-
- Run Rust verification from `rust/`: `cargo fmt`, `cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace`
10+
- 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`
1111
- `src/` and `tests/` are both present; update both surfaces together when behavior changes.
1212

1313
## Repository shape

scripts/fmt.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cd "$(dirname "$0")/../rust"
5+
exec cargo fmt "$@"

0 commit comments

Comments
 (0)