-
Notifications
You must be signed in to change notification settings - Fork 346
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
Add rustfmt.toml
to standardize formatting
#2787
Conversation
2f76b1c
to
45c293d
Compare
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
components: clippy | ||
- name: Install nightly rustfmt | ||
run: rustup toolchain install nightly --component rustfmt --profile minimal --no-self-update |
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.
nit: can we add the nightly directly in the setup rust step? If not can we have a comment here mentioning we use this for formatting?
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.
can we add the nightly directly in the setup rust step?
That would result in using nightly clippy
, which is not my intention here.
I'm open to suggestions :-)
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.
No, I can't think of anything better. We can keep this as is 👍
Hey can we add a rev-ignore file like this , and add the second commit to it? That way the blame would not consider the formatting changes. Corresponding git doc : https://github.com/git/git/blob/ae3f36dea16e51041c56ba9ed6b38380c8421816/Documentation/blame-options.txt#L113-L125 Not sure how well the blame would pick up the changes , but given that blender uses it for its formatting commits, it should be good-enough for us to start with this PR. Otherwise the setup commit looks, good, ci passed, so assuming that works 👍 Thanks! |
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
The ignore file seems to be working:
Bypassing the ignore file is done appending a |
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 fine with the rustfmt and ignore-rev, and assuming that as the CI is passing , formatting is ok. Maybe wait for a look from utam0k .
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 didn't know that. Good idea. |
This PR adds a
rustfmt.toml
which configures rustfmt.In particular, it specifies formatting for imports grouping:
These options are still unstable, so they need to be run with
cargo +nightly fmt ...
.For reviewing it's easier to review it by commit instead of as a whole.
rustfmt.toml
and updates thecargo.sh
script to use nightly forcargo fmt
.just format
.