-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Provide an easy way for contributors to run cargo fmt like it's executed on CI #3835
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
Comments
If we want to provide a |
I'm working on adding a clippy dev subcommand to do this. I'm don't think the command should install/update toolchains/components by default (especially if we want to run it from a test) but I'll provide an option to do that and error out if the required toolchains/components aren't installed and up to date. |
friendly ping @mikerite: did you make some progress on this? |
Thanks for the ping. I didn't get very far and I haven't looked at this in weeks. It's fine by me if someone else wants to do this. Otherwise, I'll try to make some progress this weekend. |
I've got something ready but I'll wait until the build is fixed before submitting the PR. |
Closing this - thanks to @mikerite we now have |
As pointed out by @flip1995 in #3824 (comment), we currently don't have an easy way to run
rustfmt
on the tests locally like we do on CI.What we are doing on CI currently:
rust-clippy/.travis.yml
Line 24 in 8dfabdf
rust-clippy/ci/base-tests.sh
Line 26 in 8dfabdf
rust-clippy/ci/base-tests.sh
Lines 53 to 78 in 8dfabdf
It would be nice if we could extract that into a separate script so that people can use to format their tests locally, instead of waiting for CI.
Some things to consider when doing this:
rustfmt
component if it isn't present locallyrustfmt
instead ofcargo fmt
for the test formatting because ofcargo fmt
doesn't format files in sub-directories intests
rustfmt#1820master
)rustup override set nightly
, because that doesn't update the locally installed nightly rust. We should probably pin to a specific nightly instead and update the version from time to time.The text was updated successfully, but these errors were encountered: