feat(skills): add Rust file naming rules

This commit is contained in:
2026-09-17 09:08:32 -04:00
parent c8729f8cb6
commit 83a5aec8f5
2 changed files with 26 additions and 11 deletions

View File

@@ -1,16 +1,5 @@
# 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

View File

@@ -0,0 +1,26 @@
# File rules
## Avoid generic Rust file names
### Rule
Do not name Rust source files `lib.rs` or `main.rs`.
Name library crate root files after the crate they define.
Name binary crate root files after the binary they define, or use a `_main.rs` suffix.
Set explicit Cargo paths and Bazel `srcs` when needed.
### Rationale
Generic root names make file search results and review context less clear.
Descriptive file names show which crate or binary owns the code.
## 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.