File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,8 @@ fn run_host_tests(test_opt: &TestOpt) -> Result<()> {
231
231
232
232
/// Formats the project: nix, rust, and yml.
233
233
fn run_fmt_project ( fmt_opt : & FmtOpt ) -> Result < ( ) > {
234
+ let mut any_errors = false ;
235
+
234
236
// fmt rust
235
237
{
236
238
eprintln ! ( "Formatting: rust" ) ;
@@ -255,6 +257,7 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
255
257
} else {
256
258
eprintln ! ( "❌ rust formatter failed: {e:#?}" ) ;
257
259
}
260
+ any_errors = true ;
258
261
}
259
262
}
260
263
}
@@ -279,6 +282,7 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
279
282
} else {
280
283
eprintln ! ( "❌ yml formatter failed: {e:#?}" ) ;
281
284
}
285
+ any_errors = true ;
282
286
}
283
287
}
284
288
} else {
@@ -305,12 +309,17 @@ fn run_fmt_project(fmt_opt: &FmtOpt) -> Result<()> {
305
309
} else {
306
310
eprintln ! ( "❌ nix formatter failed: {e:#?}" ) ;
307
311
}
312
+ any_errors = true ;
308
313
}
309
314
}
310
315
} else {
311
316
eprintln ! ( "Formatting: nix - SKIPPED" ) ;
312
317
}
313
318
319
+ if any_errors {
320
+ bail ! ( "one or more formatting errors" ) ;
321
+ }
322
+
314
323
Ok ( ( ) )
315
324
}
316
325
You can’t perform that action at this time.
0 commit comments