This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 95
95
# We need a toolchain that can actually build Miri, just a nightly won't do.
96
96
run : |
97
97
cargo install rustup-toolchain-install-master # TODO: cache this?
98
- ./rustup-toolchain "" -c clippy -c rustfmt
99
- - name : rustfmt (miri, ui_test)
100
- run : cargo fmt --all --check
101
- - name : rustfmt (everything else)
102
- # TODO: Add `tests` (work in progress).
103
- # Maybe change to `find . -name '*.rs'`, superseding the previous step.
104
- run : |
105
- find bench-cargo-miri benches cargo-miri test-cargo-miri -name '*.rs' \
106
- | xargs rustfmt --edition=2021 --config-path ./rustfmt.toml --check
98
+ ./rustup-toolchain "" -c clippy
99
+ - name : rustfmt
100
+ run : ./miri fmt --check
107
101
- name : clippy (miri)
108
102
run : cargo clippy --all-targets -- -D warnings
109
103
# - name: Clippy (ui_test)
Original file line number Diff line number Diff line change @@ -21,10 +21,13 @@ to the final `cargo test` invocation.
21
21
./miri run <flags>:
22
22
Build miri, set up a sysroot and then run the driver with the given <flags>.
23
23
24
- All commands also exist in a "-debug" variant (e.g. "./miri run-debug
24
+ The commands above also exist in a "-debug" variant (e.g. "./miri run-debug
25
25
<flags>") which uses debug builds instead of release builds, for faster build
26
26
times and slower execution times.
27
27
28
+ ./miri fmt <flags>:
29
+ Format all sources and tests. <flags> are passed to `rustfmt`.
30
+
28
31
ENVIRONMENT VARIABLES
29
32
30
33
MIRI_SYSROOT:
@@ -156,6 +159,10 @@ run|run-debug)
156
159
# Then run the actual command.
157
160
exec cargo run $CARGO_BUILD_FLAGS -- --sysroot " $MIRI_SYSROOT " " $@ "
158
161
;;
162
+ fmt)
163
+ find " $MIRIDIR " -not \( -name target -prune \) -name ' *.rs' \
164
+ | xargs rustfmt --edition=2021 --config-path " $MIRIDIR /rustfmt.toml" " $@ "
165
+ ;;
159
166
* )
160
167
if [ -n " $COMMAND " ]; then
161
168
echo " Unknown command: $COMMAND "
Original file line number Diff line number Diff line change 42
42
43
43
# Install and setup new toolchain.
44
44
rustup toolchain uninstall miri
45
- rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools " $@ " -- " $NEW_COMMIT "
45
+ rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt " $@ " -- " $NEW_COMMIT "
46
46
rustup override set miri
47
47
48
48
# Cleanup.
You can’t perform that action at this time.
0 commit comments