Skip to content

Commit 5c915a8

Browse files
authored
Merge pull request #1601 from kinnison/kinnison/check-format
Ensure formatting during CI checks
2 parents d57fbde + 3104d19 commit 5c915a8

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ matrix:
132132

133133
install:
134134
- if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi
135+
- rustup component add rustfmt
135136

136137
script:
137138
- mkdir -p target/$TARGET;

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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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

7175
build: 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

8085
notifications:
8186
- 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)