You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make it idempotent, the new script should automatically detect the 'current' toolchain and switch back to it after the formatting script has finished (instead of switching to master)
Unlike a fresh VM on CI, We can't just use 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.
Using a shell script will not work cross-platform but I think doing it in Rust might be too much work?
As pointed out by @flip1995 in #3824 (comment), we currently don't have an easy way to run
rustfmton 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:
rustfmtcomponent if it isn't present locallyrustfmtinstead ofcargo fmtfor the test formatting because ofcargo fmtdoesn't format files in sub-directories intestsrustfmt#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.