Commit Graph
190 Commits
Author SHA1 Message Date
dotCooCoo a7e5bcbaba Dependencies: pin craft-libs at 77ade517
storytold/craft-libs#4634 merged as b942e743. Every craft-libs rev in
Cargo.toml, apps/vectorcraft-web/Cargo.toml, Cargo.lock and
xtask/src/pdf_deps.rs moves from 965c7bee to craft-libs main at
77ade517, which contains that merge. The egui revs move from 07c20531
to 861d60a6, the revs craft-libs pins at 77ade517. winit stays at
0dfcec0e.
2026-12-01 20:39:46 -08:00
dotCooCoo c1b9fb98c3 Merge main into fix/test-lint-mirror-false-alarms 2026-12-01 18:24:34 -08:00
dotCooCoo e19e96f810 xtask: test-lint reads base roots, module scopes and whole literals
- Changed mode builds the base's target-root routes from the base tree,
  so a deleted tests/<root>.rs still counts as loading tests/common/mod.rs.
- A base test is matched by its name, its inline modules and its place
  among same-named tests in them, so removing `mod a` does not let
  `a::t` hide a newly off `b::t`.
- reads-source looks through grouping around the read path and names a
  file only from a complete literal, a format!/concat! call or
  Path::new/PathBuf::from; `"data.json".trim_end_matches(".rs")` no
  longer counts as a .rs file.
- mirror keys keep a raw literal whole up to its own delimiter, and a
  key must be one complete string literal.
- for, if let, while let, let and match patterns keep word boundaries
  (`mut n` binds `n`), and a struct pattern's braces are not taken as
  the loop or if-let body.
- #[path] and cfg_attr path values accept raw string literals.
2026-12-01 17:06:07 -08:00
dotCooCoo a7654fc638 xtask: test-lint matches base tests by place and keeps route kinds apart
- never-run in changed mode lints the file as it was at the base and
  matches a test by its name and its place among tests of that name, so
  a test that was already off is not counted again when lines move.
- A file reached by name inherits only the gates of named declarations,
  and one reached through #[path] only those of #[path] declarations.
- The changed-file walk also reads the base child declarations of a
  #[path]-loaded file, so a removed `mod child;` still reaches the child.
- reads-source classifies the outer path step, not a join nested in its
  argument.
- mirror treats complete raw string literals as keys.
- A raw cfg value keeps the quotes inside it (r#""unix""# is not unix).
- census keeps word boundaries, so `k as usize` reads `k` and the local
  `kasusize` does not.
- fixture-only finds a for loop's `in` across line breaks.
2026-12-01 16:17:26 -08:00
dotCooCoo 2157200131 Merge main into fix/new-document-spacing 2026-12-01 15:38:11 -08:00
dotCooCoo 234662bb4b Merge main into fix/test-lint-mirror-false-alarms
main's test-lint changes rewrote the same functions as this branch
(module_parent, never_run, cfgs_over, reads_source_hits, names_rect).
The resolution keeps this branch's module routing (Gates, #[path]
overrides, base comparison) and takes from main: the 64-level bound in
weak_predicate, `&` before a lookup as a derived value, skipping later
attributes such as #[test_case(1; "one")] when finding a cfg's item,
and leaving out the lines of a cfg that holds on every CI target.

The review fixes for the same functions are part of the resolution:

- reads-source classifies by the final path step, so a final
  .with_extension("json") is not a .rs read and .with_extension(ext)
  is an unknown file.
- fixture-only reads a closure parameter as a new binding inside the
  closure body.
- cfg argument lists split on commas outside string literals, in
  cfg(any/all), cfg_attr predicates and cfg_attr paths.
- tests/<dir>/mod.rs takes its gates from the target roots beside it
  that declare it, so a helper that only a macOS-gated mod declaration
  loads is reported.
- a file loaded through #[path] declares its modules in its own
  directory (impl/platform.rs loads impl/child.rs), and a change to it
  reaches those files.
- a #[cfg_attr(<cond>, path = "...")] on an inline module is a
  conditional route, with the default directory where the condition
  does not hold.
- exact-pixel does not report a rect passed to a call
  (count_items(button_rect)).
