File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ matrix:
132132
133133install :
134134 - if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
135+ - rustup component add rustfmt
135136
136137script :
137138 - mkdir -p target/$TARGET;
Original file line number Diff line number Diff line change @@ -728,6 +728,10 @@ affecting any existing installation. Remember to keep those two environment vari
728728set when running your compiled ` rustup-init ` or the toolchains it installs, but _ unset_
729729when rebuilding ` rustup ` itself.
730730
731+ We use ` rustfmt ` to keep our codebase consistently formatted. Please ensure that
732+ you have correctly formatted your code (most editors will do this automatically
733+ when saving) or it may not pass the CI tests.
734+
731735Unless you explicitly state otherwise, any contribution intentionally
732736submitted for inclusion in the work by you, as defined in the
733737Apache-2.0 license, shall be dual licensed as above, without any
Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ install:
5959 # add mingw to PATH if necessary
6060 - if defined MINGW_DIR set PATH=C:\msys64\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
6161
62+ # Add rustfmt support
63+ - rustup component add rustfmt
64+
6265 # set cargo features for MSI if requested (otherwise empty string)
6366 - set FEATURES=
6467 - if defined BUILD_MSI set FEATURES=--features msi-installed
@@ -67,6 +70,7 @@ install:
6770 - where gcc rustc cargo
6871 - rustc -vV
6972 - cargo -vV
73+ - rustfmt -vV
7074
7175build : false
7276
@@ -76,6 +80,7 @@ test_script:
7680 - cargo test --release --target %TARGET% %FEATURES%
7781 - if defined BUILD_MSI pushd src\rustup-win-installer && cargo build --release --target %TARGET% & popd
7882 - if defined BUILD_MSI pushd src\rustup-win-installer\msi && powershell .\build.ps1 -Target %TARGET% & popd
83+ - cargo fmt --all -- --check
7984
8085notifications :
8186 - provider : Webhook
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ echo "toolchain versions\n------------------"
66
77rustc -vV
88cargo -vV
9+ rustfmt -vV
910
1011cargo build --locked -v --release --target $TARGET --features vendored-openssl
1112
@@ -14,3 +15,7 @@ if [ -z "$SKIP_TESTS" ]; then
1415 cargo test --release -p rustup-dist --target $TARGET --features vendored-openssl
1516 cargo test --release --target $TARGET --features vendored-openssl
1617fi
18+
19+ # Check the formatting last because test failures are more interesting to have
20+ # discovered for contributors lacking some platform access for testing beforehand
21+ cargo fmt --all -- --check
You can’t perform that action at this time.
0 commit comments