mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-30 21:58:36 +00:00
`cargo xtask test-lint` reads the Rust files changed since a base and fails on tests that a wrong result can pass: `.all()` with no length or emptiness check, only is_ok/is_some/non-empty checks, `assert_eq!(x, x)`, a process test that checks only the exit status, no assertion and no asserting helper, a silent early return on a value from the code under test, `#[ignore]` without a reason, an environment variable that no CI leg sets, `thread::sleep` in test code, and test code that reads Rust source outside the listed source audits. Only hits on changed lines, or in a test with a changed line for the rules about a whole test, fail it; older hits in the same files are counted. The base is --base or TEST_LINT_BASE, the first parent of the checked-out commit in CI (a shallow checkout fetches it), else the merge base with upstream/main or origin/main. `// test-lint: allow <rule> <reason>` exempts a line. `--all` lists every hit by crate and rule and does not fail. `cargo xtask ci` runs it after cursors, so it runs in the checks shard.