8000 fix(lint): restore clean cargo clippy --all-targets --all-features by adityamukho · Pull Request #112 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(lint): restore clean cargo clippy --all-targets --all-features - #112

Merged
adityamukho merged 2 commits into
mainfrom
fix/clippy-all-targets
Apr 9, 2026
Merged

adityamukho merged 2 commits into
mainfrom
fix/clippy-all-targets

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Summary

Fixes #110 — makes the full workspace pass cargo clippy --all-targets --all-features -- -D warnings without weakening any lint settings.

One lint per bullet:

  • needless_range_loop (recursive_rules_test.rs): use slice range iter &nodes[1..10] instead of index loop
  • collapsible_if (udf_test.rs): collapse nested if let + guard into if let Pat = expr && cond (Rust let-chains)
  • for_loops_over_single_element (minigraf_bench.rs): unwrap single-element tuple instead of iterating a one-item slice
  • unused_import under wasm (optimizer.rs): gate use Indexes with #[cfg(not(feature = "wasm"))] to match the test that uses it
  • to_string_in_format_args (executor.rs): drop redundant .to_string() on Uuid — Display impl suffices in format!
  • approx_constant (executor.rs): replace 3.14/2.71 test-data floats with 3.5/2.5 to avoid PI/E approximation lint
  • redundant_cast (packed_pages.rs): remove n as u64 when n is already u64
  • manual_arithmetic_check (persistent_facts.rs): use .saturating_sub(1) instead of manual if x > 1 { x - 1 } else { 0 }
  • create_without_truncate (persistent_facts.rs): add .truncate(true) to OpenOptions in test creating a fresh file
  • clone_on_slice_ref (wal.rs): use std::slice::from_ref(&fact) instead of &[fact.clone()]
  • useless_vec (functions.rs): replace vec![...] with array literals where the Vec is immediately iterated
  • doc_lazy_continuation (not_join_test.rs): add blank /// lines after numbered list items to prevent continuation-indentation warnings

Test plan

  • cargo clippy --all-targets --all-features -- -D warnings passes clean
  • cargo test — all 788 tests pass
  • cargo fmt --check passes

🤖 Generated with Claude Code

adityamukho and others added 2 commits April 9, 2026 11:45
Fixes every warning that caused `cargo clippy --all-targets --all-features
-- -D warnings` to fail, bringing test/bench/doc targets to the same
strict lint posture as lib targets.

Changes per lint:
- needless_range_loop: use slice range iter in recursive_rules_test
- collapsible_if: collapse nested if-let guards in udf_test (let-chains)
- for_loops_over_single_element: unwrap single bench tuple in minigraf_bench
- unused_import under wasm: gate `use Indexes` with #[cfg(not(feature="wasm"))]
- to_string_in_format_args: drop redundant .to_string() on Uuid Display impls
- approx_constant (PI): replace 3.14/2.71 test values with 3.5/2.5
- cast_lossless / redundant cast: remove u64 as u64 in packed_pages test
- manual_arithmetic_check: use .saturating_sub(1) in persistent_facts test
- create_without_truncate: add .truncate(true) to OpenOptions in persistent_facts test
- clone_on_ref_ptr: use std::slice::from_ref instead of &[fact.clone()] in wal test
- useless_vec: replace vec![...] with array literals in functions tests
- doc_lazy_continuation: add blank /// lines after numbered list items in not_join_test

Closes #110

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
codecov Bot commented Apr 9, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.73%. Comparing base (2d7375f) to head (7c1f75c).
⚠️ Report is 4 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (2d7375f) and HEAD (7c1f75c). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (2d7375f) HEAD (7c1f75c)
branch-coverage 1 0
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   90.63%   83.73%   -6.90%     
==========================================
  Files          26       26              
  Lines       14848     4729   -10119     
  Branches      565        0     -565     
==========================================
- Hits        13457     3960    -9497     
+ Misses       1318      769     -549     
+ Partials       73        0      -73     
Flag Coverage Δ
branch-coverage ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/query/datalog/executor.rs 93.32% <ø> (-2.92%) ⬇️
src/query/datalog/functions.rs 83.56% <ø> (-2.65%) ⬇️
src/query/datalog/optimizer.rs 100.00% <ø> (ø)
src/storage/packed_pages.rs 93.75% <ø> (-2.96%) ⬇️
src/storage/persistent_facts.rs 75.45% <ø> (-13.90%) ⬇️
src/wal.rs 88.39% <ø> (-3.97%) ⬇️

... and 20 files with indirect coverage changes

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

@adityamukho
adityamukho merged commit 19e72d4 into main Apr 9, 2026
17 checks passed
@adityamukho
adityamukho deleted the fix/clippy-all-targets branch April 9, 2026 07:36
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.

maintenance: restore clean cargo clippy --all-targets --all-features

1 participant

0