mdsf/tools/
markdownlint.rs

1///
2/// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY
3///
4use crate::runners::CommandType;
5
6#[inline]
7pub fn set_args(
8    mut cmd: std::process::Command,
9    file_path: &std::path::Path,
10) -> std::process::Command {
11    cmd.arg("--fix");
12    cmd.arg(file_path);
13    cmd
14}
15
16pub const COMMANDS: [CommandType; 6] = [
17    CommandType::NodeModules("markdownlint"),
18    CommandType::Direct("markdownlint"),
19    CommandType::Npm("markdownlint-cli"),
20    CommandType::Pnpm("markdownlint-cli"),
21    CommandType::Bun("markdownlint-cli"),
22    CommandType::Deno("markdownlint-cli"),
23];
24
25pub const IS_STDIN: bool = false;
26
27#[cfg(test)]
28mod test_markdownlint {
29    #[test_with::executable(markdownlint || npx || pnpm || deno || bunx)]
30    fn test_markdownlint_markdown_1f615768d8e575c5() {
31        let input = r#"# Hello world
32
33- asd 
34* vasd
35"#;
36
37        let output = r#"# Hello world
38
39- asd
40- vasd
41"#;
42
43        let file_ext = crate::fttype::get_file_extension("markdown");
44
45        let snippet =
46            crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file");
47
48        let result = crate::tools::Tooling::Markdownlint
49            .format_snippet(
50                snippet.path(),
51                crate::testing::DEFAULT_TEST_FORMATTER_TIMEOUT,
52                crate::testing::DEFAULT_TEST_DEBUG_ENABLED,
53                &crate::config::MdsfConfigRunners::all(),
54            )
55            .expect("it to be successful")
56            .1
57            .expect("it to be some");
58
59        assert_eq!(result, output);
60    }
61}