- each file's cfg attributes are read once instead of once per test.
2026-12-01 14:46:05 -08:00
dotCooCoo 186e6db9ba xtask: test-lint reads renames, cfg_attr paths, casts and arm bindings
- changed mode diffs with --no-renames, so an exact rename lists the old
  path as deleted and the new path as added, and both seed the route walk.
- census reads a cast of the loop binding (k as usize) as the entry, and
  no longer reads a field or path segment named like it (config.k, m::k).
- reads-source takes the file name from the final .join(...) component;
  a final component that is not a literal is an unknown file.
- mirror keeps whitespace inside string literals when it compares lookup
  keys, so "A B" and "AB" are different entries.
- fixture-only resolves a name bound by a match arm's pattern to that arm,
  not to an outer let; a guard still reads the outer binding.
- never-run follows #[cfg_attr(<cond>, path = "...")] overrides: the
  selected path is loaded where the condition holds, and the default path
  elsewhere.
- never-run treats tests/<dir>/mod.rs as loaded by the test targets beside
  it, like a crate root.
- exact-pixel no longer reports two rects compared by their difference
  (a.width() - b.width()).
2026-12-01 13:34:08 -08:00
dotCooCoo 602d2142e4 Merge main into chore/test-lint-rules 2026-12-01 07:41:47 -08:00
dotCooCoo e1c1b04f25 xtask: test-lint follows deleted and detached routes and decoded cfg values
- A deleted file stays in the changed set and seeds the descendant walk,
  so a module it loaded through #[path] is checked for a lost CI route.
- A parent file that no crate target loads (its mod line removed) no
  longer counts as an ungated route to the module it declares.
- #[path] on an inline module sets the directory of the modules inside it.
- git grep lists #[path] parents with -z, so non-ASCII paths are read
  verbatim in both trees.
- cfg string values are compared decoded ("\x6cinux" is linux); raw
  strings stay as written.
- mirror reports arithmetic on either side of the equality, and ignores
  comments beside lookup keys.
- reads-source does not take a format! argument as the file name.
- The base never-run hits are computed once per file.
2026-12-01 07:27:46 -08:00
dotCooCoo eca4eae37d Merge main into fix/test-lint-mirror-false-alarms 2026-12-01 07:13:57 -08:00
dotCooCoo 3d2b663b9e xtask: test-lint never-run follows #[path] modules and multiline gates
never-run now finds the files that load a module through `#[path]`,
including a sibling such as `graphics.rs` loading `tests_graphics.rs`,
and follows them in both `--all` and changed-file mode. A changed file
now reaches every file it loads, directly or through other modules, so a
`cfg` added to its `mod` declaration flags the unchanged child's tests.

- Every route to a module counts: inline-module routes, `#[path]` routes
  and several routes from one file are joined, each with its own
  ancestors, and a crate root keeps its own route.
- A default `mod x;` matches only the file it really loads.
- Every line of a multiline `cfg` attribute counts as a gate line, for
  the test's own gates and for the parent declarations.
- The base comparison reads `#[path]` declarations from the base tree,
  so a moved declaration is not reported as newly off.
2026-12-01 06:52:18 -08:00
dotCooCoo 579fa0c247 xtask: test-lint mirror leaves out reads at two entries and shared arithmetic
- Two calls that differ only in the entry they name (a string or integer
  literal, a local, a field or an indexed element) relate two entries, as in
  at("B") == at("A") + 1 or bounds(&s, copy) == bounds(&s, id) + dv, and are
  no longer reported.
- The same arithmetic on both sides (rotate_deg(-270.0) * v ==
  rotate_deg(90.0) * v) checks that two inputs agree and is no longer
  reported.

On main, test-lint --all reports 1 mirror hit instead of 14.
2026-12-01 04:31:47 -08:00
dotCooCoo 4de23f0c95 Tests: census skips helper sources and negated rejection checks
A whole-table loop or .all(…) whose source calls an asserting helper
runs that helper for every entry, so census no longer reports it.
A negated is_ok() or is_some() checks a rejection and is no longer
counted as a presence check; !is_empty() still is.
2026-12-01 04:06:08 -08:00
dotCooCoo 408661218f Test lint: reads-source spans the path; cfg search skips later attributes
A reads-source hit now runs through the call's closing parenthesis, so
changing a path on a later line of a multiline call counts as a change
to the hit. The never-run cfg search skips whole attributes after the
cfg, so a `;` inside `#[test_case(1; "one")]` no longer drops the cfg.
2026-12-01 04:05:40 -08:00
dotCooCoo 44c8e34513 xtask: test-lint review fixes for spans, cfg_attr, shared roots and bindings
- A negated .contains(...) check forbids a value and is no longer
  treated as a presence check; !items.is_empty() still is.
