Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces the following
rustfmt
formatting configurations:imports_granularity = "Crate"
:imports_layout = "HorizontalVertical"
:I have applied both formatting transformations in separate commits if you want to inspect their respective outcomes.
IMO it should not be a big deal to use
nightly
rustfmt
toolchain instead ofstable
in our GitHub Actions CI.I am aware that it is kinda biased to not apply standard
stable
Rust formatting and that introducing unstable formatting specifiers might be unpopular, however, both formatting specifiers have been "stable" for quite some time and are probably going to be stabilized as designed in the future.Have imports merge automatically using
imports_granuality
instead of manually takes a lot of manual labor from developers.The
imports_layout
formatting option makes Rust imports behave the same as everywhere else (e.g. in function arguments) which also conforms to a more unified formatting style.Note: We are already using
nightly
Rust toolchain forclippy
GitHub Actions CI.A big advantage with vertical layouts is that Git diffs are more readable and provoke fewer merge conflicts.
There are some more
nightly
rustfmt
options that we might want to explore using in the future in our CI, e.g.: