Skip to content

Commit 3104d19

Browse files
committed
Ensure formatting during CI checks
In order to ensure that we don't get odd formatting changes mixed in with future PRs, verify the formatting during the CI run if all tests pass. Signed-off-by: Daniel Silverstone <[email protected]>
1 parent a73fbfb commit 3104d19

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,10 @@ affecting any existing installation. Remember to keep those two environment vari
728728
set when running your compiled `rustup-init` or the toolchains it installs, but _unset_
729729
when 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+
731735
Unless you explicitly state otherwise, any contribution intentionally
732736
submitted for inclusion in the work by you, as defined in the
733737
Apache-2.0 license, shall be dual licensed as above, without any

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ install:
7070
- where gcc rustc cargo
7171
- rustc -vV
7272
- cargo -vV
73+
- rustfmt -vV
7374

7475
build: false
7576

@@ -79,6 +80,7 @@ test_script:
7980
- cargo test --release --target %TARGET% %FEATURES%
8081
- if defined BUILD_MSI pushd src\rustup-win-installer && cargo build --release --target %TARGET% & popd
8182
- if defined BUILD_MSI pushd src\rustup-win-installer\msi && powershell .\build.ps1 -Target %TARGET% & popd
83+
- cargo fmt --all -- --check
8284

8385
notifications:
8486
- provider: Webhook

ci/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ echo "toolchain versions\n------------------"
66

77
rustc -vV
88
cargo -vV
9+
rustfmt -vV
910

1011
cargo 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
1617
fi
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

0 commit comments

Comments
 (0)