testing-conventions 0.0.133

Enforce testing conventions in libraries (Python, TypeScript, and Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Exempt paths are relative to the crate root — the nearest ancestor holding `Cargo.toml` —
# so the same entry resolves whether the gate is pointed at the crate or at `src`.

[rust]
# The tightest threshold the crate passes today, deliberately with no headroom:
# `run_unit_mutation` in `lib.rs` is exactly 64 lines and shares the file with `run`, so the
# next line added to it must be paid for with a split. A ratchet, not a target — #750 holds
# the step sequence down to the Python/TypeScript default of 1.
one_function_per_file = { max_lines = 64 }

# The provisioning lock's test spawns two real threads and holds the critical section with a
# 50ms sleep: concurrency *is* the subject, so a double would prove nothing, and dropping the
# sleep narrows the race window until a lock-less implementation can pass by luck. Whole-file
# because line-scoped exemptions apply only to `coverage` and `mutation`.
[[rust.exempt]]
path = "src/mutation.rs"
rules = ["no-out-of-module-call", "no-out-of-module-import"]
reason = "the provisioning lock's unit test spawns real threads and sleeps inside the critical section — concurrency is the unit under test, so a double would assert nothing"