vdev/commands/check/fmt.rs
1use anyhow::Result;
2
3use crate::app;
4
5/// Check that all files are formatted properly
6#[derive(clap::Args, Debug)]
7#[command()]
8pub struct Cli {}
9
10impl Cli {
11 pub fn exec(self) -> Result<()> {
12 info!("Checking style (trailing spaces, line endings)...");
13 app::exec("scripts/check-style.sh", ["--all"], true)?;
14
15 info!("Checking Rust formatting...");
16 app::exec("cargo", ["fmt", "--", "--check"], true)
17 }
18}