-
Notifications
You must be signed in to change notification settings - Fork 19
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
install rustfmt from nightly #696
install rustfmt from nightly #696
Conversation
|
To be honest, as much as I'd love the import grouping being readily and automatically applied, I'd rather not depend on the nightly rustfmt, as it's a moving target - we now have to worry about two toolchain versions (one being updated daily) and it'd be harder to reproduce the formatting suggested by rustfmt; I've done this a couple of times already and I'd not repeat that. Maybe a good balance would be to have a dedicated helper command that runs the nightly rustfmt with the import grouping specified as a CLI param? We wouldn't block on this in CI but we could still reap the benefits of clearer imports until the option is stabilised. Also, I'm not a fan of explicitly specifying every option - the style and defaults will probably change over the years/editions and I'd rather we explicitly specify options that we ourselves prefer or want to enforce (e.g. Lastly, I'm somewhat torn on always running Clippy when we intend to run
The |
@Xanewok thank you for taking a look!
Good point. How about using a fixed nightly version? would that help? we can choose to upgrade the specific nightly/stable versions on demand. But otherwise, everything will be stable. I updated the PR to use
I agree. This tries to reduce future noise by "fixing" the default values, in case an unstable feature changed its defaults later. But I also that is no longer a concern if we use a fixed nightly version. We can worry about that only during upgrade. I will keep this file empty for now.
I think the same, mainly because we are already running it by default in the IDE. It doesn't make sense to fix one without the other. And if running them together means faster type checking, I think it is a bigger win. |
b348088
to
d2210c3
Compare
allowing us to use any experimental features/flags in `.rustfmt.toml`. I created one for now with all the default flags. We can review/update them in future PRs as needed: ```sh rustfmt --print-config default .rustfmt.toml ``` Nightly is only used for formatting. Other cargo commands to build/check/test/run source code are still using the default stable toolchain. I additionally updated the docs for `infra` scripts, running `clippy` as part of `infra check cargo`, since running it separately duplicates some of the work, and its lints are as important as `cargo check`. It also decouples its fixes/suggestions from linters like `rustfmt`, so it can format any applied changes.
d2210c3
to
16dfaf0
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.
Looks good, thanks! Left some nitpicks, otherwise it's good to go.
Looks great, thanks for the work ❤️ |
allowing us to use any experimental features/flags in
.rustfmt.toml
. I created one for now with all the default flags. We can review/update them in future PRs as needed:Nightly is only used for formatting. Other cargo commands to build/check/test/run source code are still using the default stable toolchain.
I additionally updated the docs for
infra
scripts, runningclippy
as part ofinfra check cargo
, since running it separately duplicates some of the work, and its lints are as important ascargo check
. It also decouples its fixes/suggestions from linters likerustfmt
, so it can format any applied changes.