Files
vectorcraft/xtask
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
..