docs(skills): add build style skill
This commit was merged in pull request #67.
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
# Build rules
|
||||
|
||||
## Use workspace dependency versions
|
||||
|
||||
### Rule
|
||||
|
||||
Declare Rust dependency versions in the repository root `Cargo.toml` under `[workspace.dependencies]`.
|
||||
Reference workspace dependencies from package `Cargo.toml` files with `workspace = true`.
|
||||
Do not declare dependency versions in package `Cargo.toml` files unless the operator explicitly requests a package-local version.
|
||||
Add package-local dependency features only when the feature set is specific to that package.
|
||||
|
||||
### Rationale
|
||||
|
||||
The repository has one Cargo workspace and one `Cargo.lock`.
|
||||
Centralized dependency versions keep package manifests consistent with the workspace lockfile.
|
||||
|
||||
## 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
|
||||
|
||||
Do not set both `crate` and `srcs` on a `rust_test` target.
|
||||
Use exactly one input style for each Rust test target.
|
||||
|
||||
### Rationale
|
||||
|
||||
`rules_rust` rejects `rust_test` targets that set both `crate` and `srcs`.
|
||||
Keeping one input style per target makes the test declaration valid and unambiguous.
|
||||
Reference in New Issue
Block a user