-
Notifications
You must be signed in to change notification settings - Fork 159
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 rustfmt config file and run formatter #2807
Conversation
Since this is machine generated, let's hold off on merging this until we get all the other PRs in to avoid merge conflicts. |
3279736
to
d1cb801
Compare
CodSpeed Performance ReportMerging #2807 will improve performances by 56.03%Comparing Summary
Benchmarks breakdown
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2807 +/- ##
==========================================
- Coverage 64.09% 64.08% -0.01%
==========================================
Files 1005 1005
Lines 113072 113071 -1
==========================================
- Hits 72473 72463 -10
- Misses 40599 40608 +9
|
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.
LGTM! Glad to have enforced import styling in Rust now.
I remember Sammy talking about something along the lines of preserving the original git blame for the formatted lines? Just curious what the conclusion was for that
@kevinzwang Yup! I actually will need to preserve that. I know of the git command to do that; I just need to find some time to walk through the steps. I also need to add a couple of ignores to external crates that we've brought into version-control (since we don't want to continuously reformat them for every new fresh copy). |
205f27b
to
943a76c
Compare
Synced with @samster25 offline. He mentioned that Therefore, those arrow2 files above that were deleted are now added back. They are not deleted from version control anymore. However, the dead |
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.
looks like src/arrow2
still has a huge diff. I thought we said to ignore it
f1e3292
to
42f5528
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.
LGTM! Let's make sure this doesn't affect the git blame when we merge!
I took a brief look into the suggestions that you made. This will affect the git blame history (not sure if there's a way around that), but git exposes this feature to include a ".git-blame-ignore-revs" file which git will pick up and modify the way it displays git-blames to the end-user. The file needs to be included in tree for it to work. We could either check that file into source-control (either in this PR or in a follow-up), or have users manually touch that file (may cause a poor DX, the more that I think about it...). Any preferences? Reference: https://graphite.dev/guides/git-blame-ignore-revs. |
The other option is to run |
Overview
The only file that I added was the
rustfmt.toml
. In that file, I updated the styles on how imports should be ordered ("StdExternalCrate"). Then I ran the formatter. The formatter changed updated all of our rust files to follow this convention.This PR is obviously huge, but the only changes that are observed are after running
cargo fmt
on the original code. I have not sneaked anything else into here.You can verify this via 2 ways:
rustfmt.toml
file, runningcargo fmt
, and checking to make sure your formatted code has NO diffs against my commit. (Make sure your rust toolchain is updated to the latest release!).