refactor(skills): consolidate Rust Bazel rules
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user