-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ledger-tool: Run rustfmt with format_strings = true #34284
Conversation
In the other PR, Tyera mentioned that strings like this could get mangled:
Namely, this would get turned into
whereas we most likely want
due to the lack of a whitespace before the trailing |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34284 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 819 819
Lines 219969 219969
=========================================
- Hits 180326 180297 -29
- Misses 39643 39672 +29 |
Long string literals can cause rustfmt to fail, which results in rustfmt failing to format entire functions. There are several instances of this in ledger-tool, so format these files with wrapped strings so that formatting will apply to functions again. Note that this PR was created by adding format_strings = true to rustfmt.toml; however, this change does NOT persist that rule as the rule would format the entire repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested a couple default
reformats to match what I did in solana-cli, but I don't feel strongly about them here. Feel free to merge as-is if you prefer.
No, these are good ones that I missed on my pass through (think my eyes were starting to bleed from doing |
This PR spun out from #34274 per some conversation to consider running the
rustfmt
on a subset to see if it makes things more manageable.Problem
Long string literals can cause rustfmt to fail, which results in rustfmt failing to format entire functions. There are several instances of this in ledger-tool, so format these files with wrapped strings so that formatting will apply to functions again.
Summary of Changes
Note that this PR was created by adding format_strings = true to rustfmt.toml; however, this change does NOT persist that rule as the rule would format the entire repo.
While reviewing the diff, I do see some lines that were wrapped that could be candidates for inlining the values in format strings:
solana/ledger-tool/src/bigtable.rs
Line 464 in 4832b4e
However, there are similar instances in lines that are not wrapped, so I'm inclined to defer that