Uh oh!
There was an error while loading. Please reload this page.
Run rustfmt on channelmanager - #3767
Conversation
👋 Thanks for assigning @valentinewallace as a reviewer! |
ldk-reviews-bot
commented
May 7, 2025
🔔 1st Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 10, 2025
🔔 2nd Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 12, 2025
🔔 3rd Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 14, 2025
🔔 4th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 17, 2025
🔔 5th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 19, 2025
🔔 6th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 21, 2025
🔔 7th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 24, 2025
🔔 8th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
May 26, 2025
🔔 9th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
joostjager
commented
May 27, 2025
Pushed a new take on channelmanager formatting. Used an automated script to insert the skip directives before every function. |
f033d19 to
d7b433eCompareCodecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #3767 +/- ##
==========================================
- Coverage 89.90% 89.90% -0.01%
==========================================
Files 160 160 Lines 129222 129257 +35 Branches 129222 129257 +35 ==========================================
+ Hits 116182 116207 +25 - Misses 10348 10357 +9 - Partials 2692 2693 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ldk-reviews-bot
commented
May 28, 2025
🔔 10th Reminder Hey @TheBlueMatt@valentinewallace! This PR has been waiting for your review. |
valentinewallace
left a comment
There was a problem hiding this comment.
Concept ACK, I like this as an incremental approach, and any new methods that get added will be rustfmt'd from the start. Browsing through channelmanager.rs, it doesn't really seem too invasive to me.
Curious your thoughts moving forward after this --
Do you plan to create a follow-up removing (many of?) the skips? Or should we have a policy where going forward if a method is touched in a PR then it should be formatted?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
fd5301e to
ae7d478Comparejoostjager
commented
May 28, 2025
Rebased after merge of #3802. Smooth workflow now in channelmanager.rs. Just remove a skip attribute and save (format on save) to go to standard formatting. |
It's indeed just the structs and enums that are changing. But those weren't easy to format-fix anyway.
Good question. If it were up to me, I'd just format the whole repository without any skips, and use the rebase script for outstanding PRs. But as there is no unanimous support for that, I am trying to at least make it better than what it was. I think going forward from this PR, it's up to contributors to remove skip directives as they see fit. Probably based on functions touched. If that's done in a separate initial commit, and the same is done for conflicting prs that touch the same functions, I think a rebase shouldn't be problematic. Alternatively a manual pass through this file can be made to remove some of the skips and wrap that in a separate PR. That's probably best done by someone who knows the parts of channelmgr that are in flight. |
jkczyz
commented
May 28, 2025
Concept ACK. I like this approach. A follow-up PR can probably remove a lot of skips where rustfmt makes trivial changes or those where there's no obvious refactoring. Then -- when touching a function in a PR -- anyone inclined could refactor it and drop the skip on a separate commit. |
08ccc6f to
edf9c57Comparejoostjager
commented
May 30, 2025
As discussed in sync meet, I've updated the script to drop the skip directives for functions that only need their signature to change. Added fixup commit. |
ldk-reviews-bot
commented
May 31, 2025
🔔 11th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
ldk-reviews-bot
commented
Jun 2, 2025
🔔 12th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
valentinewallace
commented
Jun 2, 2025
Fixup LGTM |
384ca93 to
83f41ddComparejoostjager
commented
Jun 3, 2025
Rebased. Would be nice to move towards a conclusion on this approach. |
ldk-reviews-bot
commented
Jun 4, 2025
🔔 13th Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
tnull
left a comment
There was a problem hiding this comment.
Seems this needs yet another rebase unfortunately.
joostjager
commented
Jun 4, 2025
Rebased |
Uh oh!
There was an error while loading. Please reload this page.
This allows devs to enable rustfmt on a per-function level.
3c9a1b5 to
28116beComparevalentinewallace
commented
Jun 4, 2025
I heard from @joostjager that @TheBlueMatt is okay with landing this. Seems legit! Landing! |
After reviewing a few rustfmt PRs and observing that personal preferences regarding formatting vary, I tried to do this one in a minimal way.
I went through the diff looking for blow up that really stood out, but there wasn't much that looked outside acceptable bounds to me. If anything, most of what rustfmt does is a positive change the way I see it. Reducing line density helps with readability, for me.
There were two match arms for UpdateAddHTLC that maybe received a bit too much love, even though I think even those can go through as is. Added
#[rustfmt::skip]nonetheless to at least avoid what I think would be the worst pain for some.Outstanding PRs can be rebased painlessly using a variant of the script described in #3749 (comment).
Update 5/27/2025: Added skips to every method.