- reads-source matches the last path literal of a read_to_string
  argument, and its span runs through the argument's closing paren.
- A for pattern binding shadows an outer let inside the loop body.
- Nested cfg_attr conditions are combined before the inner cfg applies.
- A never-run hit counts edits to the enclosing cfg lines and to the
  test, not to code between them.
- A parent declaration edit counts against a child's test only when
  the test still ran in CI at the base.
- A module loaded by several roots is off only when every root leaves
  it out.
- docs/development.md lists reads-source and never-run as failing rules.
2026-12-01 03:42:46 -08:00
dotCooCoo a75bcbde3d Merge main into chore/test-lint-census 2026-12-01 03:35:41 -08:00
dotCooCoo 6a34a994bb xtask: census skips loops with a break and rejections across &&
A break can end a whole-table loop before the last entry, and an unwrap_err() or expect_err() on the other side of an && always runs, so neither is a presence-only census.
2026-12-01 03:35:40 -08:00
dotCooCoo cefd2ed69e Tests: test-lint reads the path a join adds after a format call
read_to_string(PathBuf::from(format!("{}/fixtures.rs", root)).join("input.json"))
was reported as reading Rust source, and a join of "lib.rs" after a
format call was missed. path_literal now takes a literal after the
format call's closing parenthesis as the end of the path.
2026-12-01 03:32:16 -08:00
dotCooCoo 0b41498af6 Tests: test-lint reads format paths, nested mod declarations and call arguments exactly
- reads-source checks the format string of a format!(...) path, so a
  format argument ending in .rs is not taken for the file name.
- never-run combines only the mod declarations that load the same file;
  a declaration inside another inline module loads a file under that
  module's directory.
- exact-pixel treats a comma inside a call's arguments like the closing
  parenthesis, so f(rect.min.x, 3) is a coordinate passed on.
2026-12-01 03:06:35 -08:00
dotCooCoo 2c1278280b xtask: test-lint cfg_attr, #[path] and inline-module gates, changed parent declarations
- never-run reads cfg(...) nested in cfg_attr, and blanks comments in cfg predicates.
- A file's inherited gates come from the mod declaration that loads it: #[path] overrides
  are resolved, and a declaration inside an inline module gates the file under that
  module's directory. Several declarations of one file join with any(...).
- In changed-files mode, a change to a parent mod declaration or its cfg counts for the
  never-run hits of the files it loads, including files that did not change.
- Round trips reject arithmetic before the lookup (1 + lookup(k)).
- reads-source ignores Rust paths that occur only in comments.
- if let and while let bindings shadow outer bindings only inside their body.
- The mirror allow test now starts from an assertion that is reported.
2026-12-01 02:55:37 -08:00
dotCooCoo edcad3c183 Tests: test-lint judges negations, cfg escapes and module declarations exactly
- census keeps the polarity of a negation: `!parse(x).is_ok()` is a
  rejection, while `!xs.is_empty()` stays a presence check.
- reads-source looks at the last path literal of a read_to_string
  argument, so `root.join("fixtures.rs").join("input.json")` is not a hit.
- never-run reads an escaped cfg string value as unknown, takes every
  `mod` declaration of a module (`#[cfg(windows)]` and `#[cfg(unix)]`
  both count), and ties a change to an attribute only when that
  attribute excludes a CI target.
- exact-pixel does not count a coordinate passed to a function.
- docs/development.md says when never-run can decide a cfg.
2026-12-01 02:39:39 -08:00
dotCooCoo fc5b42e304 xtask: census counts rejections in .all() and bounded zip ranges
An .all(...) predicate that calls unwrap_err or expect_err on a branch
that always runs now checks a rejection, like an asserting helper.
A zip with a bounded range (zip(0..2)) bounds the loop, while an
open-ended range (zip(0..)) still visits every entry. Rejection calls
are matched with whitespace inside them (unwrap_err ()) at every site.
2026-12-01 02:21:12 -08:00
dotCooCoo 0f95fb0880 Merge main into chore/never-run-test-allows 2026-12-01 02:21:01 -08:00
dotCooCoo e7715d880b xtask: test-lint round trips, mod scopes, never-run allows and doc names
- census: a lookup counts as a round trip only when its arguments read the
  loop entry, so `lookup("baseline") == expected` is a real check.
