check formatting

This commit is contained in:
nora 2022-03-06 17:05:19 +01:00
parent 1172ce0709
commit 1ef7b906ad
6 changed files with 52 additions and 15 deletions

View file

@ -3,8 +3,9 @@ use anyhow::ensure;
use std::process::Command;
pub fn main() -> anyhow::Result<()> {
println!("$ cargo fmt");
println!("$ cargo +nightly fmt");
let status = Command::new("cargo")
.arg("+nightly")
.arg("fmt")
.current_dir(project_root())
.status()?;
@ -17,13 +18,12 @@ pub fn main() -> anyhow::Result<()> {
.status()?;
ensure!(status.success(), "`yarn fmt` did not exist successfully");
println!("$ prettier -w .");
let status = Command::new("prettier")
.arg("-w")
.arg(".")
.current_dir(project_root().join("amqp_dashboard/assets"))
println!("$ yarn fmt");
let status = Command::new("yarn")
.arg("fmt")
.current_dir(project_root().join("amqp_dashboard/frontend"))
.status()?;
ensure!(status.success(), "`prettier .` did not exist successfully");
ensure!(status.success(), "`yarn fmt` did not exist successfully");
Ok(())
}