From 669da4ad289a0609392490d298c84a0e929a4c8f Mon Sep 17 00:00:00 2001 From: "Claude Opus 5.5 (claude-opus-5-5)" Date: Fri, 16 Oct 2026 11:31:59 +0200 Subject: [PATCH] chore: satisfy clippy 1.99 and ruff 0.17 across the tree clippy 1.99 adds assert_is_empty, which asks for an equality assertion against an empty value in place of assert on is_empty, in forty-two test files. ruff 0.17 reports UP017 on the two scripts, which now import datetime.UTC; the scripts already use union annotations, so they need Python 3.10 or later, and the system Python of macOS was never enough for them. Co-Authored-By: Martin Zeman --- scripts/check-codex-skill-discovery.py | 4 ++-- scripts/run-artifact-checks.py | 2 +- src/assemble/pipeline_tests.rs | 6 +++--- src/assemble/tests.rs | 2 +- src/cli/adopt/tests.rs | 2 +- src/cli/assemble/sources.rs | 2 +- src/cli/bench/tests.rs | 4 ++-- src/cli/closure/tests.rs | 2 +- src/cli/config/tests.rs | 6 +++--- src/cli/context.rs | 2 +- src/cli/copy/tests.rs | 4 ++-- src/cli/deploy/tests.rs | 2 +- src/cli/doctor.rs | 2 +- src/cli/dotrune/tests.rs | 8 ++++---- src/cli/drift/tests.rs | 4 ++-- src/cli/exec/tests.rs | 2 +- src/cli/graph/mod.rs | 5 ++++- src/cli/install/tests.rs | 7 +++---- src/cli/launch/check/tests.rs | 10 ++++++++-- src/cli/launch/tests.rs | 15 +++++++++------ src/cli/promote/tests.rs | 14 ++++++-------- src/cli/proof/fence.rs | 2 +- src/cli/provenance/scan.rs | 4 ++-- src/cli/repair/tests.rs | 4 ++-- src/cli/sign/queue/tests.rs | 5 ++++- src/cli/surface/tests.rs | 6 +++--- src/cli/theme.rs | 2 +- src/cli/validate/repository/tests.rs | 2 +- src/cli/validate/tests.rs | 6 +++--- src/cli/watchlist/tests.rs | 20 ++++++++++++++++---- src/deck/tests.rs | 4 ++-- src/manifest/bundle/tests.rs | 5 ++++- src/result.rs | 4 ++-- src/services/builders.rs | 4 ++-- src/services/history.rs | 2 +- src/services/mod.rs | 7 +++---- src/skill_readiness/portability/tests.rs | 17 +++++++++++------ src/tui/cast_editor/tests.rs | 2 +- src/tui/tests.rs | 2 +- src/validate/mdschema/tests.rs | 5 ++++- src/validate/tests.rs | 4 ++-- tests/cli.rs | 8 ++++---- tests/codex_skill_identity.rs | 15 ++++++++++++--- tests/provider.rs | 8 ++++---- 44 files changed, 143 insertions(+), 100 deletions(-) diff --git a/scripts/check-codex-skill-discovery.py b/scripts/check-codex-skill-discovery.py index ae296b35..ba6d7080 100755 --- a/scripts/check-codex-skill-discovery.py +++ b/scripts/check-codex-skill-discovery.py @@ -16,7 +16,7 @@ import subprocess import sys import time -from datetime import datetime, timezone +from datetime import UTC, datetime from pathlib import Path @@ -319,7 +319,7 @@ def run_observation(args): evidence = {"version": "rune-native-skill-evidence/v1", "harness_version": harness_version, "model_route": model_route, "cwd": cwd, "inventory_digest": inventory["inventory_digest"], "configuration_digest": inventory["configuration_digest"], "session_id": session_id, - "observed_at": datetime.now(timezone.utc).isoformat(), "catalog": catalog, + "observed_at": datetime.now(UTC).isoformat(), "catalog": catalog, "accesses": [{key: event[key] for key in ["skill_path", "companion_path", "content_sha256"]} | {"tool_event_id": event["event_id"]} for event in normalized if event["type"] == "tool_access"], "checks": checks, "transcript_sha256": sha256(transcript), "raw_transcript_sha256": sha256(raw)} (output / "evidence.json").write_text(json.dumps(evidence, indent=2) + "\n") diff --git a/scripts/run-artifact-checks.py b/scripts/run-artifact-checks.py index 293233f5..afdf4d09 100755 --- a/scripts/run-artifact-checks.py +++ b/scripts/run-artifact-checks.py @@ -248,7 +248,7 @@ def state(root, manifest, options): def utc_stamp(seconds): return ( - datetime.datetime.fromtimestamp(seconds, datetime.timezone.utc) + datetime.datetime.fromtimestamp(seconds, datetime.UTC) .isoformat(timespec="microseconds") .replace("+00:00", "Z") ) diff --git a/src/assemble/pipeline_tests.rs b/src/assemble/pipeline_tests.rs index 9d9cc547..b116351f 100644 --- a/src/assemble/pipeline_tests.rs +++ b/src/assemble/pipeline_tests.rs @@ -141,7 +141,7 @@ fn multi_provider_produces_separate_outputs() { let (results, errors) = pipeline::assemble_module(&sources, &providers, &tool_mappings, &[]); - assert!(errors.is_empty()); + assert_eq!(errors, [] as [String; 0]); assert_eq!(results.len(), 2); let paths: Vec<&str> = results.iter().map(|r| r.output_path.as_str()).collect(); @@ -174,7 +174,7 @@ fn unknown_rule_collected_as_error() { let (results, errors) = pipeline::assemble_module(&sources, &providers, &tool_mappings, &[]); - assert!(!errors.is_empty()); + assert_ne!(errors, [] as [String; 0]); assert!(errors[0].contains("unknown assembly rule")); // Files still assembled (unknown rule skipped, valid rules applied) assert_eq!(results.len(), 1); @@ -191,5 +191,5 @@ fn empty_sources_produces_empty_results() { let (results, errors) = pipeline::assemble_module(&sources, &providers, &tool_mappings, &[]); assert!(results.is_empty()); - assert!(errors.is_empty()); + assert_eq!(errors, [] as [String; 0]); } diff --git a/src/assemble/tests.rs b/src/assemble/tests.rs index 6fa96be9..536cceae 100644 --- a/src/assemble/tests.rs +++ b/src/assemble/tests.rs @@ -229,7 +229,7 @@ fn extract_returns_urls() { #[test] fn extract_returns_empty_for_no_refs() { let urls = references::extract("No refs here."); - assert!(urls.is_empty()); + assert_eq!(urls, [] as [String; 0]); } const REFS_MNEMONIC: &str = fixture!("refs-mnemonic.md"); diff --git a/src/cli/adopt/tests.rs b/src/cli/adopt/tests.rs index f8d09b5d..597542a9 100644 --- a/src/cli/adopt/tests.rs +++ b/src/cli/adopt/tests.rs @@ -542,7 +542,7 @@ fn review_session_records_pending_blocks_and_refuses_double_start() { let blocks = record["review"]["predicate"]["blocks"] .as_sequence() .expect("blocks"); - assert!(!blocks.is_empty()); + assert_ne!(blocks.as_slice(), [] as [serde_yaml::Value; 0]); assert!( blocks .iter() diff --git a/src/cli/assemble/sources.rs b/src/cli/assemble/sources.rs index 85bd88e0..78245ae0 100644 --- a/src/cli/assemble/sources.rs +++ b/src/cli/assemble/sources.rs @@ -41,7 +41,7 @@ mod skill_symlink_tests { .find(|source| source.relative_path.ends_with("/Alias.md")) .unwrap(); assert!(alias.passthrough); - assert!(alias.content.is_empty()); + assert_eq!(alias.content, ""); assert!(alias.content_bytes.is_none()); } diff --git a/src/cli/bench/tests.rs b/src/cli/bench/tests.rs index 8cd0a245..75faa40e 100644 --- a/src/cli/bench/tests.rs +++ b/src/cli/bench/tests.rs @@ -921,7 +921,7 @@ fn second_run_reuses_every_prior_result() { match &record.result { Some(RecordResult::Reused(reused)) => { assert!(reused.reused); - assert!(!reused.source_file.is_empty()); + assert_ne!(reused.source_file, ""); } other => panic!("expected reused result, got {other:?}"), } @@ -993,6 +993,6 @@ fn regenerate_reports_nothing_when_cache_is_empty() { let root = tempfile::tempdir().expect("tempdir"); let rebuilt = regenerate_from_cache(&echo_options(&suite, &models, root.path(), None, None)) .expect("regenerates"); - assert!(rebuilt.model_ids.is_empty()); + assert_eq!(rebuilt.model_ids, [] as [String; 0]); assert!(rebuilt.records.is_empty()); } diff --git a/src/cli/closure/tests.rs b/src/cli/closure/tests.rs index 5aa2303c..3f93757c 100644 --- a/src/cli/closure/tests.rs +++ b/src/cli/closure/tests.rs @@ -119,7 +119,7 @@ fn a_missing_change_is_an_error_that_names_it() { fn declared_capabilities_reads_only_the_section() { let text = "## What Changes\n\n### New Capabilities\n\n- `a-b-c`: x\n- plain item\n- `d-e-f`: y\n\n### Modified Capabilities\n\n- `g-h-i`: z\n"; assert_eq!(declared_capabilities(text), ["a-b-c", "d-e-f"]); - assert!(declared_capabilities("# No section\n").is_empty()); + assert_eq!(declared_capabilities("# No section\n"), [] as [String; 0]); } #[test] diff --git a/src/cli/config/tests.rs b/src/cli/config/tests.rs index 20181271..ec599cf3 100644 --- a/src/cli/config/tests.rs +++ b/src/cli/config/tests.rs @@ -36,7 +36,7 @@ fn load_merged_config_succeeds_on_missing_defaults() { let temp_directory = TempDir::new().unwrap(); let result = load_merged_config(temp_directory.path()); assert!(result.is_ok()); - assert!(result.unwrap().is_empty()); + assert_eq!(result.unwrap(), ""); } #[test] @@ -44,7 +44,7 @@ fn load_merged_config_succeeds_on_empty_defaults() { let temp_directory = TempDir::new().unwrap(); std::fs::write(temp_directory.path().join("defaults.yaml"), "").unwrap(); let result = load_merged_config(temp_directory.path()).unwrap(); - assert!(result.is_empty()); + assert_eq!(result, ""); assert!(load_providers(&result).is_ok()); } @@ -145,7 +145,7 @@ fn load_models_returns_embedded_defaults() { fn load_source_uri_returns_empty_for_missing_module_yaml() { let temp_directory = TempDir::new().unwrap(); let result = load_source_uri(temp_directory.path()); - assert!(result.is_empty()); + assert_eq!(result, ""); } #[test] diff --git a/src/cli/context.rs b/src/cli/context.rs index 311488f9..b43e0dab 100644 --- a/src/cli/context.rs +++ b/src/cli/context.rs @@ -329,6 +329,6 @@ mod tests { assert!(!codex.deployed); assert_eq!(codex.deployment_state, DeploymentState::NotInstalled); - assert!(warnings.is_empty()); + assert_eq!(warnings, [] as [String; 0]); } } diff --git a/src/cli/copy/tests.rs b/src/cli/copy/tests.rs index 15644372..66dea195 100644 --- a/src/cli/copy/tests.rs +++ b/src/cli/copy/tests.rs @@ -439,7 +439,7 @@ fn execute_sidecar_round_trips_typed() { ); assert_eq!(sidecar.provenance.subject.len(), 1); assert_eq!(sidecar.provenance.subject[0].name, "rules/Roundtrip.md"); - assert!(!sidecar.provenance.subject[0].digest.sha256.is_empty()); + assert_ne!(sidecar.provenance.subject[0].digest.sha256, ""); let build = &sidecar.provenance.predicate.build_definition; assert!(build.build_type.ends_with("/copy/v1")); @@ -457,5 +457,5 @@ fn execute_sidecar_round_trips_typed() { let runner = &sidecar.provenance.predicate.run_details; assert_eq!(runner.builder.id, env!("CARGO_PKG_REPOSITORY")); assert_eq!(runner.builder.version.rune, env!("CARGO_PKG_VERSION")); - assert!(!runner.metadata.started_on.is_empty()); + assert_ne!(runner.metadata.started_on, ""); } diff --git a/src/cli/deploy/tests.rs b/src/cli/deploy/tests.rs index 32056d79..e385bb30 100644 --- a/src/cli/deploy/tests.rs +++ b/src/cli/deploy/tests.rs @@ -37,7 +37,7 @@ fn collect_files_recursive_finds_nested_files() { fn collect_files_recursive_empty_directory() { let temp_directory = TempDir::new().unwrap(); let files = collect_files_recursive(temp_directory.path()).unwrap(); - assert!(files.is_empty()); + assert_eq!(files, [] as [std::path::PathBuf; 0]); } #[test] diff --git a/src/cli/doctor.rs b/src/cli/doctor.rs index 128f9a46..2c330f94 100644 --- a/src/cli/doctor.rs +++ b/src/cli/doctor.rs @@ -926,7 +926,7 @@ mod tests { assert_eq!(findings[0].status, IntegrityStatus::Orphan); let reports = draft_reports(root.path()).unwrap(); - assert!(reports.is_empty()); + assert_eq!(reports, [] as [crate::cli::doctor::DraftReport; 0]); fs::write( root.path().join(".drafts"), diff --git a/src/cli/dotrune/tests.rs b/src/cli/dotrune/tests.rs index 2c52305d..76540709 100644 --- a/src/cli/dotrune/tests.rs +++ b/src/cli/dotrune/tests.rs @@ -21,8 +21,8 @@ fn parse_minimal_happy_path() { assert_eq!(local.to_string_lossy(), "../rune-core"); assert!(path.is_none()); assert_eq!(manifest.runes["rune-core"].skills, vec!["BuildSkill"]); - assert!(manifest.runes["rune-core"].agents.is_empty()); - assert!(manifest.runes["rune-core"].rules.is_empty()); + assert_eq!(manifest.runes["rune-core"].agents, [] as [String; 0]); + assert_eq!(manifest.runes["rune-core"].rules, [] as [String; 0]); } #[test] @@ -371,8 +371,8 @@ runes: rules: [OnlyRule] "; let manifest = parse(content).unwrap(); - assert!(manifest.runes["a"].skills.is_empty()); - assert!(manifest.runes["a"].agents.is_empty()); + assert_eq!(manifest.runes["a"].skills, [] as [String; 0]); + assert_eq!(manifest.runes["a"].agents, [] as [String; 0]); assert_eq!(manifest.runes["a"].rules, vec!["OnlyRule"]); } diff --git a/src/cli/drift/tests.rs b/src/cli/drift/tests.rs index 4772bc73..a63b8975 100644 --- a/src/cli/drift/tests.rs +++ b/src/cli/drift/tests.rs @@ -54,7 +54,7 @@ fn split_parts_separates_frontmatter_and_body() { fn split_parts_returns_full_content_as_body_without_frontmatter() { let content = "No frontmatter here."; let (frontmatter, body) = split_parts(content); - assert!(frontmatter.is_empty()); + assert_eq!(frontmatter, ""); assert_eq!(body, content); } @@ -78,7 +78,7 @@ fn diff_frontmatter_keys_detects_added_key() { fn diff_frontmatter_keys_returns_empty_when_identical() { let yaml = "name: test\nversion: 0.1.0\n"; let changed = diff_frontmatter_keys(yaml, yaml); - assert!(changed.is_empty()); + assert_eq!(changed, [] as [String; 0]); } #[test] diff --git a/src/cli/exec/tests.rs b/src/cli/exec/tests.rs index da9f3a0c..12b2879f 100644 --- a/src/cli/exec/tests.rs +++ b/src/cli/exec/tests.rs @@ -97,7 +97,7 @@ fn output_schema_bad_payload_fails_validation() { panic!("expected completed exec"); }; assert_eq!(result.exit_code, 1); - assert!(!result.validation_errors.is_empty()); + assert_ne!(result.validation_errors, [] as [String; 0]); } #[test] diff --git a/src/cli/graph/mod.rs b/src/cli/graph/mod.rs index 5dba2d60..4a8b3fa5 100644 --- a/src/cli/graph/mod.rs +++ b/src/cli/graph/mod.rs @@ -409,6 +409,9 @@ mod tests { ); let scalar = "---\nchange: one-change\n---\n"; assert_eq!(list_values(scalar, "change"), vec!["one-change"]); - assert!(list_values("---\nchange: []\n---\n", "change").is_empty()); + assert_eq!( + list_values("---\nchange: []\n---\n", "change"), + [] as [String; 0] + ); } } diff --git a/src/cli/install/tests.rs b/src/cli/install/tests.rs index bb2d1318..48409b98 100644 --- a/src/cli/install/tests.rs +++ b/src/cli/install/tests.rs @@ -237,10 +237,9 @@ fn commitless_repository_has_no_freshness_warning() { .unwrap(); assert!(detect_stale_source(module.path()).unwrap().is_none()); - assert!( - warn_or_block_stale_source(module.path(), false, "rune install --allow-stale") - .unwrap() - .is_empty() + assert_eq!( + warn_or_block_stale_source(module.path(), false, "rune install --allow-stale").unwrap(), + [] as [String; 0] ); } diff --git a/src/cli/launch/check/tests.rs b/src/cli/launch/check/tests.rs index d533fdc7..3bd1889f 100644 --- a/src/cli/launch/check/tests.rs +++ b/src/cli/launch/check/tests.rs @@ -71,7 +71,10 @@ fn plan_without_a_base_url_has_nothing_to_check() { env(&[("ANTHROPIC_MODEL", "kimi-k3")]), Some("kimi-k3"), ); - assert!(plan_checks(&launch, None).is_empty()); + assert_eq!( + plan_checks(&launch, None), + [] as [crate::cli::launch::check::EndpointCheck; 0] + ); let report = run_checks(&launch, None); assert_eq!(report.exit_code, EXIT_SERVED); assert!(format_report(&report).contains("nothing to check")); @@ -231,7 +234,10 @@ fn a_tool_with_a_configured_base_url_key_uses_it() { #[test] fn a_tool_without_any_base_url_has_nothing_to_check() { let launch = resolved("ollama", env(&[]), Some("llama3")); - assert!(plan_checks(&launch, None).is_empty()); + assert_eq!( + plan_checks(&launch, None), + [] as [crate::cli::launch::check::EndpointCheck; 0] + ); } #[test] diff --git a/src/cli/launch/tests.rs b/src/cli/launch/tests.rs index 7cc5aa0a..3f46f585 100644 --- a/src/cli/launch/tests.rs +++ b/src/cli/launch/tests.rs @@ -209,7 +209,10 @@ fn wrapped_launch_does_not_apply_env_to_wrapper_process() { .expect("compose"); let tool = resolve_tool("claude", &Launch::default()); - assert!(process_env(&tool, &plan).is_empty()); + assert_eq!( + process_env(&tool, &plan), + [] as [(std::ffi::OsString, std::ffi::OsString); 0] + ); } #[test] @@ -550,8 +553,8 @@ fn direct_flag_disables_profile_middleware() { ) .expect("direct profile launch"); - assert!(resolved.pre.is_empty()); - assert!(resolved.wrap.is_empty()); + assert_eq!(resolved.pre, [] as [crate::cli::launch::PreStep; 0]); + assert_eq!(resolved.wrap, [] as [Vec; 0]); } #[test] @@ -679,7 +682,7 @@ fn check_flag_parses_like_dry_run() { .expect("parse"); assert!(parsed.check); assert!(parsed.dry_run); - assert!(parsed.args.is_empty()); + assert_eq!(parsed.args, [] as [std::ffi::OsString; 0]); } #[test] @@ -849,6 +852,6 @@ fn direct_mode_omits_profile_middleware() { ) .expect("direct launch"); - assert!(resolved.wrap.is_empty()); - assert!(resolved.pre.is_empty()); + assert_eq!(resolved.wrap, [] as [Vec; 0]); + assert_eq!(resolved.pre, [] as [crate::cli::launch::PreStep; 0]); } diff --git a/src/cli/promote/tests.rs b/src/cli/promote/tests.rs index e7a4da24..cb2167fd 100644 --- a/src/cli/promote/tests.rs +++ b/src/cli/promote/tests.rs @@ -76,11 +76,11 @@ fn promote_moves_the_draft_and_writes_the_change_stub() { ); assert!(!draft_file.exists(), "the provider copy is gone"); assert!(!consumer.path().join(".claude/skills/ReviewSpec").exists()); - assert!( + assert_eq!( Register::load(consumer.path()) .unwrap() - .by_name("ReviewSpec") - .is_empty() + .by_name("ReviewSpec"), + [] as [&rune::manifest::drafts::Draft; 0] ); assert_eq!(done.removed, vec![".claude/skills/ReviewSpec/SKILL.md"]); @@ -153,11 +153,9 @@ fn promote_keeps_the_draft_when_the_stub_cannot_be_written() { consumer.path().join(".claude/rules/Terse.md").exists(), "the draft stays" ); - assert!( - !Register::load(consumer.path()) - .unwrap() - .by_name("Terse") - .is_empty() + assert_ne!( + Register::load(consumer.path()).unwrap().by_name("Terse"), + [] as [&rune::manifest::drafts::Draft; 0] ); assert!( !deck.path().join("runes/core/rules/Terse.md").exists(), diff --git a/src/cli/proof/fence.rs b/src/cli/proof/fence.rs index fb200000..be5b4e70 100644 --- a/src/cli/proof/fence.rs +++ b/src/cli/proof/fence.rs @@ -340,7 +340,7 @@ mod tests { assert!(two[0].expected.ends_with("...")); assert_eq!(two[1].argv, ["printf", "a b", "c", "--flag"]); assert_eq!(two[1].command_lines.len(), 2); - assert!(scenes[2].steps.is_empty()); + assert_eq!(scenes[2].steps, [] as [crate::cli::proof::fence::Step; 0]); } #[test] diff --git a/src/cli/provenance/scan.rs b/src/cli/provenance/scan.rs index f07bb711..ddeca56b 100644 --- a/src/cli/provenance/scan.rs +++ b/src/cli/provenance/scan.rs @@ -603,7 +603,7 @@ mod tests { let (by_source, orphans) = collect(target.path()); - assert!(orphans.is_empty()); + assert_eq!(orphans, [] as [String; 0]); let (verified, total) = by_source["https://example.test/upstream"]; assert_eq!(total, 1); assert_eq!(verified, 1); @@ -623,7 +623,7 @@ mod tests { by_source.is_empty(), "dotfile and stray .yaml must not appear" ); - assert!(orphans.is_empty()); + assert_eq!(orphans, [] as [String; 0]); } #[test] diff --git a/src/cli/repair/tests.rs b/src/cli/repair/tests.rs index d937278a..e4576c47 100644 --- a/src/cli/repair/tests.rs +++ b/src/cli/repair/tests.rs @@ -81,7 +81,7 @@ fn modified_file_is_reported_and_never_repaired() { assert!(remaining[0].findings.iter().any(|finding| { finding.status == IntegrityStatus::Modified && finding.path == "skills/Alpha/SKILL.md" })); - assert!(repairs.is_empty()); + assert_eq!(repairs, [] as [crate::cli::repair::RepairAction; 0]); } #[test] @@ -125,7 +125,7 @@ fn repair_does_not_restore_source_with_wrong_digest() { .iter() .any(|finding| finding.status == IntegrityStatus::Missing) ); - assert!(repairs.is_empty()); + assert_eq!(repairs, [] as [crate::cli::repair::RepairAction; 0]); } #[test] diff --git a/src/cli/sign/queue/tests.rs b/src/cli/sign/queue/tests.rs index e85901ab..e7d4c80a 100644 --- a/src/cli/sign/queue/tests.rs +++ b/src/cli/sign/queue/tests.rs @@ -177,7 +177,10 @@ fn store_round_trips_requests_and_removes_them() { assert_eq!(store.load("one").expect("load"), request); assert_eq!(store.load_all().expect("all").len(), 1); store.remove("one").expect("remove"); - assert!(store.load_all().expect("all").is_empty()); + assert_eq!( + store.load_all().expect("all"), + [] as [crate::cli::sign::queue::store::Request; 0] + ); } #[test] diff --git a/src/cli/surface/tests.rs b/src/cli/surface/tests.rs index 1be522c8..8884a99b 100644 --- a/src/cli/surface/tests.rs +++ b/src/cli/surface/tests.rs @@ -91,7 +91,7 @@ fn claude_settings_with_only_owned_keys_is_dropped_whole() { Surface::Claude, &["--settings", r#"{"permissions":{"allow":["Bash"]}}"#], )); - assert!(filtered.kept.is_empty()); + assert_eq!(filtered.kept, [] as [std::ffi::OsString; 0]); assert_eq!(filtered.warnings.len(), 2, "{:?}", filtered.warnings); assert!(filtered.warnings[1].contains("nothing remains")); } @@ -155,7 +155,7 @@ fn claude_settings_path_is_dropped_not_loaded() { Surface::Claude, &["--settings", "/home/me/wide-open.json"], )); - assert!(filtered.kept.is_empty()); + assert_eq!(filtered.kept, [] as [std::ffi::OsString; 0]); assert!(filtered.warnings[0].contains("only an inline JSON object is filtered")); } @@ -174,7 +174,7 @@ fn warnings_escape_control_characters_and_name_the_value() { fn unowned_profile_args_pass_through_untouched() { let filtered = filter_surface_args(&invocation(Surface::Grok, &["--effort", "high"])); assert_eq!(strings(&filtered.kept), ["--effort", "high"]); - assert!(filtered.warnings.is_empty()); + assert_eq!(filtered.warnings, [] as [String; 0]); } #[test] diff --git a/src/cli/theme.rs b/src/cli/theme.rs index 46faa0ae..d97963de 100644 --- a/src/cli/theme.rs +++ b/src/cli/theme.rs @@ -371,7 +371,7 @@ mod tests { let (tones, warnings) = resolve(&selection, Appearance::Unknown); assert_eq!(tones.accent.rgb, (255, 0, 0)); assert_eq!(tones.good, named(DEFAULT_DARK).unwrap().good); - assert!(warnings.is_empty()); + assert_eq!(warnings, [] as [String; 0]); } #[test] diff --git a/src/cli/validate/repository/tests.rs b/src/cli/validate/repository/tests.rs index 1753f66d..ef47be83 100644 --- a/src/cli/validate/repository/tests.rs +++ b/src/cli/validate/repository/tests.rs @@ -45,7 +45,7 @@ fn detects_matching_file() { let mut report = ValidationReport::default(); check_template_drift(temp_directory.path(), &mut report); - assert!(report.result.warnings.is_empty()); + assert_eq!(report.result.warnings, [] as [String; 0]); } #[test] diff --git a/src/cli/validate/tests.rs b/src/cli/validate/tests.rs index efc6e6a6..64448713 100644 --- a/src/cli/validate/tests.rs +++ b/src/cli/validate/tests.rs @@ -181,7 +181,7 @@ fn check_module_structure_passes_with_all_required_files() { let mut report = ValidationReport::default(); check_module_structure(temp_directory.path(), &mut report); - assert!(report.result.errors.is_empty()); + assert_eq!(report.result.errors, [] as [String; 0]); } #[test] @@ -207,7 +207,7 @@ fn check_module_yaml_skips_when_no_module_yaml() { check_module_yaml(temp_directory.path(), &mut report); - assert!(report.result.errors.is_empty()); + assert_eq!(report.result.errors, [] as [String; 0]); } #[test] @@ -276,7 +276,7 @@ fn top_level_validation_preserves_specification_schema_warnings() { check_spec_lifecycle_with_validator(root.path(), &mut report, specification_schema_warning) .unwrap(); - assert!(report.result.errors.is_empty()); + assert_eq!(report.result.errors, [] as [String; 0]); assert_eq!( report.result.warnings, vec!["docs/specs/search/spec.md:4: schema advisory"] diff --git a/src/cli/watchlist/tests.rs b/src/cli/watchlist/tests.rs index bbfeaf14..5a059a1e 100644 --- a/src/cli/watchlist/tests.rs +++ b/src/cli/watchlist/tests.rs @@ -57,7 +57,10 @@ fn git_entry_round_trips_through_yaml() { #[test] fn empty_yaml_yields_no_locations() { let config: WatchlistConfig = serde_yaml::from_str("{}").expect("parse empty"); - assert!(config.locations.is_empty()); + assert_eq!( + config.locations, + [] as [crate::cli::watchlist::WatchEntry; 0] + ); } #[test] @@ -111,7 +114,10 @@ fn load_strict_from_absent_path_is_empty_ok() { let dir = tempfile::tempdir().expect("tempdir"); let path = dir.path().join("watchlist.yaml"); let config = load_strict_from(&path).expect("absent file is ok"); - assert!(config.locations.is_empty()); + assert_eq!( + config.locations, + [] as [crate::cli::watchlist::WatchEntry; 0] + ); } #[test] @@ -120,7 +126,10 @@ fn load_strict_from_zero_byte_file_is_empty_ok() { let path = dir.path().join("watchlist.yaml"); std::fs::write(&path, "").expect("write empty"); let config = load_strict_from(&path).expect("empty file is ok"); - assert!(config.locations.is_empty()); + assert_eq!( + config.locations, + [] as [crate::cli::watchlist::WatchEntry; 0] + ); } #[test] @@ -165,7 +174,10 @@ fn load_lenient_from_corrupt_file_is_empty() { let path = dir.path().join("watchlist.yaml"); std::fs::write(&path, "locations:\n - [unterminated\n").expect("write corrupt"); let config = load_lenient_from(&path); - assert!(config.locations.is_empty()); + assert_eq!( + config.locations, + [] as [crate::cli::watchlist::WatchEntry; 0] + ); } #[test] diff --git a/src/deck/tests.rs b/src/deck/tests.rs index 548dfe94..4b535003 100644 --- a/src/deck/tests.rs +++ b/src/deck/tests.rs @@ -72,7 +72,7 @@ fn skips_dotfiles_under_runes_without_warning() { let deck = load(root.path()).unwrap(); assert!(deck.entries.is_empty()); - assert!(deck.warnings.is_empty()); + assert_eq!(deck.warnings, [] as [String; 0]); } #[test] @@ -87,7 +87,7 @@ fn skips_root_readme_under_runes_without_warning() { let deck = load(root.path()).unwrap(); assert!(deck.entries.is_empty()); - assert!(deck.warnings.is_empty()); + assert_eq!(deck.warnings, [] as [String; 0]); } #[test] diff --git a/src/manifest/bundle/tests.rs b/src/manifest/bundle/tests.rs index a7e434d9..0996d194 100644 --- a/src/manifest/bundle/tests.rs +++ b/src/manifest/bundle/tests.rs @@ -40,7 +40,10 @@ fn bundle_identity_is_versioned_and_stable() { write(root.path(), "refs/Reference.md", b"Reference.\n"); let first = inspect_bundle(root.path()); assert_eq!(first.version, BUNDLE_DIGEST_VERSION); - assert!(first.problems.is_empty()); + assert_eq!( + first.problems, + [] as [crate::manifest::bundle::BundleProblem; 0] + ); assert_eq!(first, inspect_bundle(root.path())); assert_eq!( first diff --git a/src/result.rs b/src/result.rs index be3b4c8d..9b69753a 100644 --- a/src/result.rs +++ b/src/result.rs @@ -57,8 +57,8 @@ mod tests { assert!(result.installed.is_empty()); assert!(result.skipped.is_empty()); assert!(result.pruned.is_empty()); - assert!(result.warnings.is_empty()); - assert!(result.errors.is_empty()); + assert_eq!(result.warnings, [] as [String; 0]); + assert_eq!(result.errors, [] as [String; 0]); } #[test] diff --git a/src/services/builders.rs b/src/services/builders.rs index 8264d350..15c61b35 100644 --- a/src/services/builders.rs +++ b/src/services/builders.rs @@ -653,8 +653,8 @@ mod tests { .iter() .find(|row| row.name == "HasModel") .expect("variant row"); - assert!(has_model.cells[0].mode.is_empty()); - assert!(has_model.cells[0].link.is_empty()); + assert_eq!(has_model.cells[0].mode, ""); + assert_eq!(has_model.cells[0].link, ""); assert_eq!(has_model.cells[1].mode, "replace"); } } diff --git a/src/services/history.rs b/src/services/history.rs index dcd2490e..08310a8a 100644 --- a/src/services/history.rs +++ b/src/services/history.rs @@ -671,7 +671,7 @@ mod tests { assert_eq!(commits[0].message, "feat: add thing"); assert_eq!(commits[0].author, "Alice Example"); assert_eq!(commits[0].checkpoint, "933ba0519d0a"); - assert!(commits[1].checkpoint.is_empty()); + assert_eq!(commits[1].checkpoint, ""); } #[test] diff --git a/src/services/mod.rs b/src/services/mod.rs index 1d3ab19c..0a66395c 100644 --- a/src/services/mod.rs +++ b/src/services/mod.rs @@ -1038,10 +1038,9 @@ mod tests { assert!(!edit.after.contains(&"science/rules/Alpha".to_string())); persist_cast_edit(&edit).unwrap(); let deck = crate::deck::load(temp.path()).unwrap(); - assert!( - deck.resolve_cast("all", ["science/rules/Alpha"]) - .unwrap() - .is_empty() + assert_eq!( + deck.resolve_cast("all", ["science/rules/Alpha"]).unwrap(), + [] as [String; 0] ); } diff --git a/src/skill_readiness/portability/tests.rs b/src/skill_readiness/portability/tests.rs index b81b88d4..ea79fb7e 100644 --- a/src/skill_readiness/portability/tests.rs +++ b/src/skill_readiness/portability/tests.rs @@ -31,7 +31,10 @@ fn symbols_match_case_insensitively_at_identifier_boundaries() { #[test] fn ordinary_words_and_portable_metadata_remain_valid() { let text = "---\nname: Portable\nallowed-tools: [Read, Write, Edit]\nmetadata:\n context: fork\n agent: worker\n model: chosen\n hooks: []\n---\nRead, Write, Edit, Task, Agent, model, and context are ordinary words.\n"; - assert!(inspect_text(text, &CODEX_POLICY, true).unwrap().is_empty()); + assert_eq!( + inspect_text(text, &CODEX_POLICY, true).unwrap(), + [] as [crate::skill_readiness::portability::Violation; 0] + ); } #[test] @@ -88,10 +91,9 @@ fn claude_command_injection_and_exact_tool_calls_are_literal_violations() { assert_eq!(violations[0].token, "!`"); assert_eq!(violations[0].line, 1); let ordinary = "Bash and Read are tool names. read(path) is ordinary code. MyBash(command) prefix_Read(path) stay distinct.\n"; - assert!( - inspect_text(ordinary, &CODEX_POLICY, false) - .unwrap() - .is_empty() + assert_eq!( + inspect_text(ordinary, &CODEX_POLICY, false).unwrap(), + [] as [crate::skill_readiness::portability::Violation; 0] ); } @@ -200,7 +202,10 @@ fn escaping_or_replaced_symlinks_never_expose_external_text() { ) .unwrap(); let bundle = inspect_bundle(root.path()); - assert!(!bundle.problems.is_empty()); + assert_ne!( + bundle.problems, + [] as [crate::manifest::bundle::BundleProblem; 0] + ); assert!(inspect_rendered(root.path(), &bundle).is_empty()); fs::write(root.path().join("guide.md"), "Safe instructions.\n").unwrap(); let bundle = inspect_bundle(root.path()); diff --git a/src/tui/cast_editor/tests.rs b/src/tui/cast_editor/tests.rs index b99307c5..e52ee464 100644 --- a/src/tui/cast_editor/tests.rs +++ b/src/tui/cast_editor/tests.rs @@ -56,7 +56,7 @@ fn preselects_cast_and_materializes_it_when_member_is_unchecked() { let manifest = dotrune::load(&consumer).unwrap().unwrap(); let selection = &manifest.runes["deck"]; - assert!(selection.casts.is_empty()); + assert_eq!(selection.casts, [] as [String; 0]); assert_eq!(selection.include, ["science/agents/Researcher"]); assert!(editor.status.contains("materialized cast lab")); } diff --git a/src/tui/tests.rs b/src/tui/tests.rs index 0a5d00bc..55fd4e64 100644 --- a/src/tui/tests.rs +++ b/src/tui/tests.rs @@ -938,7 +938,7 @@ fn launch_queues_harness_in_module_repo() { let command = app.take_external().expect("launch queued"); assert_eq!(command.directory, PathBuf::from("/tmp/rune-core")); - assert!(command.args.is_empty()); + assert_eq!(command.args, [] as [String; 0]); } #[test] diff --git a/src/validate/mdschema/tests.rs b/src/validate/mdschema/tests.rs index 64069da9..6b8ba9a8 100644 --- a/src/validate/mdschema/tests.rs +++ b/src/validate/mdschema/tests.rs @@ -56,7 +56,10 @@ fn outline_reports_file_line_after_frontmatter() { #[test] fn extract_headings_empty_body() { let headings = extract_headings(""); - assert!(headings.is_empty()); + assert_eq!( + headings, + [] as [crate::validate::mdschema::heading::Heading; 0] + ); } #[test] diff --git a/src/validate/tests.rs b/src/validate/tests.rs index 0a7c975d..c7675de3 100644 --- a/src/validate/tests.rs +++ b/src/validate/tests.rs @@ -287,7 +287,7 @@ fn hooks_manifest_invalid_json_errors() { let (diagnostics, scripts) = validate_hooks_manifest("{bad", "hooks.json"); assert_eq!(diagnostics.len(), 1); assert!(diagnostics[0].message.contains("invalid JSON")); - assert!(scripts.is_empty()); + assert_eq!(scripts, [] as [String; 0]); } #[test] @@ -320,5 +320,5 @@ fn hooks_manifest_ignores_non_convention_command() { diagnostics.is_empty(), "non-convention command is not flagged" ); - assert!(scripts.is_empty()); + assert_eq!(scripts, [] as [String; 0]); } diff --git a/tests/cli.rs b/tests/cli.rs index 2fba15f1..2d93e457 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -331,7 +331,7 @@ fn structured_error_json_has_the_stable_shape() { .unwrap(); assert_eq!(output.status.code(), Some(2)); - assert!(output.stderr.is_empty()); + assert_eq!(output.stderr, [] as [u8; 0]); let error: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); assert_eq!( error, @@ -360,7 +360,7 @@ fn init_errors_use_the_shared_json_renderer() { .unwrap(); assert_eq!(output.status.code(), Some(2)); - assert!(output.stderr.is_empty()); + assert_eq!(output.stderr, [] as [u8; 0]); let error: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); assert_eq!(error["code"], "error.io"); assert!( @@ -382,7 +382,7 @@ fn structured_error_human_fix_uses_a_separate_line() { .unwrap(); assert_eq!(output.status.code(), Some(2)); - assert!(output.stdout.is_empty()); + assert_eq!(output.stdout, [] as [u8; 0]); let stderr = String::from_utf8(output.stderr).unwrap(); let lines = stderr.lines().collect::>(); assert_eq!(lines.len(), 2); @@ -602,7 +602,7 @@ fn strict_install_error_uses_the_resolved_review_command() { .unwrap(); assert_eq!(output.status.code(), Some(1)); - assert!(output.stderr.is_empty()); + assert_eq!(output.stderr, [] as [u8; 0]); let error: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); let source = source.canonicalize().unwrap(); let expected = format!( diff --git a/tests/codex_skill_identity.rs b/tests/codex_skill_identity.rs index 6de5e641..1c44bfc1 100644 --- a/tests/codex_skill_identity.rs +++ b/tests/codex_skill_identity.rs @@ -193,7 +193,10 @@ fn complete_selected_bundle_deploys() { "{companion}" ); } - assert!(inspect_bundle(&root).problems.is_empty()); + assert_eq!( + inspect_bundle(&root).problems, + [] as [rune::manifest::bundle::BundleProblem; 0] + ); } #[test] @@ -393,7 +396,10 @@ fn retained_legacy_copy_blocks_unique_readiness_until_migration_completes() { .is_empty() ); assert!(completed.static_valid, "{completed:#?}"); - assert!(completed.findings.is_empty()); + assert_eq!( + completed.findings, + [] as [rune::skill_readiness::ReadinessFinding; 0] + ); assert_eq!(completed.skills.len(), 1); assert_eq!( completed.skills[0].path, @@ -791,7 +797,10 @@ fn case_aliases_and_symlinks_are_accounted_for() { ); assert_ne!(linked.digest, inspect_bundle(&root).digest); symlink("../outside", root.join("escape")).unwrap(); - assert!(!inspect_bundle(&root).problems.is_empty()); + assert_ne!( + inspect_bundle(&root).problems, + [] as [rune::manifest::bundle::BundleProblem; 0] + ); #[cfg(target_os = "macos")] { let probe = tempfile::tempdir().unwrap(); diff --git a/tests/provider.rs b/tests/provider.rs index faaaba19..c06a10bb 100644 --- a/tests/provider.rs +++ b/tests/provider.rs @@ -17,7 +17,7 @@ fn provider_explain_json_has_the_required_shape_and_evidence() { .unwrap(); assert!(output.status.success(), "{:?}", output.status); - assert!(output.stderr.is_empty()); + assert_eq!(output.stderr, [] as [u8; 0]); let report: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); let fields = report .as_object() @@ -131,7 +131,7 @@ fn provider_status_json_reports_one_requested_provider() { .unwrap(); assert!(output.status.success(), "{:?}", output.status); - assert!(output.stderr.is_empty()); + assert_eq!(output.stderr, [] as [u8; 0]); let report: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); let providers = report["providers"].as_array().unwrap(); assert_eq!(providers.len(), 1); @@ -152,7 +152,7 @@ fn provider_status_unknown_name_has_a_structured_error() { .unwrap(); assert_eq!(output.status.code(), Some(2)); - assert!(output.stderr.is_empty()); + assert_eq!(output.stderr, [] as [u8; 0]); let error: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap(); assert_eq!(error["code"], "provider.unknown"); assert_eq!(error["fix_command"], "rune provider status"); @@ -170,7 +170,7 @@ fn provider_status_labels_a_plain_source_command_as_review() { .unwrap(); assert!(output.status.success(), "{:?}", output.status); - assert!(output.stderr.is_empty()); + assert_eq!(output.stderr, [] as [u8; 0]); let stdout = String::from_utf8(output.stdout).unwrap(); assert!(stdout.contains("review:"), "{stdout}"); assert!(stdout.contains("rune context"), "{stdout}");