From c34b93446f188189f8b9713ae664ce79d6b89137 Mon Sep 17 00:00:00 2001 From: alexion Date: Thu, 17 Sep 2026 08:59:42 -0400 Subject: [PATCH] refactor(skills): consolidate Rust Bazel rules --- src/skills/style/rust/rules/bazel.md | 23 +++++++++++++++++++++++ src/skills/style/rust/rules/tests.md | 13 ------------- 2 files changed, 23 insertions(+), 13 deletions(-) delete mode 100644 src/skills/style/rust/rules/tests.md 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.