Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add lints to p2p-sync #1844

Merged
merged 1 commit into from
Nov 7, 2024
Merged

chore: add lints to p2p-sync #1844

merged 1 commit into from
Nov 7, 2024

Conversation

giladchase
Copy link
Contributor

@giladchase giladchase commented Nov 5, 2024

Add workspace lints, which in particular ban as usage.

Changes:

  1. switch as into From when applicable.
  2. replace the conditional+cast with equivalent logic u64::try_from.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

@giladchase giladchase left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, all discussions resolved


crates/papyrus_p2p_sync/src/server/utils.rs line 14 at r1 (raw file):

        Direction::Backward => -1,
    };
    // TODO(shahak): Fix this code.

Kept this, negative block number still probably needs fixing 😅

Code quote:

    // TODO(shahak): Fix this code.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 18.50%. Comparing base (e3165c4) to head (f9922df).
Report is 236 commits behind head on main.

Files with missing lines Patch % Lines
crates/papyrus_p2p_sync/src/server/utils.rs 42.85% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1844       +/-   ##
===========================================
- Coverage   40.10%   18.50%   -21.61%     
===========================================
  Files          26      100       +74     
  Lines        1895    12218    +10323     
  Branches     1895    12218    +10323     
===========================================
+ Hits          760     2261     +1501     
- Misses       1100     9528     +8428     
- Partials       35      429      +394     

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

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @elintul)

Add workspace lints, which in particular ban `as` usage.

Changes:
1. switch `as` into `From` when applicable.
2. replace the conditional+cast with _equivalent_ logic `u64::try_from`.
@giladchase giladchase merged commit 95b2dc6 into main Nov 7, 2024
17 checks passed
@giladchase giladchase deleted the gilad/p2p-lints-2 branch November 7, 2024 13:49
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.

3 participants