- never-run: a `mod child;` inside an inline `mod platform { ... }` loads
  platform/child.rs, so it no longer gives its cfg to src/child.rs.
- never-run: an allow covers only the test it sits above; a module cfg no
  longer stretches it over the next test in the module.
- exact-pixel: document geometry is matched by identifier (`doc`,
  `document`, `doc_*`, `*_doc`), so `dock_rect` is checked.
2026-12-01 02:21:01 -08:00
dotCooCoo f29fd8c3a0 Merge main into chore/test-lint-rules 2026-12-01 02:04:59 -08:00
dotCooCoo ded4e473a2 xtask: test-lint follows comments, inline and shared modules, and changed mod cfgs
- never-run reads cfg predicates with comments removed, finds a module
  declared inside an inline module of its parent's parent, stops when
  several files declare a module with different attributes, and counts a
  change to a cfg on a mod declaration in another file against the tests
  it turns off. The lines between a module's cfg and the test no longer
  count as changes to the test.
- reads-source ignores paths in comments.
- census bounds weak_predicate at 64 levels and does not take a lookup
  with an operator before it as a round trip.
- fixture-only treats a for-loop binding that shadows a fixture as
  unknown.
- exact-pixel skips ratios and scaled values.
- docs/development.md lists reads-source and never-run as failing rules.
2026-12-01 02:04:59 -08:00
dotCooCoo 236149156b xtask: never-run follows cfg around mod declarations and counts cfg changes 2026-12-01 01:23:24 -08:00
dotCooCoo c944c493e5 xtask: test-lint flags read_to_string of Rust files 2026-12-01 01:17:43 -08:00
dotCooCoo 26f992d7bb Merge remote-tracking branch 'origin/chore/test-lint-census' into chore/test-lint-rules 2026-12-01 01:01:57 -08:00
dotCooCoo 573246a5b2 xtask: test-lint adds mirror, constant-echo, fixture-only, never-run and exact-pixel rules 2026-12-01 01:01:57 -08:00
dotCooCoo 7f6ff4d60e xtask: census counts rejections and asserting helpers as checks
A loop over a table that also calls unwrap_err or expect_err checks that
some inputs are rejected, so it is no longer reported as census. Calls in
failure messages do not count, and a panic! that only enforces success
does not exempt the loop.

An asserting helper called in an .all(...) predicate also counts as a
check, unless a presence check can pass without the helper running
(the other side of an ||). Helpers called with a turbofish are matched
too.
2026-11-30 22:48:28 -08:00
dotCooCoo aa44d2a3a0 xtask: census skips inequalities, derived values and subset loops
- assert_ne!, debug_assert_ne! and prop_assert_ne! in a table loop are not
  round trips.
- A round trip counts only when the compared operand is the parsed or
  looked-up entry itself, optionally unwrapped, borrowed or wrapped in
  Some(...); parse(..).unwrap().children.len() is a real check.
- An .all(...) presence check over a table is reported only when the whole
  condition holds on presence checks: joined by && to a real check it is
  not reported, while an || that lets the presence branch pass alone still
  is.
- filter_map, take_while, skip_while and map_while pick a subset, as do a
  bounded iterator zipped in or returned by flat_map. Adapters inside a
  closure on the outer chain do not count.
2026-11-30 21:58:13 -08:00
dotCooCoo 0e480bfde0 New document: pin the PDF check to the new craft-libs rev and require a Height caption
xtask's pdf-deps check still named rev a5669ed2 after the workspace moved
to 965c7bee, so it rejected the seven PDF packages. The layout test now
fails when no Height caption stands below Width, instead of passing on an
infinite gap.
2026-11-30 21:46:03 -08:00
dotCooCoo 340bf84cb8 xtask: test-lint reports census tests
A new report-only rule, census, lists tests that loop over a whole table
(a SCREAMING_CASE constant, Type::ALL, Type::iter(), or a call named like
a catalog such as presets() or all_swatches()) and assert only that each
entry is present, non-empty, or parses back to itself. Such tests walk
every color, swatch or preset and check a property each entry has by
construction. Loops over a few entries (take, skip, filter, a slice),
loops that call an asserting helper, and comparisons with an expected
value written in the table are not reported.

