vdev/commands/check/markdown.rs
1use anyhow::Result;
2
3use crate::{app, utils::git::git_ls_files};
4
5/// Check that markdown is styled properly
6#[derive(clap::Args, Debug)]
7#[command()]
8pub struct Cli {}
9
10impl Cli {
11 pub fn exec(self) -> Result<()> {
12 let files = git_ls_files(Some("*.md"))?;
13 if files.is_empty() {
14 return Ok(());
15 }
16
17 let args: Vec<&str> = files.iter().map(String::as_str).collect();
18
19 app::exec("markdownlint-cli2", &args, true)
20 }
21}