Skip to content

Commit 8aef365

Browse files
committed
Implemented fixme and added rustfmt to gitlab runner
1 parent f6b13f0 commit 8aef365

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ regress:nightly:
1212
image: rustlang/rust:nightly
1313
script:
1414
- cargo build --release
15+
- rustup component add rustfmt-preview
1516
- cd ci/svd2rust-regress
1617
- rm -rf ./output
1718
- cargo run --release -- --long-test --format --verbose

ci/svd2rust-regress/src/main.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,19 @@ fn main() {
108108
None => &default_svd2rust,
109109
};
110110

111-
let default_rustfmt: Option<PathBuf> = if let Some(v) = Command::new("rustup")
111+
let default_rustfmt: Option<PathBuf> = if let Some((v, true)) = Command::new("rustup")
112112
.args(&["which", "rustfmt"])
113113
.output()
114114
.ok()
115-
.map(|v| v.stdout)
115+
.map(|o| (o.stdout, o.status.success()))
116116
{
117117
Some(String::from_utf8_lossy(&v).into_owned().trim().into())
118118
} else {
119+
if opt.format && opt.rustfmt_bin_path.is_none() {
120+
panic!("rustfmt binary not found, is rustup and rustfmt-preview installed?");
121+
}
119122
None
120-
}; // FIXME: capture error and assure exit is 0
123+
};
121124

122125
let rustfmt_bin_path = match (&opt.rustfmt_bin_path, opt.format) {
123126
(_, false) => None,

0 commit comments

Comments
 (0)