-
Notifications
You must be signed in to change notification settings - Fork 402
Rustfmt Maximalism #3749
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
base: main
Are you sure you want to change the base?
Rustfmt Maximalism #3749
Conversation
👋 Thanks for assigning @jkczyz as a reviewer! |
7be120f
to
ad093d8
Compare
ad093d8
to
3d52da9
Compare
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.
Confirmed I get the same output by running cargo fmt
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.
ACK if you review any follow-ups to fix things up after this :)
'a, | ||
'b, | ||
'c, | ||
'd, | ||
'e, | ||
'f, | ||
'logger, | ||
'h, | ||
'i, | ||
'j, | ||
'graph, | ||
'k, | ||
'mr, | ||
SD, | ||
M, | ||
T, | ||
F, | ||
C, | ||
L, |
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.
sheesh
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.
we're so back
flags & FundedStateFlags::ALL | ||
== FundedStateFlags::LOCAL_SHUTDOWN_SENT |
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.
This fits on one line. Is there something about our config that would cause it to split it over two lines?
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.
The reason is that rustfmt wants to put the ==
on the same line, pushing the total == FundedStateFlags::LOCAL_SHUTDOWN_SENT | FundedStateFlags::REMOTE_SHUTDOWN_SENT
to column 101. So expected behavior afaik.
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.
Ah, it's bitwise not logical OR.
🔔 1st Reminder Hey @TheBlueMatt @jkczyz @wpaulino! This PR has been waiting for your review. |
2 similar comments
🔔 1st Reminder Hey @TheBlueMatt @jkczyz @wpaulino! This PR has been waiting for your review. |
🔔 1st Reminder Hey @TheBlueMatt @jkczyz @wpaulino! This PR has been waiting for your review. |
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.
ACK, matches local cargo fmt
for file in $(comm -23 "$TMP_FILE" rustfmt_excluded_files); do | ||
echo "Checking formatting of $file" | ||
rustfmt $VERS --edition 2021 --check "$file" | ||
done |
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.
CONTRIBUTING.md
needs update to remove reference to contrib/run-rustfmt.sh
Just enable it globally. We can take care of format refactors later or as we update the code, and this way we immediately eliminate the ongoing formatting micro-penalties.
To auto-format in-flight PRs without manual conflict resolution:
git filter-branch --tree-filter 'cargo fmt' -f main..HEAD
After rewriting the branch, rebase onto a fully formatted main branch. For any conflicts, just choose 'theirs' (
git rebase -X theirs main
)