From 74b71f62dc8ccb629c804ebb424a8c7a9756213c Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Thu, 1 Oct 2026 19:10:20 +0000 Subject: [PATCH] fix(lint): satisfy clippy 1.99 assert_is_empty and sync Cargo.lock to 0.3.6 rust-toolchain.toml tracks stable and the workspace denies clippy::all. Rust 1.99.0 (2026-09-28) added clippy::assert_is_empty, which rejects assert!(x.is_empty()); master CI and the v0.3.6 release run picked it up and failed at the clippy step. All ten sites now use assert_eq! against an explicitly typed empty Vec, so a failure prints the unexpected items. The version-packages commit (#120) bumped the crate to 0.3.6 without recording it in Cargo.lock; cargo rewrites the entry on any build. No changeset: the release planner resumes the untagged 0.3.6 publish only while no intents are pending. --- Cargo.lock | 2 +- crates/comment-checker/src/strip.rs | 8 ++++---- crates/comment-checker/tests/classify.rs | 6 +++--- crates/comment-checker/tests/f1.rs | 2 +- crates/comment-checker/tests/strip.rs | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 042e4f6..971382a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -201,7 +201,7 @@ checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" [[package]] name = "claude-code-comment-checker" -version = "0.3.5" +version = "0.3.6" dependencies = [ "clap", "proptest", diff --git a/crates/comment-checker/src/strip.rs b/crates/comment-checker/src/strip.rs index 0fc42f3..6e1017f 100644 --- a/crates/comment-checker/src/strip.rs +++ b/crates/comment-checker/src/strip.rs @@ -128,7 +128,7 @@ mod tests { ); assert_eq!(plan.source, "def load(path):\n return path\n"); assert_eq!(plan.deleted.len(), 1); - assert!(plan.remaining.is_empty()); + assert_eq!(plan.remaining, Vec::::new()); } #[test] @@ -143,7 +143,7 @@ mod tests { )], ); assert_eq!(plan.source, source); - assert!(plan.deleted.is_empty()); + assert_eq!(plan.deleted, Vec::::new()); assert_eq!(plan.remaining.len(), 1); } @@ -152,7 +152,7 @@ mod tests { let source = "x = 1 # TODO: fix this later\n"; let plan = plan_strip(source, &[finding(1, "# TODO: fix this later", None)]); assert_eq!(plan.source, source); - assert!(plan.deleted.is_empty()); + assert_eq!(plan.deleted, Vec::::new()); } #[test] @@ -160,7 +160,7 @@ mod tests { let source = "#!/usr/bin/env python3\nx = 1\n"; let plan = plan_strip(source, &[finding(1, "#!/usr/bin/env python3", None)]); assert_eq!(plan.source, source); - assert!(plan.deleted.is_empty()); + assert_eq!(plan.deleted, Vec::::new()); } #[test] diff --git a/crates/comment-checker/tests/classify.rs b/crates/comment-checker/tests/classify.rs index 808064e..77391d3 100644 --- a/crates/comment-checker/tests/classify.rs +++ b/crates/comment-checker/tests/classify.rs @@ -744,7 +744,7 @@ fn restate_cites_lexical_overlap() { panic!("expected RestatesCode, got {classify:?}"); }; assert_eq!(evidence.lexical, vec!["counter".to_owned()]); - assert!(evidence.operator.is_empty()); + assert_eq!(evidence.operator, Vec::<(String, String)>::new()); } #[test] @@ -783,7 +783,7 @@ fn restate_matches_operator_even_without_lexical_overlap() { else { panic!("expected RestatesCode, got {classify:?}"); }; - assert!(evidence.lexical.is_empty()); + assert_eq!(evidence.lexical, Vec::::new()); assert_eq!( evidence.operator, vec![("decrements".to_owned(), "-=".to_owned())] @@ -846,7 +846,7 @@ fn restates_signature_with_lexical_evidence() { panic!("expected RestatesCode, got {classify:?}"); }; assert_eq!(evidence.lexical, vec!["user".to_owned()]); - assert!(evidence.operator.is_empty()); + assert_eq!(evidence.operator, Vec::<(String, String)>::new()); } #[test] diff --git a/crates/comment-checker/tests/f1.rs b/crates/comment-checker/tests/f1.rs index 3e12897..f91f11f 100644 --- a/crates/comment-checker/tests/f1.rs +++ b/crates/comment-checker/tests/f1.rs @@ -168,7 +168,7 @@ fn malformed_corpus_fails_loudly() { fn zero_case_kind_reports_gracefully() { let report = evaluate(&[], &[]); assert!(report.by_kind.is_empty()); - assert!(per_kind_violations(&report, &[]).is_empty()); + assert_eq!(per_kind_violations(&report, &[]), Vec::::new()); } /// The per-kind floor must trip on a kind-level regression even when the diff --git a/crates/comment-checker/tests/strip.rs b/crates/comment-checker/tests/strip.rs index 23b87b6..f23ad08 100644 --- a/crates/comment-checker/tests/strip.rs +++ b/crates/comment-checker/tests/strip.rs @@ -95,7 +95,7 @@ fn strip_deletes_a_whole_line_comment_and_keeps_the_code() { assert!(run.stderr.contains("Deleted 1 comment(s)")); assert!(run.stderr.contains("Do this: rename the identifiers")); assert!(!run.stderr.contains("Action: delete the flagged comments")); - assert!(run.stdout.is_empty()); + assert_eq!(run.stdout, ""); } #[test] @@ -124,7 +124,7 @@ fn strip_on_a_clean_file_is_silent() { let run = run_binary(&write_payload(&file.path, CLEAN), &["--strip"]); assert!(run.status.success()); assert_eq!(file.read(), CLEAN); - assert!(run.stderr.is_empty()); + assert_eq!(run.stderr, ""); } #[test]