Skip to content

Commit

Permalink
Merge pull request #1464 from rust-osdev/bishop-fix-format
Browse files Browse the repository at this point in the history
Fix `cargo xtask fmt --check`
  • Loading branch information
phip1611 authored Nov 6, 2024
2 parents e0b3d1f + 73b2d59 commit d7ae748
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
3 changes: 1 addition & 2 deletions uefi-test-runner/src/proto/console/serial.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::reconnect_serial_to_console;
use uefi::boot;
use uefi::proto::console::serial::{ControlBits, Serial};
use uefi::{Result, ResultExt, Status};
use uefi::{boot, Result, ResultExt, Status};

// For the duration of this function, the serial device is opened in
// exclusive mode. That means logs will not work, which means we should
Expand Down
9 changes: 9 additions & 0 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ fn run_host_tests(test_opt: &TestOpt) -> Result<()> {

/// Formats the project: nix, rust, and yml.
fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
let mut any_errors = false;

// fmt rust
{
eprintln!("Formatting: rust");
Expand All @@ -255,6 +257,7 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
} else {
eprintln!("❌ rust formatter failed: {e:#?}");
}
any_errors = true;
}
}
}
Expand All @@ -279,6 +282,7 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
} else {
eprintln!("❌ yml formatter failed: {e:#?}");
}
any_errors = true;
}
}
} else {
Expand All @@ -305,12 +309,17 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
} else {
eprintln!("❌ nix formatter failed: {e:#?}");
}
any_errors = true;
}
}
} else {
eprintln!("Formatting: nix - SKIPPED");
}

if any_errors {
bail!("one or more formatting errors");
}

Ok(())
}

Expand Down
11 changes: 7 additions & 4 deletions xtask/src/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ impl OvmfPaths {
);
}
} else {
let prebuilt = Prebuilt::fetch(Source {
tag: OVMF_PREBUILT_TAG,
sha256: OVMF_PREBUILT_HASH,
}, OVMF_PREBUILT_DIR)?;
let prebuilt = Prebuilt::fetch(
Source {
tag: OVMF_PREBUILT_TAG,
sha256: OVMF_PREBUILT_HASH,
},
OVMF_PREBUILT_DIR,
)?;

Ok(prebuilt.get_file(arch.into(), file_type))
}
Expand Down

0 comments on commit d7ae748

Please sign in to comment.