Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/tools/ci/src/commands/format.rs
6598 views
1
use crate::{args::Args, Prepare, PreparedCommand};
2
use argh::FromArgs;
3
use xshell::cmd;
4
5
/// Check code formatting.
6
#[derive(FromArgs, Default)]
7
#[argh(subcommand, name = "format")]
8
pub struct FormatCommand {}
9
10
impl Prepare for FormatCommand {
11
fn prepare<'a>(&self, sh: &'a xshell::Shell, _args: Args) -> Vec<PreparedCommand<'a>> {
12
vec![PreparedCommand::new::<Self>(
13
cmd!(sh, "cargo fmt --all -- --check"),
14
"Please run 'cargo fmt --all' to format your code.",
15
)]
16
}
17
}
18
19