cargo xtask test-lint --all lists 53 census hits on main.
2026-11-30 21:11:36 -08:00
dotCooCoo b301d1c116 Merge main into feat/split-cache-warm 2026-11-30 20:46:38 -08:00
dotCooCoo 93c598a27f Merge main into feat/split-cache-warm 2026-11-30 15:06:24 -08:00
.CooCoo 90e08df23f Merge pull request #10312 from dotCooCoo/fix/ui-frame-stability
Menus: a menu opens under its title on a monitor beside a portrait one
2026-11-30 15:02:38 -08:00
.CooCoo f4f42de9d8 Merge pull request #10239 from dotCooCoo/fix/plugins-whole-tree-reads
CI: declare the files each crate reads in other crates, for test selection
2026-11-30 14:05:36 -08:00
.CooCoo f9e65c09cd Merge pull request #10242 from dotCooCoo/fix/xtask-test-lint
xtask: test-lint checks the tests a change touches for weak assertions
2026-11-30 13:51:00 -08:00
BFlat 77ed301775 SVG import: refuse an SVG the memory can't hold instead of running out (#10303)
* SVG import: refuse an SVG the memory can't hold instead of running out

The element limit now follows the installed memory, or the process's
cgroup limit where that is lower: about 8 KB an element, up to the
999,999 elements usvg reads. Past it the SVG is refused with an error
naming the memory, before usvg makes its tree.

Fixes #10165

