Skip to content

fix: resolve clippy warnings across workspace#3933

Merged
jolestar merged 2 commits into
mainfrom
fix/clippy-warnings
Jan 19, 2026
Merged

fix: resolve clippy warnings across workspace#3933
jolestar merged 2 commits into
mainfrom
fix/clippy-warnings

Conversation

@jolestar

Copy link
Copy Markdown
Contributor

Summary

Fix all clippy warnings in the workspace while maintaining proper suppression for third-party code.

Changes

  • Fix empty_line_after_doc_comments warnings (3 occurrences)
  • Fix manual_is_multiple_of warnings (9 occurrences)
  • Fix unwrap_or_default warning (1 occurrence)
  • Fix doc_overindented_list_items warnings (5 occurrences)
  • Fix non_canonical_partial_ord_impl warning (1 occurrence)
  • Fix unnecessary_unwrap warnings (2 occurrences)
  • Fix double_ended_iterator_last warning (1 occurrence)
  • Fix useless_conversion warning (1 occurrence)
  • Add per-crate suppression for third_party warnings
  • Update Makefile rust-clippy target

Files Modified

Configuration

  • Makefile - Update rust-clippy target to remove unnecessary -A flags
  • third_party/move/language/move-borrow-graph/src/lib.rs - Add crate-level allow for third-party warnings

Source Files (moveos/metrics)

  • moveos/metrics/src/metered_channel.rs - Remove blank lines after doc comments
  • moveos/metrics/src/metrics_util.rs - Use is_multiple_of()

Source Files (moveos/smt)

  • moveos/smt/src/lib.rs - Remove blank line after doc comment
  • moveos/smt/src/jellyfish_merkle/hash.rs - Use is_multiple_of()
  • moveos/smt/src/jellyfish_merkle/iterator/mod.rs - Use unwrap_or_default()
  • moveos/smt/src/jellyfish_merkle/nibble_path/mod.rs - Use is_multiple_of()
  • moveos/smt/src/jellyfish_merkle/node_type/mod.rs - Fix doc indentation, use is_multiple_of()
  • moveos/smt/src/jellyfish_merkle/tree_cache/mod.rs - Fix doc indentation
  • moveos/smt/src/smt_object.rs - Fix PartialOrd implementation

Source Files (crates/rooch)

  • crates/rooch/src/commands/statedb/commands/export.rs - Use is_multiple_of() (4 occurrences)
  • crates/rooch/src/commands/statedb/commands/genesis_verify.rs - Multiple fixes (16 warnings)

Testing

  • make rust-clippy - No warnings in project code
  • make quick-check - Successful compilation

Test Plan

  • Run make rust-clippy - verify clean output for project code
  • Run make build - verify compilation succeeds
  • Run make test - verify all tests pass (if applicable)

Fix all clippy warnings in the workspace while maintaining proper suppression
for third-party code.

## Changes

- Fix `empty_line_after_doc_comments` warnings (3 occurrences)
- Fix `manual_is_multiple_of` warnings (9 occurrences)
- Fix `unwrap_or_default` warning (1 occurrence)
- Fix `doc_overindented_list_items` warnings (5 occurrences)
- Fix `non_canonical_partial_ord_impl` warning (1 occurrence)
- Fix `unnecessary_unwrap` warnings (2 occurrences)
- Fix `double_ended_iterator_last` warning (1 occurrence)
- Fix `useless_conversion` warning (1 occurrence)
- Add per-crate suppression for third_party warnings
- Update Makefile `rust-clippy` target

## Testing

- `make rust-clippy` - No warnings in project code
- `make quick-check` - Successful compilation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 19, 2026 07:21
@vercel

vercel Bot commented Jan 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rooch-portal-v2.1 Ready Ready Preview, Comment Jan 19, 2026 7:31am
test-portal Ready Ready Preview, Comment Jan 19, 2026 7:31am
1 Skipped Deployment
Project Deployment Review Updated (UTC)
rooch Ignored Ignored Jan 19, 2026 7:31am

Request Review

@github-actions

github-actions Bot commented Jan 19, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR resolves all clippy warnings in the workspace by applying idiomatic Rust patterns and properly suppressing third-party warnings at the crate level.

Changes:

  • Applied 23 clippy fixes across 10 files, including empty line removal, use of is_multiple_of(), unwrap_or_default(), proper doc indentation, canonical PartialOrd implementation, if let patterns, and double-ended iterator optimization
  • Added crate-level suppression for third-party warnings in move-borrow-graph
  • Updated Makefile to remove workspace-level clippy suppressions that are no longer needed

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Makefile Removed unnecessary -A flags for clippy warnings now fixed in code
third_party/move/language/move-borrow-graph/src/lib.rs Added crate-level allow attribute for third-party warnings
moveos/metrics/src/metered_channel.rs Removed 3 blank lines after doc comments
moveos/metrics/src/metrics_util.rs Replaced % with is_multiple_of() for cleaner modulo check
moveos/smt/src/lib.rs Removed blank line after doc comment
moveos/smt/src/jellyfish_merkle/hash.rs Replaced % with is_multiple_of()
moveos/smt/src/jellyfish_merkle/iterator/mod.rs Replaced unwrap_or(zero()) with unwrap_or_default()
moveos/smt/src/jellyfish_merkle/nibble_path/mod.rs Replaced % with is_multiple_of() in 3 locations
moveos/smt/src/jellyfish_merkle/node_type/mod.rs Fixed doc indentation and replaced % with is_multiple_of()
moveos/smt/src/jellyfish_merkle/tree_cache/mod.rs Fixed doc indentation for list items
moveos/smt/src/smt_object.rs Fixed PartialOrd to use Ord::cmp() for canonical implementation
crates/rooch/src/commands/statedb/commands/export.rs Replaced % with is_multiple_of() in 4 progress check locations
crates/rooch/src/commands/statedb/commands/genesis_verify.rs Applied 7 fixes: is_multiple_of() (4×), if let unwrap patterns (2×), next_back() for iterator, and removed useless type conversion

@jolestar jolestar merged commit d1cc930 into main Jan 19, 2026
34 checks passed
@jolestar jolestar deleted the fix/clippy-warnings branch January 19, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants