containers / youki

A container runtime written in Rust
https://containers.github.io/youki/
Apache License 2.0
5.99k stars 332 forks source link

Add `rustfmt.toml` to standardize formatting #2787

Closed jprendes closed 1 month ago

jprendes commented 1 month ago

This PR adds a rustfmt.toml which configures rustfmt. In particular, it specifies formatting for imports grouping:

group_imports = "StdExternalCrate" # create three groups for std, external and local crates
imports_granularity = "Module" # Merge imports from the same module

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.

YJDoc2 commented 1 month ago

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 :+1:

Thanks!

jprendes commented 1 month ago

The ignore file seems to be working:

Bypassing the ignore file is done appending a ~ to the SHA/branch in the URL.

utam0k commented 1 month ago

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!

I didn't know that. Good idea.