rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Added clippy ignore rules for all errors and warnings

Open Mirebella opened this issue 1 year ago • 1 comments

As mentioned https://github.com/lightningdevkit/rust-lightning/pull/3223#issuecomment-2272110136 and https://github.com/lightningdevkit/rust-lightning/pull/3223#issuecomment-2284237023, this PR adds a list of ignored(allowed) clippy errors and warnings to the CI checks.

Mirebella avatar Aug 13 '24 11:08 Mirebella

Codecov Report

Attention: Patch coverage is 82.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 89.80%. Comparing base (5e62df7) to head (0d71a5f). Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/util/indexed_map.rs 0.00% 1 Missing and 1 partial :warning:
lightning-rapid-gossip-sync/src/processing.rs 0.00% 1 Missing :warning:
lightning/src/events/mod.rs 0.00% 1 Missing :warning:
lightning/src/ln/channelmanager.rs 50.00% 1 Missing :warning:
lightning/src/routing/scoring.rs 0.00% 1 Missing :warning:
lightning/src/util/logger.rs 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3238      +/-   ##
==========================================
- Coverage   89.82%   89.80%   -0.02%     
==========================================
  Files         126      126              
  Lines      103024   103020       -4     
  Branches   103024   103020       -4     
==========================================
- Hits        92543    92519      -24     
- Misses       7769     7776       +7     
- Partials     2712     2725      +13     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 13 '24 12:08 codecov[bot]

Here is a small sample of lints that seems to be low hanging fruit and can possibly be fixed in this PR:

  • clippy::assign_op_pattern
  • clippy::assigning_clones
  • clippy::bind_instead_of_map
  • clippy::bool_comparison
  • clippy::wrong_self_convention
  • clippy::while_let_on_iterator
  • clippy::vec_init_then_push
  • clippy::useless_format
  • clippy::unwrap_or_default

A commit per lint fix would be a nice separation of concerns but combining a few small ones in a single commit should also be ok :)

dunxen avatar Aug 15 '24 09:08 dunxen

I addressed all comments above. Ready for another review.

Mirebella avatar Aug 27 '24 17:08 Mirebella

LGTM overall, just a though is if we need to have some sort of githook now to run what the CI is running.

I think it is a waste of CI cycles just pushing the code and find out that there is some warning to be fixed

There are no custom githooks at the moment, so that would be a whole other discussion on what would/wouldn't belong there. I'd recommend opening a separate issue.

dunxen avatar Aug 28 '24 13:08 dunxen