style: update formatting rules - #1184
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1184 +/- ##
==========================================
- Coverage 43.34% 41.59% -1.74%
==========================================
Files 22 22
Lines 2040 1919 -121
==========================================
- Hits 884 798 -86
+ Misses 1156 1121 -35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| hard_tabs = true | ||
| tab_spaces = 4 |
There was a problem hiding this comment.
This is the main change. Everything else is automatic formatting.
|
I was thinking of creating a patch release for these formatting changes after I'm done with the current reviews. Otherwise it might be a bit annoying to rebase this on other PRs. I always forget to do this though... |
Fixing PRs should fairly simple: git checkout main -- rustfmt.toml
cargo +nightly fmt
git commit -am 'formatting
git pushIf you're squashing merges then this shouldn't really be too much of a problem |
joshka
left a comment
There was a problem hiding this comment.
To actually apply this, I'd suggest grabbing rustfmt.toml, discarding everything else and rerunning cargo +nightly fmt
git reset --hard main
git reset fdf857422158338c9ec461270b1aabd31a375049 rustfmt.toml
cargo +nightly fmt
git commit -aC fdf857422158338c9ec461270b1aabd31a375049
git push
git reset 541aa64f4e60738b0ff24895b358c3f05a4b841e .git-blame-ignore-revs
# edit the file with the correct hash|
yes pls do itt |
87616d0 to
51427a4
Compare
joshka
left a comment
There was a problem hiding this comment.
I removed the rev ignore file - do this in a followup PR
Use spaces instead of tabs for indentation, wrap at 100 characters, and remove the setting that aligns struct fields vertically as this generally harms readability. These changes make the code more consistent with the Rust community's conventions and improve readability by not truncating lines too early.
|
Rebased |
chore: update formatting rules
Use spaces instead of tabs for indentation, wrap at 100 characters, and
remove the setting that aligns struct fields vertically as this
generally harms readability.
These changes make the code more consistent with the Rust community's
conventions and improve readability by not truncating lines too early.
Justification:
https://www.youtube.com/watch\?v\=V7PLxL8jIl8
This brings things more in line with pretty much every rust project out there. Hard tabs are used in around 0.1% of rust projects:
hard_tabs = true: https://github.com/search?q=path%3A%22rustfmt.toml%22+%22hard_tabs+%3D+true%22+AND+%28NOT+is%3Afork%29&type=code (1.9k results)