Skip to content

Every assert of an empty collection prints it on failure, as Rust 1.99's clippy::assert_is_empty asks - #291

Merged
HackingGate merged 1 commit into
mainfrom
clippy-assert-is-empty
Oct 1, 2026
Merged

HackingGate merged 1 commit into
mainfrom
clippy-assert-is-empty

Conversation

@HackingGate

Copy link
Copy Markdown
Owner

Rust 1.99's clippy adds assert_is_empty to pedantic. CI's stable toolchain picked it up, so every job that compiles the tests now fails on 45 assert!(x.is_empty()) calls. This includes #290's scan engine, pre-commit and prek jobs, and it will hit main on its next run.

Each call now has a message that prints the collection, so a failing run shows what was in it. With a message, the lint no longer fires. The one assertion that a list is not empty says which list was empty.

Verified: cargo clippy --all-targets --all-features -D warnings is clean on 1.99.0, and all 29 test suites pass.

…9's clippy::assert_is_empty asks

Clippy 1.99 adds assert_is_empty to pedantic, and CI's stable toolchain took
it, so every job that compiles the tests refused 45 `assert!(x.is_empty())`
calls. Each now carries a message that prints the collection, which is what
the lint wants and what a failing run needs; the one asserting non-emptiness
says which list was empty.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 81a22930-1c25-4bd8-91c6-0f914fcfa562

📥 Commits

Reviewing files that changed from the base of the PR and between 1036212 and 8224904.

📒 Files selected for processing (18)
  • src/anchors.rs
  • src/audit.rs
  • src/config.rs
  • src/engine.rs
  • src/evidence.rs
  • src/evidence/diff.rs
  • src/evidence/git.rs
  • src/git.rs
  • src/guard/message.rs
  • src/guard/names.rs
  • src/guard/unicode.rs
  • src/install.rs
  • src/pins.rs
  • src/prose.rs
  • src/selection.rs
  • src/shim.rs
  • src/sources.rs
  • tests/structural_evidence.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.52381% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.01%. Comparing base (1036212) to head (8224904).

Files with missing lines Patch % Lines
src/guard/unicode.rs 68.00% 8 Missing ⚠️
src/guard/message.rs 66.66% 6 Missing ⚠️
src/engine.rs 60.00% 4 Missing ⚠️
src/config.rs 70.00% 3 Missing ⚠️
src/evidence.rs 81.81% 2 Missing ⚠️
src/sources.rs 66.66% 2 Missing ⚠️
src/anchors.rs 66.66% 1 Missing ⚠️
src/evidence/diff.rs 66.66% 1 Missing ⚠️
src/evidence/git.rs 66.66% 1 Missing ⚠️
src/git.rs 50.00% 1 Missing ⚠️
... and 3 more

❌ Your patch status has failed because the patch coverage (69.52%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   94.15%   94.01%   -0.14%     
==========================================
  Files          46       46              
  Lines       20547    20608      +61     
==========================================
+ Hits        19345    19374      +29     
- Misses       1202     1234      +32     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HackingGate
HackingGate merged commit 416397d into main Oct 1, 2026
12 checks passed
@HackingGate
HackingGate deleted the clippy-assert-is-empty branch October 1, 2026 16:20
@HackingGate HackingGate mentioned this pull request Oct 1, 2026
HackingGate added a commit that referenced this pull request Oct 1, 2026
One engine change since 1.23.0. supply-chain no longer hands an npm git
dependency to guarddog, which asked npm for it and got a 404, so a repository
depending on its own package by git exited 2 on every run. Each git
dependency in a package.json's dependencies is held to the same first-party
owner rule and git ls-remote check as a uv git source, against the commit
bun.lock or package-lock.json records; a tag its #<ref> names must point at
that commit. One with no recorded commit is refused by name, and guarddog
reads the rest of the manifest (#290).

A git remote spelled as an option (starting with -) is now refused for uv
and npm alike, and git ls-remote takes the remote after --, so a manifest
cannot hand git an --upload-pack command (#290).

The tests assert every empty collection with a message that prints it, as
Rust 1.99's clippy::assert_is_empty asks (#291).

A consumer taking the pin to v1.24.0 needs no change. A repository whose
package.json depends on a git source under another owner, or on one no lock
pins, now fails the supply-chain section by name where it was could-not-look.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants