Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Seven terms have exactly one meaning each, everywhere in this repository: code c

- If Cargo rejects a dependency cycle, the design is wrong, not the graph.
- Pseudo-random test input comes only from a fixed seed that the failure prints. Temporary directory names come from the test's name, the process id, and a counter.
- A file holds one concept and has no length limit. Split a file only when it holds a second unrelated concept. Size limits sit on functions and types, and clippy and `cargo test -p build-xtask` enforce them. Split an oversized type by responsibility; a new entry in the allowlist in `crates/build-xtask/src/type_size.rs` is a plan decision with a reason, never a way to make a change pass.
- A file holds one concept and has no length limit. Split a file only when it holds a second unrelated concept.
- Production code uses the standard module layout: `foo.rs`, with `foo/bar.rs` for its children. No `#[path]`, and no inline `mod` blocks. A module never has exactly one child file (tests aside): merge it, or make it a peer module `foo_bar.rs` declared beside `foo.rs`.
- Test code goes at the bottom of the file under test in a `#[cfg(test)] mod tests { }` block when practical (if in doubt, beside), and otherwise in `foo-tests.rs` beside it, wired with `#[path = "foo-tests.rs"] mod tests;`. A big test file may split by topic into siblings named after it, `<stem>-<topic>.rs` (so `foo-tests-topic.rs`). These are the only files wired with `#[path]`, apart from the cfg-selected platform files in `crates/runvil-internal/vfs/src/real.rs`, so a hyphen in a file name means test code. Top-level `tests/` and `benches/` trees follow Cargo's conventions.
- Crates outside the Engine and Harness keep their older layout until their own pass.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,5 @@ doc_markdown = "allow"
# `assert_eq!(x, [] as [T; 0])`, which has to spell out the element type and
# needs `T: PartialEq + Debug`, so it cannot be applied to most call sites.
assert_is_empty = "allow"
too_many_lines = "allow"
too_many_arguments = "allow"
5 changes: 0 additions & 5 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
allow-unwrap-in-tests = true
allow-expect-in-tests = true

# Size limits sit on functions (here) and on types (build-xtask's
# type-size check). A file has no length limit.
too-many-lines-threshold = 100
too-many-arguments-threshold = 7

# Process-global installers. Only a binary entry point may call one, under
# `#[expect(clippy::disallowed_methods, reason = ...)]`. No entry names a
# `replacement`, because no alternative takes the same arguments and returns
Expand Down
1 change: 0 additions & 1 deletion crates/build-xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ mod no_doctests;
mod product;
mod test_support_leak;
mod tidy;
mod type_size;
mod unsafe_allowlist;

use std::path::Path;
Expand Down
5 changes: 1 addition & 4 deletions crates/build-xtask/src/tidy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
//! facades and their containers (run from `doc_hidden`), the doctest ban
//! over every workspace crate (run from `no_doctests`), the `Debug`
//! trait's one spelling over every workspace crate (run from
//! `debug_spelling`), the unsafe allowlist (run from `unsafe_allowlist`),
//! and the type-size limits over every workspace crate (run from
//! `type_size`).
//! `debug_spelling`), and the unsafe allowlist (run from `unsafe_allowlist`).
//!
//! Each check returns a list of human-readable violations. The `#[test]`
//! wrappers assert the lists are empty, so `cargo test -p build-xtask`
Expand Down Expand Up @@ -40,7 +38,6 @@ pub(crate) fn all_violations(root: &Path) -> Vec<String> {
violations.extend(crate::doc_hidden::doc_hidden_violations(root));
violations.extend(crate::no_doctests::no_doctests_violations(root));
violations.extend(crate::debug_spelling::debug_spelling_violations(root));
violations.extend(crate::type_size::type_size_violations(root));
violations
}

Expand Down
Loading
Loading