- Read CONTRIBUTING.md for guidelines on how to run tools
- ALWAYS ensure that new tests use the same style as existing tests for all parts of the test
- ALWAYS check whether the behavior of a new test is already covered by an existing test
- PREFER integration tests, e.g., at
it/...over unit tests - PREFER running specific tests over running the entire test suite
- PREFER
instasnapshots following patterns in nearby tests over substring assertions - When making changes for Windows from Unix, use
cargo xwin clippyto check compilation - NEVER perform builds with the release profile, unless asked or reproducing performance issues
- AVOID using
panic!,unreachable!,.unwrap(), unsafe code, and clippy rule ignores - PREFER patterns like
if letto handle fallibility - PREFER exhaustive
matchexpressions without wildcard (_) arms overmatches!, so new enum variants require explicit handling - ALWAYS write
SAFETYcomments following our usual style when writingunsafecode - PREFER
#[expect()]over[allow()]if clippy must be disabled - PREFER let chains (
if letcombined with&&) over nestedif letstatements - NEVER update all dependencies in the lockfile and ALWAYS use
cargo update --preciseto make lockfile changes - NEVER assume clippy warnings or test failures are pre-existing, it is very rare that
mainhas warnings - ALWAYS use
.github/automations-dispatch.jsonto trigger privileged workflows from GitHub webhook events instead of addingpull_request_targetworkflows - NEVER suppress the
dangerous-triggerssecurity lint; extend the automation dispatcher in a separate pull request if it does not support the required event - PREFER top-level imports over local imports or fully qualified names
- AVOID shortening variable names, e.g., use
versioninstead ofver, andrequires_pythoninstead ofrp - PREFER [
TypeName] references when writing Rust doc comments - DO NOT leak our conversation, prompt, or iteration history into code comments, pull request descriptions, or other maintainer-facing prose. Write for readers who have not seen our conversation.
- PREFER comments that explain the current behavior and rationale. Avoid past-facing wording like "preserve the existing behavior"; explain the actual backwards-compatibility constraint instead.
- ALWAYS check if a new or modified test needs a
#[cfg(feature = "test-...")]gate