Skip to content

Commit d7ae748

Browse files
authored
Merge pull request #1464 from rust-osdev/bishop-fix-format
Fix `cargo xtask fmt --check`
2 parents e0b3d1f + 73b2d59 commit d7ae748

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

uefi-test-runner/src/proto/console/serial.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::reconnect_serial_to_console;
2-
use uefi::boot;
32
use uefi::proto::console::serial::{ControlBits, Serial};
4-
use uefi::{Result, ResultExt, Status};
3+
use uefi::{boot, Result, ResultExt, Status};
54

65
// For the duration of this function, the serial device is opened in
76
// exclusive mode. That means logs will not work, which means we should

xtask/src/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ fn run_host_tests(test_opt: &TestOpt) -> Result<()> {
231231

232232
/// Formats the project: nix, rust, and yml.
233233
fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
234+
let mut any_errors = false;
235+
234236
// fmt rust
235237
{
236238
eprintln!("Formatting: rust");
@@ -255,6 +257,7 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
255257
} else {
256258
eprintln!("❌ rust formatter failed: {e:#?}");
257259
}
260+
any_errors = true;
258261
}
259262
}
260263
}
@@ -279,6 +282,7 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
279282
} else {
280283
eprintln!("❌ yml formatter failed: {e:#?}");
281284
}
285+
any_errors = true;
282286
}
283287
}
284288
} else {
@@ -305,12 +309,17 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
305309
} else {
306310
eprintln!("❌ nix formatter failed: {e:#?}");
307311
}
312+
any_errors = true;
308313
}
309314
}
310315
} else {
311316
eprintln!("Formatting: nix - SKIPPED");
312317
}
313318

319+
if any_errors {
320+
bail!("one or more formatting errors");
321+
}
322+
314323
Ok(())
315324
}
316325

xtask/src/qemu.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,13 @@ impl OvmfPaths {
102102
);
103103
}
104104
} else {
105-
let prebuilt = Prebuilt::fetch(Source {
106-
tag: OVMF_PREBUILT_TAG,
107-
sha256: OVMF_PREBUILT_HASH,
108-
}, OVMF_PREBUILT_DIR)?;
105+
let prebuilt = Prebuilt::fetch(
106+
Source {
107+
tag: OVMF_PREBUILT_TAG,
108+
sha256: OVMF_PREBUILT_HASH,
109+
},
110+
OVMF_PREBUILT_DIR,
111+
)?;
109112

110113
Ok(prebuilt.get_file(arch.into(), file_type))
111114
}

0 commit comments

Comments
 (0)