diff --git a/src/skills/style/rust/rules/bazel.md b/src/skills/style/rust/rules/bazel.md index b75b3a3..61a0430 100644 --- a/src/skills/style/rust/rules/bazel.md +++ b/src/skills/style/rust/rules/bazel.md @@ -1,5 +1,28 @@ # Bazel rules +## Keep Rust tests in separate files + +### Rule + +Put Rust tests in separate `*_test.rs` files. +Do not add inline `#[cfg(test)]` modules. + +### Rationale + +Separate test files keep production modules focused and match the repository's Bazel test layout. + +## Declare Rust tests in Bazel + +### Rule + +Declare Rust test files in the nearest Bazel `BUILD` file with `rust_test`. +Do not add `[[test]]` entries to `Cargo.toml` unless the operator explicitly requests Cargo test declarations. + +### Rationale + +Bazel is the source of truth for Rust test targets in this repository. +Keeping test declarations in Bazel avoids duplicate test target lists. + ## Use one source input style per `rust_test` ### Rule diff --git a/src/skills/style/rust/rules/tests.md b/src/skills/style/rust/rules/tests.md deleted file mode 100644 index cd38d5c..0000000 --- a/src/skills/style/rust/rules/tests.md +++ /dev/null @@ -1,13 +0,0 @@ -# Test rules - -## Keep Rust tests in separate files - -### Rule - -Put Rust tests in separate `*_test.rs` files. -Do not add inline `#[cfg(test)]` modules. -Declare each test file in the nearest Bazel `BUILD` file with a `rust_test` target. - -### Rationale - -Separate test files keep production modules focused and match the repository's Bazel test layout.