* Tests: the shared element limit test follows the machine's limit
2026-12-01 03:42:59 +07:00
dotCooCoo 58923e0d78 Menus: a menu opens under its title on a monitor beside a portrait one
Moves craft-libs to a5669ed2f, which places overlays in the room of the
monitor the window is on (craft-libs f31beb26d, merged in #4506). The
old room assumed monitors tile the desktop by their size, so on a
landscape monitor to the right of a portrait one the File menu opened
at (726, 442), far from its title, with scroll arrows.

The new pin is craft-libs main just before #4278, whose dialog changes
need VectorCraft test updates that come with a later pin bump.

The new test menu_on_second_monitor opens the File menu with the window
on the landscape monitor at 1x and 1.5x; it fails on the old pin with
the menu at (726, 442).
2026-11-30 12:21:21 -08:00
.CooCoo 360a186d53 Merge pull request #10163 from dotCooCoo/fix/warm-builds-integration-tests
xtask: the cache warm builds integration tests too
2026-11-30 07:53:10 -08:00
dotCooCoo 050634b6ad xtask: test-lint skips declared-only items and unapplied should_panic
- Functions and macros declared inside a test no longer count as its
  assertions or calls; a call to one still counts as a helper call.
- `should_panic` exempts a test only as an applied attribute:
  `#[should_panic]`, or inside `#[cfg_attr(test, ...)]`.
- `only-weak` strips parentheses around the whole condition, so
  `assert!((x.is_ok()))` is classified like `assert!(x.is_ok())`.
- `#[ cfg(test)]` and attributes with comments between `#`, `[` and
  `cfg` mark test code like the compact form.
2026-11-30 06:19:05 -08:00
dotCooCoo fbcc1627c4 xtask: test-lint counts items under cfg(all(test, ...)) as test code
test_regions matched only the exact `#[cfg(test)]`, so helpers in a
module under `#[cfg(all(test, windows))]` or
`#[cfg(all(test, not(target_arch = "wasm32")))]` (as in
apps/vectorcraft-web/src/file_drops.rs) were not test code: a sleep in
such a helper passed the check, and its asserting helpers were not found.

A cfg predicate now counts when it is `test` or an `all(...)` with such a
predicate among its arguments, at any depth and with any spacing.
`any(test, ...)`, `not(test)` and `feature = "test"` do not count.
2026-11-30 05:46:34 -08:00
dotCooCoo ebb84ec16c xtask: test-lint reports only-weak hits instead of failing on them
Replayed over the last 300 merges to main, only-weak would have failed
3 merges on 4 hits, and all 4 were tests where an is_ok or is_some check
is the behavior under test (a lease or start file that can be taken
again, a never-panic property test, a label found by a search with the
row's position in its predicate). Of the 39 only-weak hits in the whole
workspace, most are the same kinds: registry and label lookups,
still-imports and never-panic tests.

only-weak now lists its hits without failing, like all-unguarded. The
check fails on self-compare, ignore-without-reason and sleep. With this
change the replay fails 0 of 272 merges that change Rust files.
2026-11-30 05:40:53 -08:00
dotCooCoo 28f33ca04c xtask: test-lint scopes bindings, spans ignore reasons and names its failing rules
- The module docs and docs/development.md name the four rules that fail
  the check, and describe `only-weak` and `self-compare` by what they
  match (`len() > 0`, `assert_ne!`).
- The changed-lines diff passes `--inter-hunk-context=0`, so a clone's
  `diff.interHunkContext` cannot mark unchanged lines between two edits.
- Single-letter workflow variables count as set.
- Test names with non-ASCII letters are read whole.
- An allow in a block comment needs a reason before `*/`.
- `all-unguarded` uses only a binding still in scope at the assertion,
  treats a `const` declared with different values as unknown, and drops
  a counted local once its collection may shrink or be replaced.
- `only-weak` ignores `unwrap_err`, `expect_err` and `panic!` in failure
  messages.
- `self-compare` leaves out operands that call a method returning the
  next value each time (`next`, `pop_front`, `recv` and others).
- An `ignore-without-reason` span reaches the attribute's `]`, so a
  change to a reason on the next line counts.
2026-11-30 05:20:08 -08:00
dotCooCoo 747593d0dd xtask: test-lint reads quoted paths, test_case tests and literal setters correctly
- Changed mode decodes `+++` labels (the tab after a path with a space,
  C-quoted paths), and the file inventories read `git ls-files -z`, so
  files with spaces, quotes or non-ASCII names are linted.
- `#[test_case(1; "one")]` arguments and other attributes no longer end
  the item before its `fn`, and an inner `#![...]` attribute before the
  first test is not part of that test's span.
- A helper name counts as asserting only when every function of that
  name in the crate's test code asserts.
- `.stdout(file)` and other stream builder calls count as configuration
  whatever their argument, so `exit-status-only` still reports.
- A `return` inside `async { ... }` or `async move { ... }` ends the
  future, not the test, for `early-return`.
- `env-gate-unset` looks for setters in code only, not in string
  literals, ignores `echo` and `printf` output that is not written to
  `$GITHUB_ENV`, and its span reaches the variable name on a later line.
- `sleep` reports `thread::sleep`, or a bare `sleep(...)` only where the
  file imports `thread::sleep`.
- `reads-source` checks raw string paths in `include_str!` and
  `ends_with`.
- A test pins that a collection changed after its `assert_eq!` loses
  that guard for `all-unguarded`.
2026-11-30 05:10:17 -08:00
dotCooCoo 11b909ef9e Merge main into fix/xtask-test-lint 2026-11-30 04:45:56 -08:00
dotCooCoo 25756e1b8d xtask: test-lint fails on four rules; all-unguarded skips collections that cannot be empty
Replayed over the last 300 merges of main, all-unguarded failed good
pull requests on collections that cannot be empty. It now leaves out:

- plain locals bound to an array type of a positive length, to a
  non-empty array literal or vec![...], or to a literal range followed
  only by methods that keep an item (map, iter, rev, collect into a
  known collection ...); counts may be consts of the file
- locals filled by a push or insert on every pass of a loop over such a
  source
- fields and const or static items the file declares only as arrays of
  a positive length
- collections compared with a non-empty literal through such methods,
  directly or through a local built from them, and assertions on a
  local bound to a count or length
- .windows(k) and .chunks_exact(k) when the collection has k items

Later code that may remove items or replace the collection cancels the
exemption.

Only only-weak, self-compare, ignore-without-reason and sleep fail the
check now. The other rules list their hits on changed lines without
failing. On the same 300 merges, 1 would fail (an only-weak test), and
the 3 all-unguarded hits are tests an empty result passes. On main at
07037afda8, all-unguarded lists 392 hits instead of 433.
2026-11-30 04:43:33 -08:00
dotCooCoo f553ddfa67 xtask: test-lint fails on weak tests in the lines a change touches
`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.
2026-11-30 03:12:48 -08:00