From 50bd87b7f9972807fdb01d7da1868573d5a27110 Mon Sep 17 00:00:00 2001 From: Mads Hougesen Date: Mon, 27 Jan 2025 22:30:16 +0100 Subject: [PATCH 1/5] refactor(cli): abstract command execution to shared function --- codegen/src/tools.rs | 36 ++---------------------- mdsf/src/execution/mod.rs | 28 ++++++++++++++++++ mdsf/src/tools/actionlint.rs | 20 ++----------- mdsf/src/tools/alejandra.rs | 19 ++----------- mdsf/src/tools/ameba.rs | 19 ++----------- mdsf/src/tools/ansible_lint.rs | 20 ++----------- mdsf/src/tools/asmfmt.rs | 19 ++----------- mdsf/src/tools/astyle.rs | 19 ++----------- mdsf/src/tools/auto_optional.rs | 19 ++----------- mdsf/src/tools/autocorrect.rs | 19 ++----------- mdsf/src/tools/autoflake.rs | 19 ++----------- mdsf/src/tools/autopep_8.rs | 19 ++----------- mdsf/src/tools/beancount_black.rs | 19 ++----------- mdsf/src/tools/beautysh.rs | 19 ++----------- mdsf/src/tools/bibtex_tidy.rs | 19 ++----------- mdsf/src/tools/bicep_format.rs | 19 ++----------- mdsf/src/tools/biome_check.rs | 19 ++----------- mdsf/src/tools/biome_format.rs | 19 ++----------- mdsf/src/tools/biome_lint.rs | 19 ++----------- mdsf/src/tools/black.rs | 19 ++----------- mdsf/src/tools/blade_formatter.rs | 19 ++----------- mdsf/src/tools/blue.rs | 19 ++----------- mdsf/src/tools/bpfmt.rs | 19 ++----------- mdsf/src/tools/brittany.rs | 19 ++----------- mdsf/src/tools/brunette.rs | 19 ++----------- mdsf/src/tools/bsfmt.rs | 19 ++----------- mdsf/src/tools/bslint.rs | 19 ++----------- mdsf/src/tools/buf_format.rs | 19 ++----------- mdsf/src/tools/buildifier.rs | 19 ++----------- mdsf/src/tools/cabal_fmt.rs | 19 ++----------- mdsf/src/tools/cabal_format.rs | 19 ++----------- mdsf/src/tools/cabal_prettify.rs | 19 ++----------- mdsf/src/tools/caddy_fmt.rs | 19 ++----------- mdsf/src/tools/caramel_fmt.rs | 19 ++----------- mdsf/src/tools/clang_format.rs | 19 ++----------- mdsf/src/tools/clang_tidy.rs | 19 ++----------- mdsf/src/tools/cljfmt_fix.rs | 19 ++----------- mdsf/src/tools/cljstyle.rs | 19 ++----------- mdsf/src/tools/cmake_format.rs | 19 ++----------- mdsf/src/tools/codespell.rs | 19 ++----------- mdsf/src/tools/crlfmt.rs | 19 ++----------- mdsf/src/tools/crystal_format.rs | 19 ++----------- mdsf/src/tools/csharpier.rs | 19 ++----------- mdsf/src/tools/css_beautify.rs | 19 ++----------- mdsf/src/tools/csscomb.rs | 19 ++----------- mdsf/src/tools/csslint.rs | 20 ++----------- mdsf/src/tools/curlylint.rs | 20 ++----------- mdsf/src/tools/d_2_fmt.rs | 19 ++----------- mdsf/src/tools/dart_fix.rs | 19 ++----------- mdsf/src/tools/dart_format.rs | 19 ++----------- mdsf/src/tools/dcm_fix.rs | 19 ++----------- mdsf/src/tools/dcm_format.rs | 19 ++----------- mdsf/src/tools/deadnix.rs | 19 ++----------- mdsf/src/tools/deno_fmt.rs | 19 ++----------- mdsf/src/tools/deno_lint.rs | 19 ++----------- mdsf/src/tools/dfmt.rs | 19 ++----------- mdsf/src/tools/dhall.rs | 19 ++----------- mdsf/src/tools/djade.rs | 19 ++----------- mdsf/src/tools/djlint.rs | 19 ++----------- mdsf/src/tools/docformatter.rs | 19 ++----------- mdsf/src/tools/dockfmt.rs | 19 ++----------- mdsf/src/tools/docstrfmt.rs | 19 ++----------- mdsf/src/tools/doctoc.rs | 19 ++----------- mdsf/src/tools/dotenv_linter_fix.rs | 19 ++----------- mdsf/src/tools/dprint_fmt.rs | 19 ++----------- mdsf/src/tools/easy_coding_standard.rs | 19 ++----------- mdsf/src/tools/efmt.rs | 19 ++----------- mdsf/src/tools/elm_format.rs | 19 ++----------- mdsf/src/tools/erb_formatter.rs | 19 ++----------- mdsf/src/tools/erlfmt.rs | 19 ++----------- mdsf/src/tools/eslint.rs | 19 ++----------- mdsf/src/tools/fantomas.rs | 19 ++----------- mdsf/src/tools/fish_indent.rs | 19 ++----------- mdsf/src/tools/fixjson.rs | 19 ++----------- mdsf/src/tools/floskell.rs | 19 ++----------- mdsf/src/tools/fnlfmt.rs | 19 ++----------- mdsf/src/tools/forge_fmt.rs | 19 ++----------- mdsf/src/tools/fourmolu.rs | 19 ++----------- mdsf/src/tools/fprettify.rs | 19 ++----------- mdsf/src/tools/futhark_fmt.rs | 19 ++----------- mdsf/src/tools/gci.rs | 19 ++----------- mdsf/src/tools/gdformat.rs | 19 ++----------- mdsf/src/tools/gersemi.rs | 19 ++----------- mdsf/src/tools/gleam_format.rs | 19 ++----------- mdsf/src/tools/gluon_fmt.rs | 19 ++----------- mdsf/src/tools/gofmt.rs | 19 ++----------- mdsf/src/tools/gofumpt.rs | 19 ++----------- mdsf/src/tools/goimports.rs | 19 ++----------- mdsf/src/tools/goimports_reviser.rs | 19 ++----------- mdsf/src/tools/golines.rs | 19 ++----------- mdsf/src/tools/google_java_format.rs | 19 ++----------- mdsf/src/tools/grain_format.rs | 19 ++----------- mdsf/src/tools/hadolint.rs | 20 ++----------- mdsf/src/tools/haml_lint.rs | 19 ++----------- mdsf/src/tools/hclfmt.rs | 19 ++----------- mdsf/src/tools/hfmt.rs | 19 ++----------- mdsf/src/tools/hindent.rs | 19 ++----------- mdsf/src/tools/hlint.rs | 19 ++----------- mdsf/src/tools/html_beautify.rs | 19 ++----------- mdsf/src/tools/htmlbeautifier.rs | 19 ++----------- mdsf/src/tools/htmlhint.rs | 20 ++----------- mdsf/src/tools/imba_fmt.rs | 19 ++----------- mdsf/src/tools/inko_fmt.rs | 19 ++----------- mdsf/src/tools/isort.rs | 19 ++----------- mdsf/src/tools/joker.rs | 19 ++----------- mdsf/src/tools/js_beautify.rs | 19 ++----------- mdsf/src/tools/json_5_format.rs | 19 ++----------- mdsf/src/tools/jsona_format.rs | 19 ++----------- mdsf/src/tools/jsona_lint.rs | 19 ++----------- mdsf/src/tools/jsonlint.rs | 19 ++----------- mdsf/src/tools/jsonnet_lint.rs | 20 ++----------- mdsf/src/tools/jsonnetfmt.rs | 19 ++----------- mdsf/src/tools/juliaformatter_jl.rs | 19 ++----------- mdsf/src/tools/just.rs | 19 ++----------- mdsf/src/tools/kcl_fmt.rs | 19 ++----------- mdsf/src/tools/kcl_lint.rs | 19 ++----------- mdsf/src/tools/kdlfmt.rs | 19 ++----------- mdsf/src/tools/kdoc_formatter.rs | 19 ++----------- mdsf/src/tools/ktfmt.rs | 19 ++----------- mdsf/src/tools/ktlint.rs | 19 ++----------- mdsf/src/tools/kulala_fmt.rs | 19 ++----------- mdsf/src/tools/leptosfmt.rs | 19 ++----------- mdsf/src/tools/liquidsoap_prettier.rs | 19 ++----------- mdsf/src/tools/luacheck.rs | 19 ++----------- mdsf/src/tools/luaformatter.rs | 19 ++----------- mdsf/src/tools/mado_check.rs | 20 ++----------- mdsf/src/tools/markdownfmt.rs | 19 ++----------- mdsf/src/tools/markdownlint.rs | 19 ++----------- mdsf/src/tools/markdownlint_cli_2.rs | 19 ++----------- mdsf/src/tools/markuplint.rs | 19 ++----------- mdsf/src/tools/mdformat.rs | 19 ++----------- mdsf/src/tools/mdslw.rs | 19 ++----------- mdsf/src/tools/meson_fmt.rs | 19 ++----------- mdsf/src/tools/misspell.rs | 19 ++----------- mdsf/src/tools/mix_format.rs | 19 ++----------- mdsf/src/tools/mojo_format.rs | 19 ++----------- mdsf/src/tools/mypy.rs | 20 ++----------- mdsf/src/tools/nginxbeautifier.rs | 19 ++----------- mdsf/src/tools/nginxfmt.rs | 19 ++----------- mdsf/src/tools/nickel_format.rs | 19 ++----------- mdsf/src/tools/nimpretty.rs | 19 ++----------- mdsf/src/tools/nixfmt.rs | 19 ++----------- mdsf/src/tools/nixpkgs_fmt.rs | 19 ++----------- mdsf/src/tools/nomad_fmt.rs | 19 ++----------- mdsf/src/tools/nph.rs | 19 ++----------- mdsf/src/tools/npm_groovy_lint.rs | 19 ++----------- mdsf/src/tools/nufmt.rs | 19 ++----------- mdsf/src/tools/ocamlformat.rs | 19 ++----------- mdsf/src/tools/ocp_indent.rs | 19 ++----------- mdsf/src/tools/odinfmt.rs | 19 ++----------- mdsf/src/tools/oelint_adv.rs | 19 ++----------- mdsf/src/tools/opa_fmt.rs | 19 ++----------- mdsf/src/tools/ormolu.rs | 19 ++----------- mdsf/src/tools/oxlint.rs | 19 ++----------- mdsf/src/tools/packer_fix.rs | 19 ++----------- mdsf/src/tools/packer_fmt.rs | 19 ++----------- mdsf/src/tools/perltidy.rs | 19 ++----------- mdsf/src/tools/pg_format.rs | 19 ++----------- mdsf/src/tools/php_cs_fixer_fix.rs | 19 ++----------- mdsf/src/tools/phpcbf.rs | 19 ++----------- mdsf/src/tools/phpinsights_fix.rs | 19 ++----------- mdsf/src/tools/pint.rs | 19 ++----------- mdsf/src/tools/prettier.rs | 19 ++----------- mdsf/src/tools/pretty_php.rs | 19 ++----------- mdsf/src/tools/prettypst.rs | 19 ++----------- mdsf/src/tools/prisma_format.rs | 19 ++----------- mdsf/src/tools/protolint.rs | 19 ++----------- mdsf/src/tools/ptop.rs | 19 ++----------- mdsf/src/tools/puppet_lint.rs | 19 ++----------- mdsf/src/tools/purs_tidy.rs | 19 ++----------- mdsf/src/tools/purty.rs | 19 ++----------- mdsf/src/tools/pycln.rs | 19 ++----------- mdsf/src/tools/pycodestyle.rs | 19 ++----------- mdsf/src/tools/pyink.rs | 19 ++----------- mdsf/src/tools/pyment.rs | 19 ++----------- mdsf/src/tools/qmlfmt.rs | 19 ++----------- mdsf/src/tools/quick_lint_js.rs | 20 ++----------- mdsf/src/tools/raco_fmt.rs | 19 ++----------- mdsf/src/tools/refmt.rs | 19 ++----------- mdsf/src/tools/reformat_gherkin.rs | 19 ++----------- mdsf/src/tools/regal_fix.rs | 19 ++----------- mdsf/src/tools/regal_lint.rs | 20 ++----------- mdsf/src/tools/reorder_python_imports.rs | 24 +++++----------- mdsf/src/tools/rescript_format.rs | 19 ++----------- mdsf/src/tools/roc_format.rs | 19 ++----------- mdsf/src/tools/rstfmt.rs | 19 ++----------- mdsf/src/tools/rubocop.rs | 19 ++----------- mdsf/src/tools/rubyfmt.rs | 19 ++----------- mdsf/src/tools/ruff_check.rs | 19 ++----------- mdsf/src/tools/ruff_format.rs | 19 ++----------- mdsf/src/tools/rufo.rs | 19 ++----------- mdsf/src/tools/rune_fmt.rs | 19 ++----------- mdsf/src/tools/rustfmt.rs | 19 ++----------- mdsf/src/tools/rustywind.rs | 19 ++----------- mdsf/src/tools/salt_lint.rs | 20 ++----------- mdsf/src/tools/scalafmt.rs | 19 ++----------- mdsf/src/tools/scalariform.rs | 19 ++----------- mdsf/src/tools/selene.rs | 20 ++----------- mdsf/src/tools/shellcheck.rs | 20 ++----------- mdsf/src/tools/shellharden.rs | 19 ++----------- mdsf/src/tools/shfmt.rs | 19 ++----------- mdsf/src/tools/sleek.rs | 19 ++----------- mdsf/src/tools/smlfmt.rs | 19 ++----------- mdsf/src/tools/snakefmt.rs | 19 ++----------- mdsf/src/tools/solhint.rs | 19 ++----------- mdsf/src/tools/sql_formatter.rs | 19 ++----------- mdsf/src/tools/sqlfluff_fix.rs | 19 ++----------- mdsf/src/tools/sqlfluff_format.rs | 19 ++----------- mdsf/src/tools/sqlfmt.rs | 19 ++----------- mdsf/src/tools/sqruff.rs | 19 ++----------- mdsf/src/tools/standardjs.rs | 19 ++----------- mdsf/src/tools/standardrb.rs | 19 ++----------- mdsf/src/tools/statix_check.rs | 20 ++----------- mdsf/src/tools/statix_fix.rs | 19 ++----------- mdsf/src/tools/stylefmt.rs | 19 ++----------- mdsf/src/tools/stylelint.rs | 19 ++----------- mdsf/src/tools/stylish_haskell.rs | 19 ++----------- mdsf/src/tools/stylua.rs | 19 ++----------- mdsf/src/tools/superhtml_fmt.rs | 19 ++----------- mdsf/src/tools/swift_format.rs | 19 ++----------- mdsf/src/tools/swiftformat.rs | 19 ++----------- mdsf/src/tools/taplo.rs | 19 ++----------- mdsf/src/tools/templ_fmt.rs | 19 ++----------- mdsf/src/tools/terraform_fmt.rs | 19 ++----------- mdsf/src/tools/terragrunt_hclfmt.rs | 19 ++----------- mdsf/src/tools/tex_fmt.rs | 19 ++----------- mdsf/src/tools/tlint_format.rs | 19 ++----------- mdsf/src/tools/tofu_fmt.rs | 19 ++----------- mdsf/src/tools/toml_sort.rs | 19 ++----------- mdsf/src/tools/topiary.rs | 19 ++----------- mdsf/src/tools/ts_standard.rs | 19 ++----------- mdsf/src/tools/tsqllint.rs | 19 ++----------- mdsf/src/tools/twig_cs_fixer_lint.rs | 19 ++----------- mdsf/src/tools/typos.rs | 19 ++----------- mdsf/src/tools/typstfmt.rs | 19 ++----------- mdsf/src/tools/typstyle.rs | 19 ++----------- mdsf/src/tools/ufmt.rs | 19 ++----------- mdsf/src/tools/uiua_fmt.rs | 19 ++----------- mdsf/src/tools/unimport.rs | 19 ++----------- mdsf/src/tools/usort.rs | 19 ++----------- mdsf/src/tools/v_fmt.rs | 19 ++----------- mdsf/src/tools/vacuum_lint.rs | 19 ++----------- mdsf/src/tools/veryl_fmt.rs | 19 ++----------- mdsf/src/tools/vhdl_style_guide.rs | 19 ++----------- mdsf/src/tools/wa_fmt.rs | 19 ++----------- mdsf/src/tools/wfindent.rs | 19 ++----------- mdsf/src/tools/xmlformat.rs | 19 ++----------- mdsf/src/tools/xmllint.rs | 19 ++----------- mdsf/src/tools/xo.rs | 19 ++----------- mdsf/src/tools/yamlfix.rs | 19 ++----------- mdsf/src/tools/yamlfmt.rs | 19 ++----------- mdsf/src/tools/yapf.rs | 19 ++----------- mdsf/src/tools/yew_fmt.rs | 19 ++----------- mdsf/src/tools/zig_fmt.rs | 19 ++----------- mdsf/src/tools/ziggy_fmt.rs | 19 ++----------- mdsf/src/tools/zprint.rs | 19 ++----------- tools/tool.schema.json | 6 +--- 257 files changed, 544 insertions(+), 4372 deletions(-) diff --git a/codegen/src/tools.rs b/codegen/src/tools.rs index 893afef8..ac8d67c1 100644 --- a/codegen/src/tools.rs +++ b/codegen/src/tools.rs @@ -29,9 +29,6 @@ pub struct ToolCommand { #[expect(unused)] pub homepage: Option, - /// Whether to ignore the output of the command execution - pub ignore_output: bool, - pub tests: Option>, } @@ -196,8 +193,6 @@ impl Tool { fn generate(&self) -> Vec { let mut all_commands = Vec::new(); - let map_execution_result_whitespace = format!("\n{INDENT}{INDENT}{INDENT}"); - for (cmd, options) in &self.commands { let command_name = self.get_command_name(cmd); @@ -279,23 +274,11 @@ impl Tool { format!("\n{}\n", tests.join("\n\n")) }; - let map_execution_result = if options.ignore_output { - ".map(|value| (value.0, None))" - } else { - "" - }; - - let execution_result_whitespace = if map_execution_result.is_empty() { - " " - } else { - map_execution_result_whitespace.as_str() - }; - let code = format!( "{GENERATED_FILE_COMMENT} use std::process::Command; -use crate::{{error::MdsfError, execution::execute_command, runners::CommandType}}; +use crate::{{error::MdsfError, runners::CommandType}}; #[inline] fn {set_args_fn_name}(mut cmd: Command, file_path: &std::path::Path) -> Command {{ @@ -307,22 +290,7 @@ fn {set_args_fn_name}(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn {run_fn_name}(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> {{ {INDENT}let commands = [{command_arr}]; -{INDENT}for (index, cmd) in commands.iter().enumerate() {{ -{INDENT}{INDENT}let cmd = {set_args_fn_name}(cmd.build(), file_path); -{INDENT}{INDENT}let execution_result ={execution_result_whitespace}execute_command(cmd, file_path, timeout){map_execution_result}; - -{INDENT}{INDENT}if index == commands.len() - 1 {{ -{INDENT}{INDENT}{INDENT}return execution_result; -{INDENT}{INDENT}}} - -{INDENT}{INDENT}if let Ok(r) = execution_result {{ -{INDENT}{INDENT}{INDENT}if !r.0 {{ -{INDENT}{INDENT}{INDENT}{INDENT}return Ok(r); -{INDENT}{INDENT}{INDENT}}} -{INDENT}{INDENT}}} -{INDENT}}} - -{INDENT}Ok((true, None)) +{INDENT}crate::execution::run_tools(&commands, file_path, timeout, {set_args_fn_name}) }} #[cfg(test)] diff --git a/mdsf/src/execution/mod.rs b/mdsf/src/execution/mod.rs index 68ae0420..9479913f 100644 --- a/mdsf/src/execution/mod.rs +++ b/mdsf/src/execution/mod.rs @@ -8,6 +8,7 @@ use crate::{ config::MdsfConfig, error::MdsfError, fttype::get_file_extension, + runners::CommandType, terminal::{ print_binary_not_in_path, print_error_formatting, print_formatter_info, print_formatter_time, @@ -286,3 +287,30 @@ impl MdsfFormatter { } } } + +#[inline] +pub fn run_tools( + commands: &[CommandType], + file_path: &std::path::Path, + timeout: u64, + set_args_fn: fn(std::process::Command, &std::path::Path) -> std::process::Command, +) -> Result<(bool, Option), MdsfError> { + for (index, cmd) in commands.iter().enumerate() { + let cmd = set_args_fn(cmd.build(), file_path); + + let execution_result = + execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); + + if index == commands.len() - 1 { + return execution_result; + } + + if let Ok(r) = execution_result { + if !r.0 { + return Ok(r); + } + } + } + + Ok((true, None)) +} diff --git a/mdsf/src/tools/actionlint.rs b/mdsf/src/tools/actionlint.rs index 8011df6d..7bc73916 100644 --- a/mdsf/src/tools/actionlint.rs +++ b/mdsf/src/tools/actionlint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_actionlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,23 +15,7 @@ fn set_actionlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("actionlint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_actionlint_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_actionlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/alejandra.rs b/mdsf/src/tools/alejandra.rs index 8fa6e28d..1b3f8b3b 100644 --- a/mdsf/src/tools/alejandra.rs +++ b/mdsf/src/tools/alejandra.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_alejandra_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_alejandra_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("alejandra")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_alejandra_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_alejandra_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ameba.rs b/mdsf/src/tools/ameba.rs index 0351e4e3..af180173 100644 --- a/mdsf/src/tools/ameba.rs +++ b/mdsf/src/tools/ameba.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ameba_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_ameba_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ameba")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ameba_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ameba_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ansible_lint.rs b/mdsf/src/tools/ansible_lint.rs index 3ef55f2f..925b8299 100644 --- a/mdsf/src/tools/ansible_lint.rs +++ b/mdsf/src/tools/ansible_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ansible_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,23 +15,7 @@ fn set_ansible_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ansible-lint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ansible_lint_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ansible_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/asmfmt.rs b/mdsf/src/tools/asmfmt.rs index b6c0917b..edc36fca 100644 --- a/mdsf/src/tools/asmfmt.rs +++ b/mdsf/src/tools/asmfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_asmfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_asmfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("asmfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_asmfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_asmfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/astyle.rs b/mdsf/src/tools/astyle.rs index f076120b..6d107c5f 100644 --- a/mdsf/src/tools/astyle.rs +++ b/mdsf/src/tools/astyle.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_astyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_astyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("astyle")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_astyle_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_astyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/auto_optional.rs b/mdsf/src/tools/auto_optional.rs index a3524cff..ed9372bf 100644 --- a/mdsf/src/tools/auto_optional.rs +++ b/mdsf/src/tools/auto_optional.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_auto_optional_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_auto_optional_args(mut cmd: Command, file_path: &std::path::Path) -> Comm pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("auto-optional")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_auto_optional_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_auto_optional_args) } #[cfg(test)] diff --git a/mdsf/src/tools/autocorrect.rs b/mdsf/src/tools/autocorrect.rs index 45dc4b1d..ae2cf106 100644 --- a/mdsf/src/tools/autocorrect.rs +++ b/mdsf/src/tools/autocorrect.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_autocorrect_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_autocorrect_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("autocorrect")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_autocorrect_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_autocorrect_args) } #[cfg(test)] diff --git a/mdsf/src/tools/autoflake.rs b/mdsf/src/tools/autoflake.rs index 5ceceaa0..a14cb8ab 100644 --- a/mdsf/src/tools/autoflake.rs +++ b/mdsf/src/tools/autoflake.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_autoflake_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_autoflake_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("autoflake")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_autoflake_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_autoflake_args) } #[cfg(test)] diff --git a/mdsf/src/tools/autopep_8.rs b/mdsf/src/tools/autopep_8.rs index ba8da3c7..684c6930 100644 --- a/mdsf/src/tools/autopep_8.rs +++ b/mdsf/src/tools/autopep_8.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_autopep_8_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_autopep_8_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("autopep8")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_autopep_8_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_autopep_8_args) } #[cfg(test)] diff --git a/mdsf/src/tools/beancount_black.rs b/mdsf/src/tools/beancount_black.rs index 78e48028..4bb3c691 100644 --- a/mdsf/src/tools/beancount_black.rs +++ b/mdsf/src/tools/beancount_black.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_beancount_black_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_beancount_black_args(mut cmd: Command, file_path: &std::path::Path) -> Co pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("bean-black")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_beancount_black_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_beancount_black_args) } #[cfg(test)] diff --git a/mdsf/src/tools/beautysh.rs b/mdsf/src/tools/beautysh.rs index e6de84b0..55212607 100644 --- a/mdsf/src/tools/beautysh.rs +++ b/mdsf/src/tools/beautysh.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_beautysh_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_beautysh_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("beautysh")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_beautysh_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_beautysh_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bibtex_tidy.rs b/mdsf/src/tools/bibtex_tidy.rs index 8fc50db9..20345efb 100644 --- a/mdsf/src/tools/bibtex_tidy.rs +++ b/mdsf/src/tools/bibtex_tidy.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_bibtex_tidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_bicep_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("bicep")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_bicep_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_bicep_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/biome_check.rs b/mdsf/src/tools/biome_check.rs index 780179c4..7ce50ca4 100644 --- a/mdsf/src/tools/biome_check.rs +++ b/mdsf/src/tools/biome_check.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_biome_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_black_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("black")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_black_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_black_args) } #[cfg(test)] diff --git a/mdsf/src/tools/blade_formatter.rs b/mdsf/src/tools/blade_formatter.rs index 46b51113..186746c3 100644 --- a/mdsf/src/tools/blade_formatter.rs +++ b/mdsf/src/tools/blade_formatter.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_blade_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_blue_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("blue")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_blue_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_blue_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bpfmt.rs b/mdsf/src/tools/bpfmt.rs index 1deb095c..11bc5d51 100644 --- a/mdsf/src/tools/bpfmt.rs +++ b/mdsf/src/tools/bpfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_bpfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_bpfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("bpfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_bpfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_bpfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/brittany.rs b/mdsf/src/tools/brittany.rs index 00a10912..e22f9abe 100644 --- a/mdsf/src/tools/brittany.rs +++ b/mdsf/src/tools/brittany.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_brittany_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_brittany_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("brittany")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_brittany_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_brittany_args) } #[cfg(test)] diff --git a/mdsf/src/tools/brunette.rs b/mdsf/src/tools/brunette.rs index bd863b31..e6051e51 100644 --- a/mdsf/src/tools/brunette.rs +++ b/mdsf/src/tools/brunette.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_brunette_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_brunette_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("brunette")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_brunette_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_brunette_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bsfmt.rs b/mdsf/src/tools/bsfmt.rs index 640cdb91..2620a11f 100644 --- a/mdsf/src/tools/bsfmt.rs +++ b/mdsf/src/tools/bsfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_bsfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_buildifier_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("buildifier")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_buildifier_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_buildifier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cabal_fmt.rs b/mdsf/src/tools/cabal_fmt.rs index 62245e9d..fe74e1dd 100644 --- a/mdsf/src/tools/cabal_fmt.rs +++ b/mdsf/src/tools/cabal_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_cabal_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_cabal_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("cabal-fmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_cabal_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_cabal_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cabal_format.rs b/mdsf/src/tools/cabal_format.rs index 76b7cf65..6f180761 100644 --- a/mdsf/src/tools/cabal_format.rs +++ b/mdsf/src/tools/cabal_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_cabal_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_cabal_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("cabal")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_cabal_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_cabal_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cabal_prettify.rs b/mdsf/src/tools/cabal_prettify.rs index a60a79cb..e820d71b 100644 --- a/mdsf/src/tools/cabal_prettify.rs +++ b/mdsf/src/tools/cabal_prettify.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_cabal_prettify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_cabal_prettify_args(mut cmd: Command, file_path: &std::path::Path) -> Com pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("cabal-prettify")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_cabal_prettify_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_cabal_prettify_args) } #[cfg(test)] diff --git a/mdsf/src/tools/caddy_fmt.rs b/mdsf/src/tools/caddy_fmt.rs index 3ffaddf4..1bae9d16 100644 --- a/mdsf/src/tools/caddy_fmt.rs +++ b/mdsf/src/tools/caddy_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_caddy_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_caddy_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("caddy")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_caddy_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_caddy_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/caramel_fmt.rs b/mdsf/src/tools/caramel_fmt.rs index b66069db..3b27c3cc 100644 --- a/mdsf/src/tools/caramel_fmt.rs +++ b/mdsf/src/tools/caramel_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_caramel_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_caramel_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("caramel")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_caramel_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_caramel_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/clang_format.rs b/mdsf/src/tools/clang_format.rs index 702dd7c7..9976d08d 100644 --- a/mdsf/src/tools/clang_format.rs +++ b/mdsf/src/tools/clang_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_clang_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_clang_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("clang-format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_clang_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_clang_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/clang_tidy.rs b/mdsf/src/tools/clang_tidy.rs index e9a1e4bd..1af07ab3 100644 --- a/mdsf/src/tools/clang_tidy.rs +++ b/mdsf/src/tools/clang_tidy.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_clang_tidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_clang_tidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("clang-tidy")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_clang_tidy_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_clang_tidy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cljfmt_fix.rs b/mdsf/src/tools/cljfmt_fix.rs index b7722eaf..8ca4f366 100644 --- a/mdsf/src/tools/cljfmt_fix.rs +++ b/mdsf/src/tools/cljfmt_fix.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_cljfmt_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_cljfmt_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("cljfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_cljfmt_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_cljfmt_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cljstyle.rs b/mdsf/src/tools/cljstyle.rs index 1d82ff83..4db90c64 100644 --- a/mdsf/src/tools/cljstyle.rs +++ b/mdsf/src/tools/cljstyle.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_cljstyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_cljstyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("cljstyle")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_cljstyle_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_cljstyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cmake_format.rs b/mdsf/src/tools/cmake_format.rs index 182325e1..a2da2ff8 100644 --- a/mdsf/src/tools/cmake_format.rs +++ b/mdsf/src/tools/cmake_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_cmake_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_cmake_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("cmake-format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_cmake_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_cmake_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/codespell.rs b/mdsf/src/tools/codespell.rs index 6aa2eee3..4d5567a3 100644 --- a/mdsf/src/tools/codespell.rs +++ b/mdsf/src/tools/codespell.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_codespell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_codespell_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("codespell")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_codespell_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_codespell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/crlfmt.rs b/mdsf/src/tools/crlfmt.rs index ec1272a1..38cc96fd 100644 --- a/mdsf/src/tools/crlfmt.rs +++ b/mdsf/src/tools/crlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_crlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_crlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("crlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_crlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_crlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/crystal_format.rs b/mdsf/src/tools/crystal_format.rs index 357b9f8b..6ce497a7 100644 --- a/mdsf/src/tools/crystal_format.rs +++ b/mdsf/src/tools/crystal_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_crystal_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_crystal_format_args(mut cmd: Command, file_path: &std::path::Path) -> Com pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("crystal")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_crystal_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_crystal_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/csharpier.rs b/mdsf/src/tools/csharpier.rs index 7fbc82be..c40452fa 100644 --- a/mdsf/src/tools/csharpier.rs +++ b/mdsf/src/tools/csharpier.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_csharpier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_csharpier_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dotnet")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_csharpier_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_csharpier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/css_beautify.rs b/mdsf/src/tools/css_beautify.rs index 0bfcc708..ba663954 100644 --- a/mdsf/src/tools/css_beautify.rs +++ b/mdsf/src/tools/css_beautify.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_css_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -23,22 +23,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,23 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,23 +16,7 @@ fn set_curlylint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("curlylint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_curlylint_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_curlylint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/d_2_fmt.rs b/mdsf/src/tools/d_2_fmt.rs index d97fb7ec..2b0aede1 100644 --- a/mdsf/src/tools/d_2_fmt.rs +++ b/mdsf/src/tools/d_2_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_d_2_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_d_2_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("d2")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_d_2_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_d_2_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dart_fix.rs b/mdsf/src/tools/dart_fix.rs index fa8c8c34..5c94a7c6 100644 --- a/mdsf/src/tools/dart_fix.rs +++ b/mdsf/src/tools/dart_fix.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dart_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_dart_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dart")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dart_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dart_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dart_format.rs b/mdsf/src/tools/dart_format.rs index 3d748cdc..702fe393 100644 --- a/mdsf/src/tools/dart_format.rs +++ b/mdsf/src/tools/dart_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dart_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_dart_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dart")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dart_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dart_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dcm_fix.rs b/mdsf/src/tools/dcm_fix.rs index e4114471..61d3460b 100644 --- a/mdsf/src/tools/dcm_fix.rs +++ b/mdsf/src/tools/dcm_fix.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dcm_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_dcm_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dcm")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dcm_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dcm_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dcm_format.rs b/mdsf/src/tools/dcm_format.rs index 3def83fb..3b4f8619 100644 --- a/mdsf/src/tools/dcm_format.rs +++ b/mdsf/src/tools/dcm_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dcm_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_dcm_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dcm")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dcm_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dcm_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/deadnix.rs b/mdsf/src/tools/deadnix.rs index 3974030a..34826ec5 100644 --- a/mdsf/src/tools/deadnix.rs +++ b/mdsf/src/tools/deadnix.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_deadnix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_deadnix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("deadnix")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_deadnix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_deadnix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/deno_fmt.rs b/mdsf/src/tools/deno_fmt.rs index dbb8a2b4..5ea043e3 100644 --- a/mdsf/src/tools/deno_fmt.rs +++ b/mdsf/src/tools/deno_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_deno_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_deno_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("deno")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_deno_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_deno_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/deno_lint.rs b/mdsf/src/tools/deno_lint.rs index a73757da..b4f2fdd3 100644 --- a/mdsf/src/tools/deno_lint.rs +++ b/mdsf/src/tools/deno_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_deno_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_deno_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("deno")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_deno_lint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_deno_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dfmt.rs b/mdsf/src/tools/dfmt.rs index ebec442f..5aa03c05 100644 --- a/mdsf/src/tools/dfmt.rs +++ b/mdsf/src/tools/dfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_dfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dhall.rs b/mdsf/src/tools/dhall.rs index e6e16d0e..d4eb5e40 100644 --- a/mdsf/src/tools/dhall.rs +++ b/mdsf/src/tools/dhall.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dhall_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_dhall_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dhall")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dhall_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dhall_args) } #[cfg(test)] diff --git a/mdsf/src/tools/djade.rs b/mdsf/src/tools/djade.rs index f9d804ed..40a73111 100644 --- a/mdsf/src/tools/djade.rs +++ b/mdsf/src/tools/djade.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_djade_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_djade_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("djade")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_djade_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_djade_args) } #[cfg(test)] diff --git a/mdsf/src/tools/djlint.rs b/mdsf/src/tools/djlint.rs index d5b57dd6..98729fbd 100644 --- a/mdsf/src/tools/djlint.rs +++ b/mdsf/src/tools/djlint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_djlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_djlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("djlint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_djlint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_djlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/docformatter.rs b/mdsf/src/tools/docformatter.rs index 0e950b5b..8477dfc3 100644 --- a/mdsf/src/tools/docformatter.rs +++ b/mdsf/src/tools/docformatter.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_docformatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_docformatter_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("docformatter")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_docformatter_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_docformatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dockfmt.rs b/mdsf/src/tools/dockfmt.rs index a0eed1a4..76375760 100644 --- a/mdsf/src/tools/dockfmt.rs +++ b/mdsf/src/tools/dockfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dockfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_dockfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dockfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dockfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dockfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/docstrfmt.rs b/mdsf/src/tools/docstrfmt.rs index fd67e865..5c832ac6 100644 --- a/mdsf/src/tools/docstrfmt.rs +++ b/mdsf/src/tools/docstrfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_docstrfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_docstrfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("docstrfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_docstrfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_docstrfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/doctoc.rs b/mdsf/src/tools/doctoc.rs index 6168ebb8..a2200c3f 100644 --- a/mdsf/src/tools/doctoc.rs +++ b/mdsf/src/tools/doctoc.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_doctoc_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,22 +19,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_dotenv_linter_fix_args(mut cmd: Command, file_path: &std::path::Path) -> pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("dotenv-linter")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_dotenv_linter_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_dotenv_linter_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dprint_fmt.rs b/mdsf/src/tools/dprint_fmt.rs index 0bd7a250..dad34e1c 100644 --- a/mdsf/src/tools/dprint_fmt.rs +++ b/mdsf/src/tools/dprint_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_dprint_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -18,22 +18,7 @@ fn set_easy_coding_standard_args(mut cmd: Command, file_path: &std::path::Path) pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::PhpVendor("ecs"), CommandType::Direct("ecs")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_easy_coding_standard_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_easy_coding_standard_args) } #[cfg(test)] diff --git a/mdsf/src/tools/efmt.rs b/mdsf/src/tools/efmt.rs index f0732ecd..10849f64 100644 --- a/mdsf/src/tools/efmt.rs +++ b/mdsf/src/tools/efmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_efmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_efmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("efmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_efmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_efmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/elm_format.rs b/mdsf/src/tools/elm_format.rs index cf3cb349..4532940c 100644 --- a/mdsf/src/tools/elm_format.rs +++ b/mdsf/src/tools/elm_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_elm_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_erb_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Comm pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("erb-format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_erb_formatter_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_erb_formatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/erlfmt.rs b/mdsf/src/tools/erlfmt.rs index 1b323341..60862dac 100644 --- a/mdsf/src/tools/erlfmt.rs +++ b/mdsf/src/tools/erlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_erlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_erlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("erlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_erlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_erlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/eslint.rs b/mdsf/src/tools/eslint.rs index 2309e429..82772487 100644 --- a/mdsf/src/tools/eslint.rs +++ b/mdsf/src/tools/eslint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_eslint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_fantomas_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("fantomas")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_fantomas_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_fantomas_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fish_indent.rs b/mdsf/src/tools/fish_indent.rs index 2bbf1548..6039d250 100644 --- a/mdsf/src/tools/fish_indent.rs +++ b/mdsf/src/tools/fish_indent.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_fish_indent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_fish_indent_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("fish_indent")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_fish_indent_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_fish_indent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fixjson.rs b/mdsf/src/tools/fixjson.rs index 6f734269..144bbe93 100644 --- a/mdsf/src/tools/fixjson.rs +++ b/mdsf/src/tools/fixjson.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_fixjson_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_floskell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("floskell")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_floskell_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_floskell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fnlfmt.rs b/mdsf/src/tools/fnlfmt.rs index 66618ba5..3fff1c3a 100644 --- a/mdsf/src/tools/fnlfmt.rs +++ b/mdsf/src/tools/fnlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_fnlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_fnlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("fnlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_fnlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_fnlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/forge_fmt.rs b/mdsf/src/tools/forge_fmt.rs index 8601fd4c..acea1f18 100644 --- a/mdsf/src/tools/forge_fmt.rs +++ b/mdsf/src/tools/forge_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_forge_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_forge_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("forge")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_forge_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_forge_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fourmolu.rs b/mdsf/src/tools/fourmolu.rs index 20127e79..e4d2b5b8 100644 --- a/mdsf/src/tools/fourmolu.rs +++ b/mdsf/src/tools/fourmolu.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_fourmolu_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_fourmolu_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("fourmolu")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_fourmolu_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_fourmolu_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fprettify.rs b/mdsf/src/tools/fprettify.rs index 07710e1b..d5bcf76d 100644 --- a/mdsf/src/tools/fprettify.rs +++ b/mdsf/src/tools/fprettify.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_fprettify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_fprettify_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("fprettify")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_fprettify_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_fprettify_args) } #[cfg(test)] diff --git a/mdsf/src/tools/futhark_fmt.rs b/mdsf/src/tools/futhark_fmt.rs index 93b2fcaa..411725dc 100644 --- a/mdsf/src/tools/futhark_fmt.rs +++ b/mdsf/src/tools/futhark_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_futhark_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_futhark_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("futhark")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_futhark_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_futhark_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gci.rs b/mdsf/src/tools/gci.rs index 2965b0c5..0fbcafd5 100644 --- a/mdsf/src/tools/gci.rs +++ b/mdsf/src/tools/gci.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_gci_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_gci_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("gci")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_gci_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_gci_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gdformat.rs b/mdsf/src/tools/gdformat.rs index 1b7ac10e..1d89ddb3 100644 --- a/mdsf/src/tools/gdformat.rs +++ b/mdsf/src/tools/gdformat.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_gdformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_gdformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("gdformat")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_gdformat_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_gdformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gersemi.rs b/mdsf/src/tools/gersemi.rs index d7736d52..7e24e232 100644 --- a/mdsf/src/tools/gersemi.rs +++ b/mdsf/src/tools/gersemi.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_gersemi_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_gersemi_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("gersemi")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_gersemi_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_gersemi_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gleam_format.rs b/mdsf/src/tools/gleam_format.rs index 0cd097ee..5d41b440 100644 --- a/mdsf/src/tools/gleam_format.rs +++ b/mdsf/src/tools/gleam_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_gleam_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_gleam_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("gleam")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_gleam_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_gleam_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gluon_fmt.rs b/mdsf/src/tools/gluon_fmt.rs index efde978d..5f351baf 100644 --- a/mdsf/src/tools/gluon_fmt.rs +++ b/mdsf/src/tools/gluon_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_gluon_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_gluon_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("gluon")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_gluon_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_gluon_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gofmt.rs b/mdsf/src/tools/gofmt.rs index 8b0ba42a..885a13e8 100644 --- a/mdsf/src/tools/gofmt.rs +++ b/mdsf/src/tools/gofmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_gofmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_gofmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("gofmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_gofmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_gofmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gofumpt.rs b/mdsf/src/tools/gofumpt.rs index 57c57c59..1a03b9b8 100644 --- a/mdsf/src/tools/gofumpt.rs +++ b/mdsf/src/tools/gofumpt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_gofumpt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_gofumpt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("gofumpt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_gofumpt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_gofumpt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/goimports.rs b/mdsf/src/tools/goimports.rs index d135c1d6..18d13baf 100644 --- a/mdsf/src/tools/goimports.rs +++ b/mdsf/src/tools/goimports.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_goimports_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_goimports_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("goimports")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_goimports_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_goimports_args) } #[cfg(test)] diff --git a/mdsf/src/tools/goimports_reviser.rs b/mdsf/src/tools/goimports_reviser.rs index dcb5ad4c..c03857fd 100644 --- a/mdsf/src/tools/goimports_reviser.rs +++ b/mdsf/src/tools/goimports_reviser.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_goimports_reviser_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_goimports_reviser_args(mut cmd: Command, file_path: &std::path::Path) -> pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("goimports-reviser")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_goimports_reviser_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_goimports_reviser_args) } #[cfg(test)] diff --git a/mdsf/src/tools/golines.rs b/mdsf/src/tools/golines.rs index 5b5a2246..41ed276e 100644 --- a/mdsf/src/tools/golines.rs +++ b/mdsf/src/tools/golines.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_golines_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_golines_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("golines")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_golines_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_golines_args) } #[cfg(test)] diff --git a/mdsf/src/tools/google_java_format.rs b/mdsf/src/tools/google_java_format.rs index 35acbc9f..1d6d481d 100644 --- a/mdsf/src/tools/google_java_format.rs +++ b/mdsf/src/tools/google_java_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_google_java_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_google_java_format_args(mut cmd: Command, file_path: &std::path::Path) -> pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("google-java-format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_google_java_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_google_java_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/grain_format.rs b/mdsf/src/tools/grain_format.rs index c66ece7f..98c01ef6 100644 --- a/mdsf/src/tools/grain_format.rs +++ b/mdsf/src/tools/grain_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_grain_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_grain_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("grain")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_grain_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_grain_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hadolint.rs b/mdsf/src/tools/hadolint.rs index 96737643..41fa934f 100644 --- a/mdsf/src/tools/hadolint.rs +++ b/mdsf/src/tools/hadolint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_hadolint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,23 +15,7 @@ fn set_hadolint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("hadolint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_hadolint_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_hadolint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/haml_lint.rs b/mdsf/src/tools/haml_lint.rs index 3e5825a9..b3ffef61 100644 --- a/mdsf/src/tools/haml_lint.rs +++ b/mdsf/src/tools/haml_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_haml_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_haml_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("haml-lint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_haml_lint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_haml_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hclfmt.rs b/mdsf/src/tools/hclfmt.rs index b30f847d..8eeb5fb0 100644 --- a/mdsf/src/tools/hclfmt.rs +++ b/mdsf/src/tools/hclfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_hclfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_hclfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("hclfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_hclfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_hclfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hfmt.rs b/mdsf/src/tools/hfmt.rs index 96b0fbd0..be56258f 100644 --- a/mdsf/src/tools/hfmt.rs +++ b/mdsf/src/tools/hfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_hfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_hfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("hfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_hfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_hfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hindent.rs b/mdsf/src/tools/hindent.rs index b170c00f..74c27937 100644 --- a/mdsf/src/tools/hindent.rs +++ b/mdsf/src/tools/hindent.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_hindent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_hindent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("hindent")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_hindent_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_hindent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hlint.rs b/mdsf/src/tools/hlint.rs index 2ca874ab..1848cbbe 100644 --- a/mdsf/src/tools/hlint.rs +++ b/mdsf/src/tools/hlint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_hlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_hlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("hlint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_hlint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_hlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/html_beautify.rs b/mdsf/src/tools/html_beautify.rs index 5a45bd09..3ccbedae 100644 --- a/mdsf/src/tools/html_beautify.rs +++ b/mdsf/src/tools/html_beautify.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_html_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -23,22 +23,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_htmlbeautifier_args(mut cmd: Command, file_path: &std::path::Path) -> Com pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("htmlbeautifier")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_htmlbeautifier_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_htmlbeautifier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/htmlhint.rs b/mdsf/src/tools/htmlhint.rs index c7f87036..75e24dc9 100644 --- a/mdsf/src/tools/htmlhint.rs +++ b/mdsf/src/tools/htmlhint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_htmlhint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,23 +19,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_inko_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("inko")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_inko_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_inko_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/isort.rs b/mdsf/src/tools/isort.rs index 7f61352a..cd307e27 100644 --- a/mdsf/src/tools/isort.rs +++ b/mdsf/src/tools/isort.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_isort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_isort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("isort")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_isort_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_isort_args) } #[cfg(test)] diff --git a/mdsf/src/tools/joker.rs b/mdsf/src/tools/joker.rs index f9034062..b530105d 100644 --- a/mdsf/src/tools/joker.rs +++ b/mdsf/src/tools/joker.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_joker_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_joker_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("joker")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_joker_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_joker_args) } #[cfg(test)] diff --git a/mdsf/src/tools/js_beautify.rs b/mdsf/src/tools/js_beautify.rs index c70712c6..63c84fa8 100644 --- a/mdsf/src/tools/js_beautify.rs +++ b/mdsf/src/tools/js_beautify.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_js_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -23,22 +23,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_json_5_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comm pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("json5format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_json_5_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_json_5_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsona_format.rs b/mdsf/src/tools/jsona_format.rs index 2df1857e..b8a3df37 100644 --- a/mdsf/src/tools/jsona_format.rs +++ b/mdsf/src/tools/jsona_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_jsona_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_jsona_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("jsona")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_jsona_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_jsona_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsona_lint.rs b/mdsf/src/tools/jsona_lint.rs index f06b32a5..7e2cffe7 100644 --- a/mdsf/src/tools/jsona_lint.rs +++ b/mdsf/src/tools/jsona_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_jsona_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_jsona_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("jsona")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_jsona_lint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_jsona_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsonlint.rs b/mdsf/src/tools/jsonlint.rs index 328cd5d2..a5e39d82 100644 --- a/mdsf/src/tools/jsonlint.rs +++ b/mdsf/src/tools/jsonlint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_jsonlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,23 +15,7 @@ fn set_jsonnet_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("jsonnet-lint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_jsonnet_lint_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_jsonnet_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsonnetfmt.rs b/mdsf/src/tools/jsonnetfmt.rs index 2cea6fda..2e5ce4ce 100644 --- a/mdsf/src/tools/jsonnetfmt.rs +++ b/mdsf/src/tools/jsonnetfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_jsonnetfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_jsonnetfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("jsonnetfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_jsonnetfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_jsonnetfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/juliaformatter_jl.rs b/mdsf/src/tools/juliaformatter_jl.rs index 3d237408..a3e28f2e 100644 --- a/mdsf/src/tools/juliaformatter_jl.rs +++ b/mdsf/src/tools/juliaformatter_jl.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_juliaformatter_jl_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_juliaformatter_jl_args(mut cmd: Command, file_path: &std::path::Path) -> pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("julia")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_juliaformatter_jl_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_juliaformatter_jl_args) } #[cfg(test)] diff --git a/mdsf/src/tools/just.rs b/mdsf/src/tools/just.rs index 809d867f..8671f979 100644 --- a/mdsf/src/tools/just.rs +++ b/mdsf/src/tools/just.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_just_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -22,22 +22,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_kcl_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("kcl")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_kcl_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_kcl_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kcl_lint.rs b/mdsf/src/tools/kcl_lint.rs index 44b19b62..b7e6ac12 100644 --- a/mdsf/src/tools/kcl_lint.rs +++ b/mdsf/src/tools/kcl_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_kcl_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_kcl_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("kcl")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_kcl_lint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_kcl_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kdlfmt.rs b/mdsf/src/tools/kdlfmt.rs index ef2dc0ef..69c97382 100644 --- a/mdsf/src/tools/kdlfmt.rs +++ b/mdsf/src/tools/kdlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_kdlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_kdlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("kdlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_kdlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_kdlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kdoc_formatter.rs b/mdsf/src/tools/kdoc_formatter.rs index a045bcd7..3953e527 100644 --- a/mdsf/src/tools/kdoc_formatter.rs +++ b/mdsf/src/tools/kdoc_formatter.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_kdoc_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_kdoc_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Com pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("kdoc-formatter")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_kdoc_formatter_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_kdoc_formatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ktfmt.rs b/mdsf/src/tools/ktfmt.rs index 107c529a..d9ad8322 100644 --- a/mdsf/src/tools/ktfmt.rs +++ b/mdsf/src/tools/ktfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ktfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_ktfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ktfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ktfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ktfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ktlint.rs b/mdsf/src/tools/ktlint.rs index 71cb23fa..f46a5af9 100644 --- a/mdsf/src/tools/ktlint.rs +++ b/mdsf/src/tools/ktlint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ktlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_ktlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ktlint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ktlint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ktlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kulala_fmt.rs b/mdsf/src/tools/kulala_fmt.rs index 39cff0a5..34b9d182 100644 --- a/mdsf/src/tools/kulala_fmt.rs +++ b/mdsf/src/tools/kulala_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_kulala_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_kulala_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("kulala-fmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_kulala_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_kulala_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/leptosfmt.rs b/mdsf/src/tools/leptosfmt.rs index 7482765a..12246d18 100644 --- a/mdsf/src/tools/leptosfmt.rs +++ b/mdsf/src/tools/leptosfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_leptosfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_leptosfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("leptosfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_leptosfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_leptosfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/liquidsoap_prettier.rs b/mdsf/src/tools/liquidsoap_prettier.rs index 7df5d2da..a514bd2b 100644 --- a/mdsf/src/tools/liquidsoap_prettier.rs +++ b/mdsf/src/tools/liquidsoap_prettier.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_liquidsoap_prettier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_luacheck_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("luacheck")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_luacheck_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_luacheck_args) } #[cfg(test)] diff --git a/mdsf/src/tools/luaformatter.rs b/mdsf/src/tools/luaformatter.rs index ddb044db..36f6944d 100644 --- a/mdsf/src/tools/luaformatter.rs +++ b/mdsf/src/tools/luaformatter.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_luaformatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_luaformatter_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("lua-format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_luaformatter_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_luaformatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mado_check.rs b/mdsf/src/tools/mado_check.rs index 02f20226..16c17967 100644 --- a/mdsf/src/tools/mado_check.rs +++ b/mdsf/src/tools/mado_check.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_mado_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,23 +16,7 @@ fn set_mado_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("mado")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_mado_check_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_mado_check_args) } #[cfg(test)] diff --git a/mdsf/src/tools/markdownfmt.rs b/mdsf/src/tools/markdownfmt.rs index a299afcc..210c1324 100644 --- a/mdsf/src/tools/markdownfmt.rs +++ b/mdsf/src/tools/markdownfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_markdownfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_markdownfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("markdownfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_markdownfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_markdownfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/markdownlint.rs b/mdsf/src/tools/markdownlint.rs index 2da7ded5..20b17c22 100644 --- a/mdsf/src/tools/markdownlint.rs +++ b/mdsf/src/tools/markdownlint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_markdownlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_mdformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("mdformat")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_mdformat_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_mdformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mdslw.rs b/mdsf/src/tools/mdslw.rs index d0bfe833..7c77085c 100644 --- a/mdsf/src/tools/mdslw.rs +++ b/mdsf/src/tools/mdslw.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_mdslw_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_mdslw_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("mdslw")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_mdslw_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_mdslw_args) } #[cfg(test)] diff --git a/mdsf/src/tools/meson_fmt.rs b/mdsf/src/tools/meson_fmt.rs index f4cc2a41..bdb8f30e 100644 --- a/mdsf/src/tools/meson_fmt.rs +++ b/mdsf/src/tools/meson_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_meson_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_meson_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("meson")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_meson_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_meson_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/misspell.rs b/mdsf/src/tools/misspell.rs index 77c39525..e6aae3cf 100644 --- a/mdsf/src/tools/misspell.rs +++ b/mdsf/src/tools/misspell.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_misspell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_misspell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("misspell")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_misspell_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_misspell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mix_format.rs b/mdsf/src/tools/mix_format.rs index 98e37079..450b2b5f 100644 --- a/mdsf/src/tools/mix_format.rs +++ b/mdsf/src/tools/mix_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_mix_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_mix_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("mix")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_mix_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_mix_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mojo_format.rs b/mdsf/src/tools/mojo_format.rs index 9d8df7f0..1e1de033 100644 --- a/mdsf/src/tools/mojo_format.rs +++ b/mdsf/src/tools/mojo_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_mojo_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_mojo_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("mojo")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_mojo_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_mojo_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mypy.rs b/mdsf/src/tools/mypy.rs index c342a1a9..cb3ea8bd 100644 --- a/mdsf/src/tools/mypy.rs +++ b/mdsf/src/tools/mypy.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_mypy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,23 +15,7 @@ fn set_mypy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("mypy")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_mypy_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_mypy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nginxbeautifier.rs b/mdsf/src/tools/nginxbeautifier.rs index f22cdd48..549ca913 100644 --- a/mdsf/src/tools/nginxbeautifier.rs +++ b/mdsf/src/tools/nginxbeautifier.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_nginxbeautifier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,22 +19,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_nginxfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nginxfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nginxfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nginxfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nickel_format.rs b/mdsf/src/tools/nickel_format.rs index a5f8801f..1f9ed8fb 100644 --- a/mdsf/src/tools/nickel_format.rs +++ b/mdsf/src/tools/nickel_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_nickel_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_nickel_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comm pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nickel")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nickel_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nickel_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nimpretty.rs b/mdsf/src/tools/nimpretty.rs index c2173653..3fe1650f 100644 --- a/mdsf/src/tools/nimpretty.rs +++ b/mdsf/src/tools/nimpretty.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_nimpretty_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_nimpretty_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nimpretty")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nimpretty_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nimpretty_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nixfmt.rs b/mdsf/src/tools/nixfmt.rs index 3c4dfcbc..0b3b29a6 100644 --- a/mdsf/src/tools/nixfmt.rs +++ b/mdsf/src/tools/nixfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_nixfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_nixfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nixfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nixfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nixfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nixpkgs_fmt.rs b/mdsf/src/tools/nixpkgs_fmt.rs index a9196c74..59448d4d 100644 --- a/mdsf/src/tools/nixpkgs_fmt.rs +++ b/mdsf/src/tools/nixpkgs_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_nixpkgs_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_nixpkgs_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nixpkgs-fmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nixpkgs_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nixpkgs_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nomad_fmt.rs b/mdsf/src/tools/nomad_fmt.rs index bb20a6a0..da647651 100644 --- a/mdsf/src/tools/nomad_fmt.rs +++ b/mdsf/src/tools/nomad_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_nomad_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_nomad_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nomad")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nomad_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nomad_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nph.rs b/mdsf/src/tools/nph.rs index 0aaf1fc5..3949eb43 100644 --- a/mdsf/src/tools/nph.rs +++ b/mdsf/src/tools/nph.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_nph_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_nph_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nph")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nph_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nph_args) } #[cfg(test)] diff --git a/mdsf/src/tools/npm_groovy_lint.rs b/mdsf/src/tools/npm_groovy_lint.rs index 9f4e3b96..5f5eb1be 100644 --- a/mdsf/src/tools/npm_groovy_lint.rs +++ b/mdsf/src/tools/npm_groovy_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_npm_groovy_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_nufmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("nufmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_nufmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_nufmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ocamlformat.rs b/mdsf/src/tools/ocamlformat.rs index 8a021619..4433844a 100644 --- a/mdsf/src/tools/ocamlformat.rs +++ b/mdsf/src/tools/ocamlformat.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ocamlformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_ocamlformat_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ocamlformat")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ocamlformat_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ocamlformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ocp_indent.rs b/mdsf/src/tools/ocp_indent.rs index e34d0c86..84efae7d 100644 --- a/mdsf/src/tools/ocp_indent.rs +++ b/mdsf/src/tools/ocp_indent.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ocp_indent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_ocp_indent_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ocp-indent")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ocp_indent_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ocp_indent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/odinfmt.rs b/mdsf/src/tools/odinfmt.rs index 2ad57089..9e74a63b 100644 --- a/mdsf/src/tools/odinfmt.rs +++ b/mdsf/src/tools/odinfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_odinfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_odinfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("odinfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_odinfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_odinfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/oelint_adv.rs b/mdsf/src/tools/oelint_adv.rs index 7d7e8d27..0ab915fa 100644 --- a/mdsf/src/tools/oelint_adv.rs +++ b/mdsf/src/tools/oelint_adv.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_oelint_adv_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_oelint_adv_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("oelint-adv")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_oelint_adv_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_oelint_adv_args) } #[cfg(test)] diff --git a/mdsf/src/tools/opa_fmt.rs b/mdsf/src/tools/opa_fmt.rs index 812732f3..d28314ee 100644 --- a/mdsf/src/tools/opa_fmt.rs +++ b/mdsf/src/tools/opa_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_opa_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_opa_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("opa")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_opa_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_opa_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ormolu.rs b/mdsf/src/tools/ormolu.rs index 73399c4a..07be2c43 100644 --- a/mdsf/src/tools/ormolu.rs +++ b/mdsf/src/tools/ormolu.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ormolu_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_ormolu_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ormolu")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ormolu_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ormolu_args) } #[cfg(test)] diff --git a/mdsf/src/tools/oxlint.rs b/mdsf/src/tools/oxlint.rs index d76b6565..35f96345 100644 --- a/mdsf/src/tools/oxlint.rs +++ b/mdsf/src/tools/oxlint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_oxlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_packer_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("packer")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_packer_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_packer_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/packer_fmt.rs b/mdsf/src/tools/packer_fmt.rs index a928af0f..d63cbb3e 100644 --- a/mdsf/src/tools/packer_fmt.rs +++ b/mdsf/src/tools/packer_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_packer_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_packer_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("packer")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_packer_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_packer_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/perltidy.rs b/mdsf/src/tools/perltidy.rs index e8c4e787..847cec81 100644 --- a/mdsf/src/tools/perltidy.rs +++ b/mdsf/src/tools/perltidy.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_perltidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_perltidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("perltidy")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_perltidy_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_perltidy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pg_format.rs b/mdsf/src/tools/pg_format.rs index 70596e96..1c685457 100644 --- a/mdsf/src/tools/pg_format.rs +++ b/mdsf/src/tools/pg_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_pg_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_pg_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("pg_format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_pg_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_pg_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/php_cs_fixer_fix.rs b/mdsf/src/tools/php_cs_fixer_fix.rs index 1c82dd37..eca8e1ae 100644 --- a/mdsf/src/tools/php_cs_fixer_fix.rs +++ b/mdsf/src/tools/php_cs_fixer_fix.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_php_cs_fixer_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,22 +19,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -18,22 +18,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_pint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::PhpVendor("pint"), CommandType::Direct("pint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_pint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_pint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/prettier.rs b/mdsf/src/tools/prettier.rs index cf819fd3..b4c88ace 100644 --- a/mdsf/src/tools/prettier.rs +++ b/mdsf/src/tools/prettier.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_prettier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -24,22 +24,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -18,22 +18,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_prettypst_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("prettypst")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_prettypst_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_prettypst_args) } #[cfg(test)] diff --git a/mdsf/src/tools/prisma_format.rs b/mdsf/src/tools/prisma_format.rs index 0d9614a3..55eb7781 100644 --- a/mdsf/src/tools/prisma_format.rs +++ b/mdsf/src/tools/prisma_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_prisma_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -21,22 +21,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -17,22 +17,7 @@ fn set_protolint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("protolint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_protolint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_protolint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ptop.rs b/mdsf/src/tools/ptop.rs index 747945c3..70548e66 100644 --- a/mdsf/src/tools/ptop.rs +++ b/mdsf/src/tools/ptop.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ptop_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_ptop_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ptop")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ptop_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ptop_args) } #[cfg(test)] diff --git a/mdsf/src/tools/puppet_lint.rs b/mdsf/src/tools/puppet_lint.rs index befcdc53..d753d6b8 100644 --- a/mdsf/src/tools/puppet_lint.rs +++ b/mdsf/src/tools/puppet_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_puppet_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_puppet_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("puppet-lint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_puppet_lint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_puppet_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/purs_tidy.rs b/mdsf/src/tools/purs_tidy.rs index a4433d96..4f343465 100644 --- a/mdsf/src/tools/purs_tidy.rs +++ b/mdsf/src/tools/purs_tidy.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_purs_tidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -17,22 +17,7 @@ fn set_pycln_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("pycln")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_pycln_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_pycln_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pycodestyle.rs b/mdsf/src/tools/pycodestyle.rs index 493a3c46..9246491e 100644 --- a/mdsf/src/tools/pycodestyle.rs +++ b/mdsf/src/tools/pycodestyle.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_pycodestyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_pycodestyle_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("pycodestyle")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_pycodestyle_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_pycodestyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pyink.rs b/mdsf/src/tools/pyink.rs index 12ab9118..2f217bf4 100644 --- a/mdsf/src/tools/pyink.rs +++ b/mdsf/src/tools/pyink.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_pyink_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_pyink_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("pyink")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_pyink_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_pyink_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pyment.rs b/mdsf/src/tools/pyment.rs index 85377a12..0415082a 100644 --- a/mdsf/src/tools/pyment.rs +++ b/mdsf/src/tools/pyment.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_pyment_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_pyment_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("pyment")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_pyment_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_pyment_args) } #[cfg(test)] diff --git a/mdsf/src/tools/qmlfmt.rs b/mdsf/src/tools/qmlfmt.rs index 58c0398b..1a0d9b3e 100644 --- a/mdsf/src/tools/qmlfmt.rs +++ b/mdsf/src/tools/qmlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_qmlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_qmlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("qmlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_qmlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_qmlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/quick_lint_js.rs b/mdsf/src/tools/quick_lint_js.rs index bded8b2b..fea7566b 100644 --- a/mdsf/src/tools/quick_lint_js.rs +++ b/mdsf/src/tools/quick_lint_js.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_quick_lint_js_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,23 +19,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -17,22 +17,7 @@ fn set_raco_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("raco")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_raco_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_raco_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/refmt.rs b/mdsf/src/tools/refmt.rs index 634eddb0..1999b983 100644 --- a/mdsf/src/tools/refmt.rs +++ b/mdsf/src/tools/refmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_refmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_refmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("refmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_refmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_refmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/reformat_gherkin.rs b/mdsf/src/tools/reformat_gherkin.rs index 53e38095..34509fb3 100644 --- a/mdsf/src/tools/reformat_gherkin.rs +++ b/mdsf/src/tools/reformat_gherkin.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_reformat_gherkin_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_reformat_gherkin_args(mut cmd: Command, file_path: &std::path::Path) -> C pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("reformat-gherkin")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_reformat_gherkin_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_reformat_gherkin_args) } #[cfg(test)] diff --git a/mdsf/src/tools/regal_fix.rs b/mdsf/src/tools/regal_fix.rs index 76a0dd4e..60d8af69 100644 --- a/mdsf/src/tools/regal_fix.rs +++ b/mdsf/src/tools/regal_fix.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_regal_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_regal_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("regal")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_regal_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_regal_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/regal_lint.rs b/mdsf/src/tools/regal_lint.rs index d7cd73f1..39d7359f 100644 --- a/mdsf/src/tools/regal_lint.rs +++ b/mdsf/src/tools/regal_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_regal_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,23 +16,7 @@ fn set_regal_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("regal")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_regal_lint_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_regal_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/reorder_python_imports.rs b/mdsf/src/tools/reorder_python_imports.rs index 44d18909..5f46bf92 100644 --- a/mdsf/src/tools/reorder_python_imports.rs +++ b/mdsf/src/tools/reorder_python_imports.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_reorder_python_imports_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,12 @@ fn set_reorder_python_imports_args(mut cmd: Command, file_path: &std::path::Path pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("reorder-python-imports")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_reorder_python_imports_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools( + &commands, + file_path, + timeout, + set_reorder_python_imports_args, + ) } #[cfg(test)] diff --git a/mdsf/src/tools/rescript_format.rs b/mdsf/src/tools/rescript_format.rs index 1cfcdae1..d833761e 100644 --- a/mdsf/src/tools/rescript_format.rs +++ b/mdsf/src/tools/rescript_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rescript_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_roc_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("roc")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_roc_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_roc_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rstfmt.rs b/mdsf/src/tools/rstfmt.rs index 7b580ef1..ee85fca8 100644 --- a/mdsf/src/tools/rstfmt.rs +++ b/mdsf/src/tools/rstfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rstfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_rstfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("rstfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_rstfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_rstfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rubocop.rs b/mdsf/src/tools/rubocop.rs index 486315a1..742f55c4 100644 --- a/mdsf/src/tools/rubocop.rs +++ b/mdsf/src/tools/rubocop.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rubocop_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,22 +19,7 @@ fn set_rubocop_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("rubocop")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_rubocop_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_rubocop_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rubyfmt.rs b/mdsf/src/tools/rubyfmt.rs index a4808bff..a0c3175b 100644 --- a/mdsf/src/tools/rubyfmt.rs +++ b/mdsf/src/tools/rubyfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rubyfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_rubyfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("rubyfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_rubyfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_rubyfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ruff_check.rs b/mdsf/src/tools/ruff_check.rs index ac82ab5c..b646ff81 100644 --- a/mdsf/src/tools/ruff_check.rs +++ b/mdsf/src/tools/ruff_check.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ruff_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_ruff_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ruff")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ruff_check_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ruff_check_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ruff_format.rs b/mdsf/src/tools/ruff_format.rs index bc431a23..3f597495 100644 --- a/mdsf/src/tools/ruff_format.rs +++ b/mdsf/src/tools/ruff_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ruff_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_ruff_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ruff")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ruff_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ruff_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rufo.rs b/mdsf/src/tools/rufo.rs index 2e1a2c65..0332d232 100644 --- a/mdsf/src/tools/rufo.rs +++ b/mdsf/src/tools/rufo.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rufo_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_rufo_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("rufo")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_rufo_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_rufo_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rune_fmt.rs b/mdsf/src/tools/rune_fmt.rs index 61c2ab8f..8b9492c5 100644 --- a/mdsf/src/tools/rune_fmt.rs +++ b/mdsf/src/tools/rune_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rune_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_rune_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("rune")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_rune_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_rune_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rustfmt.rs b/mdsf/src/tools/rustfmt.rs index 90e0d9fc..c688fbe1 100644 --- a/mdsf/src/tools/rustfmt.rs +++ b/mdsf/src/tools/rustfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rustfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_rustfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("rustfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_rustfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_rustfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rustywind.rs b/mdsf/src/tools/rustywind.rs index 548722fd..21b89cc5 100644 --- a/mdsf/src/tools/rustywind.rs +++ b/mdsf/src/tools/rustywind.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_rustywind_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_rustywind_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("rustywind")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_rustywind_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_rustywind_args) } #[cfg(test)] diff --git a/mdsf/src/tools/salt_lint.rs b/mdsf/src/tools/salt_lint.rs index f057105c..25ce267a 100644 --- a/mdsf/src/tools/salt_lint.rs +++ b/mdsf/src/tools/salt_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_salt_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,23 +15,7 @@ fn set_salt_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("salt-lint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_salt_lint_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_salt_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/scalafmt.rs b/mdsf/src/tools/scalafmt.rs index e192fd46..a6893d35 100644 --- a/mdsf/src/tools/scalafmt.rs +++ b/mdsf/src/tools/scalafmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_scalafmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_scalafmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("scalafmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_scalafmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_scalafmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/scalariform.rs b/mdsf/src/tools/scalariform.rs index 0c130660..8cde0fc9 100644 --- a/mdsf/src/tools/scalariform.rs +++ b/mdsf/src/tools/scalariform.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_scalariform_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_scalariform_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("scalariform")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_scalariform_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_scalariform_args) } #[cfg(test)] diff --git a/mdsf/src/tools/selene.rs b/mdsf/src/tools/selene.rs index 1e210c42..10d67aac 100644 --- a/mdsf/src/tools/selene.rs +++ b/mdsf/src/tools/selene.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_selene_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,23 +15,7 @@ fn set_selene_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("selene")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_selene_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_selene_args) } #[cfg(test)] diff --git a/mdsf/src/tools/shellcheck.rs b/mdsf/src/tools/shellcheck.rs index c7ae654e..ba6d0c71 100644 --- a/mdsf/src/tools/shellcheck.rs +++ b/mdsf/src/tools/shellcheck.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_shellcheck_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,23 +15,7 @@ fn set_shellcheck_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("shellcheck")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_shellcheck_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_shellcheck_args) } #[cfg(test)] diff --git a/mdsf/src/tools/shellharden.rs b/mdsf/src/tools/shellharden.rs index 2a0c2858..de9bce8f 100644 --- a/mdsf/src/tools/shellharden.rs +++ b/mdsf/src/tools/shellharden.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_shellharden_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_shellharden_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("shellharden")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_shellharden_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_shellharden_args) } #[cfg(test)] diff --git a/mdsf/src/tools/shfmt.rs b/mdsf/src/tools/shfmt.rs index 0584049d..19d9d3bb 100644 --- a/mdsf/src/tools/shfmt.rs +++ b/mdsf/src/tools/shfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_shfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_shfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("shfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_shfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_shfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sleek.rs b/mdsf/src/tools/sleek.rs index 3027aa40..8feb0878 100644 --- a/mdsf/src/tools/sleek.rs +++ b/mdsf/src/tools/sleek.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_sleek_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_sleek_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("sleek")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_sleek_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_sleek_args) } #[cfg(test)] diff --git a/mdsf/src/tools/smlfmt.rs b/mdsf/src/tools/smlfmt.rs index c3a12cb1..783b2f1a 100644 --- a/mdsf/src/tools/smlfmt.rs +++ b/mdsf/src/tools/smlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_smlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_smlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("smlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_smlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_smlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/snakefmt.rs b/mdsf/src/tools/snakefmt.rs index ff19e029..09b144e9 100644 --- a/mdsf/src/tools/snakefmt.rs +++ b/mdsf/src/tools/snakefmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_snakefmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_snakefmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("snakefmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_snakefmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_snakefmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/solhint.rs b/mdsf/src/tools/solhint.rs index 3b6586cf..f948fb08 100644 --- a/mdsf/src/tools/solhint.rs +++ b/mdsf/src/tools/solhint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_solhint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -22,22 +22,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -18,22 +18,7 @@ fn set_sqlfluff_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("sqlfluff")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_sqlfluff_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_sqlfluff_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sqlfluff_format.rs b/mdsf/src/tools/sqlfluff_format.rs index dfe4bbca..7f446de5 100644 --- a/mdsf/src/tools/sqlfluff_format.rs +++ b/mdsf/src/tools/sqlfluff_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_sqlfluff_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_sqlfluff_format_args(mut cmd: Command, file_path: &std::path::Path) -> Co pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("sqlfluff")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_sqlfluff_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_sqlfluff_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sqlfmt.rs b/mdsf/src/tools/sqlfmt.rs index 846b18dc..8de6d81b 100644 --- a/mdsf/src/tools/sqlfmt.rs +++ b/mdsf/src/tools/sqlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_sqlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_sqlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("sqlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_sqlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_sqlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sqruff.rs b/mdsf/src/tools/sqruff.rs index b0ad8a84..8ce41129 100644 --- a/mdsf/src/tools/sqruff.rs +++ b/mdsf/src/tools/sqruff.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_sqruff_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_sqruff_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("sqruff")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_sqruff_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_sqruff_args) } #[cfg(test)] diff --git a/mdsf/src/tools/standardjs.rs b/mdsf/src/tools/standardjs.rs index 3d6ed8ce..0472b928 100644 --- a/mdsf/src/tools/standardjs.rs +++ b/mdsf/src/tools/standardjs.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_standardjs_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_standardrb_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("standardrb")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_standardrb_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_standardrb_args) } #[cfg(test)] diff --git a/mdsf/src/tools/statix_check.rs b/mdsf/src/tools/statix_check.rs index 4c1394ab..3557a46b 100644 --- a/mdsf/src/tools/statix_check.rs +++ b/mdsf/src/tools/statix_check.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_statix_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,23 +16,7 @@ fn set_statix_check_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("statix")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_statix_check_args(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_statix_check_args) } #[cfg(test)] diff --git a/mdsf/src/tools/statix_fix.rs b/mdsf/src/tools/statix_fix.rs index 973ef924..1fae577f 100644 --- a/mdsf/src/tools/statix_fix.rs +++ b/mdsf/src/tools/statix_fix.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_statix_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_statix_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("statix")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_statix_fix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_statix_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/stylefmt.rs b/mdsf/src/tools/stylefmt.rs index 8a2744b8..aa49b210 100644 --- a/mdsf/src/tools/stylefmt.rs +++ b/mdsf/src/tools/stylefmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_stylefmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,22 +19,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_stylish_haskell_args(mut cmd: Command, file_path: &std::path::Path) -> Co pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("stylish-haskell")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_stylish_haskell_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_stylish_haskell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/stylua.rs b/mdsf/src/tools/stylua.rs index 9728d8ec..3003e89c 100644 --- a/mdsf/src/tools/stylua.rs +++ b/mdsf/src/tools/stylua.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_stylua_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_superhtml_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Comm pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("superhtml")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_superhtml_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_superhtml_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/swift_format.rs b/mdsf/src/tools/swift_format.rs index 0b155ac2..f0741562 100644 --- a/mdsf/src/tools/swift_format.rs +++ b/mdsf/src/tools/swift_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_swift_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_swift_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("swift-format")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_swift_format_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_swift_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/swiftformat.rs b/mdsf/src/tools/swiftformat.rs index c4a8e2af..c6f1bc9f 100644 --- a/mdsf/src/tools/swiftformat.rs +++ b/mdsf/src/tools/swiftformat.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_swiftformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_swiftformat_args(mut cmd: Command, file_path: &std::path::Path) -> Comman pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("swiftformat")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_swiftformat_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_swiftformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/taplo.rs b/mdsf/src/tools/taplo.rs index 4f0bb89f..5e7ad813 100644 --- a/mdsf/src/tools/taplo.rs +++ b/mdsf/src/tools/taplo.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_taplo_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_templ_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("templ")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_templ_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_templ_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/terraform_fmt.rs b/mdsf/src/tools/terraform_fmt.rs index 0983af64..5df808df 100644 --- a/mdsf/src/tools/terraform_fmt.rs +++ b/mdsf/src/tools/terraform_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_terraform_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_terraform_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Comm pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("terraform")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_terraform_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_terraform_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/terragrunt_hclfmt.rs b/mdsf/src/tools/terragrunt_hclfmt.rs index bd57d67f..4ef35307 100644 --- a/mdsf/src/tools/terragrunt_hclfmt.rs +++ b/mdsf/src/tools/terragrunt_hclfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_terragrunt_hclfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_terragrunt_hclfmt_args(mut cmd: Command, file_path: &std::path::Path) -> pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("terragrunt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_terragrunt_hclfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_terragrunt_hclfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/tex_fmt.rs b/mdsf/src/tools/tex_fmt.rs index 47228d81..9d907a5d 100644 --- a/mdsf/src/tools/tex_fmt.rs +++ b/mdsf/src/tools/tex_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_tex_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_tex_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("tex-fmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_tex_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_tex_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/tlint_format.rs b/mdsf/src/tools/tlint_format.rs index 4d086324..3d80658a 100644 --- a/mdsf/src/tools/tlint_format.rs +++ b/mdsf/src/tools/tlint_format.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_tlint_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -19,22 +19,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -17,22 +17,7 @@ fn set_tofu_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("tofu")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_tofu_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_tofu_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/toml_sort.rs b/mdsf/src/tools/toml_sort.rs index 2c32d8ad..2c6e92a9 100644 --- a/mdsf/src/tools/toml_sort.rs +++ b/mdsf/src/tools/toml_sort.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_toml_sort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_toml_sort_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("toml-sort")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_toml_sort_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_toml_sort_args) } #[cfg(test)] diff --git a/mdsf/src/tools/topiary.rs b/mdsf/src/tools/topiary.rs index 18c3040d..64936f6b 100644 --- a/mdsf/src/tools/topiary.rs +++ b/mdsf/src/tools/topiary.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_topiary_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_topiary_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("topiary")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_topiary_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_topiary_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ts_standard.rs b/mdsf/src/tools/ts_standard.rs index f29418fb..b9c0b513 100644 --- a/mdsf/src/tools/ts_standard.rs +++ b/mdsf/src/tools/ts_standard.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ts_standard_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -22,22 +22,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -18,22 +18,7 @@ fn set_typos_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("typos")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_typos_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_typos_args) } #[cfg(test)] diff --git a/mdsf/src/tools/typstfmt.rs b/mdsf/src/tools/typstfmt.rs index 77dc0fb4..1b3af5cc 100644 --- a/mdsf/src/tools/typstfmt.rs +++ b/mdsf/src/tools/typstfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_typstfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_typstfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("typstfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_typstfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_typstfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/typstyle.rs b/mdsf/src/tools/typstyle.rs index 8d32f376..363e318f 100644 --- a/mdsf/src/tools/typstyle.rs +++ b/mdsf/src/tools/typstyle.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_typstyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_typstyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("typstyle")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_typstyle_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_typstyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ufmt.rs b/mdsf/src/tools/ufmt.rs index 93a3d5ed..f9a5e5d6 100644 --- a/mdsf/src/tools/ufmt.rs +++ b/mdsf/src/tools/ufmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ufmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_ufmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ufmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ufmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ufmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/uiua_fmt.rs b/mdsf/src/tools/uiua_fmt.rs index 68e37f2a..17ece0f4 100644 --- a/mdsf/src/tools/uiua_fmt.rs +++ b/mdsf/src/tools/uiua_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_uiua_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_uiua_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("uiua")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_uiua_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_uiua_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/unimport.rs b/mdsf/src/tools/unimport.rs index 7335efa7..3bb7a9c0 100644 --- a/mdsf/src/tools/unimport.rs +++ b/mdsf/src/tools/unimport.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_unimport_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_unimport_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("unimport")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_unimport_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_unimport_args) } #[cfg(test)] diff --git a/mdsf/src/tools/usort.rs b/mdsf/src/tools/usort.rs index 93f31af2..d9bbce81 100644 --- a/mdsf/src/tools/usort.rs +++ b/mdsf/src/tools/usort.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_usort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_usort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("usort")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_usort_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_usort_args) } #[cfg(test)] diff --git a/mdsf/src/tools/v_fmt.rs b/mdsf/src/tools/v_fmt.rs index 83379b1a..174bc074 100644 --- a/mdsf/src/tools/v_fmt.rs +++ b/mdsf/src/tools/v_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_v_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_v_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("v")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_v_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_v_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/vacuum_lint.rs b/mdsf/src/tools/vacuum_lint.rs index 751a66d4..498e9a05 100644 --- a/mdsf/src/tools/vacuum_lint.rs +++ b/mdsf/src/tools/vacuum_lint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_vacuum_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -16,22 +16,7 @@ fn set_veryl_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("veryl")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_veryl_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_veryl_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/vhdl_style_guide.rs b/mdsf/src/tools/vhdl_style_guide.rs index 4aead510..c0e6dd7f 100644 --- a/mdsf/src/tools/vhdl_style_guide.rs +++ b/mdsf/src/tools/vhdl_style_guide.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_vhdl_style_guide_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -17,22 +17,7 @@ fn set_vhdl_style_guide_args(mut cmd: Command, file_path: &std::path::Path) -> C pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("vsg")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_vhdl_style_guide_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_vhdl_style_guide_args) } #[cfg(test)] diff --git a/mdsf/src/tools/wa_fmt.rs b/mdsf/src/tools/wa_fmt.rs index 873ca171..a04b263b 100644 --- a/mdsf/src/tools/wa_fmt.rs +++ b/mdsf/src/tools/wa_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_wa_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_wa_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("wa")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_wa_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_wa_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/wfindent.rs b/mdsf/src/tools/wfindent.rs index 02d5a670..448572e4 100644 --- a/mdsf/src/tools/wfindent.rs +++ b/mdsf/src/tools/wfindent.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_wfindent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -15,22 +15,7 @@ fn set_wfindent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("wfindent")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_wfindent_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_wfindent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/xmlformat.rs b/mdsf/src/tools/xmlformat.rs index a9fc033a..6531738c 100644 --- a/mdsf/src/tools/xmlformat.rs +++ b/mdsf/src/tools/xmlformat.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_xmlformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_xmlformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("xmlformat")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_xmlformat_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_xmlformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/xmllint.rs b/mdsf/src/tools/xmllint.rs index a1939966..2bac1783 100644 --- a/mdsf/src/tools/xmllint.rs +++ b/mdsf/src/tools/xmllint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_xmllint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_xmllint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("xmllint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_xmllint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_xmllint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/xo.rs b/mdsf/src/tools/xo.rs index 6c37b41f..c0fcf109 100644 --- a/mdsf/src/tools/xo.rs +++ b/mdsf/src/tools/xo.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_xo_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -20,22 +20,7 @@ pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option Command { @@ -15,22 +15,7 @@ fn set_yamlfix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("yamlfix")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_yamlfix_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_yamlfix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/yamlfmt.rs b/mdsf/src/tools/yamlfmt.rs index ef4d5fc7..6395abc4 100644 --- a/mdsf/src/tools/yamlfmt.rs +++ b/mdsf/src/tools/yamlfmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_yamlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_yamlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("yamlfmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_yamlfmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_yamlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/yapf.rs b/mdsf/src/tools/yapf.rs index 12c36d56..71bc67a2 100644 --- a/mdsf/src/tools/yapf.rs +++ b/mdsf/src/tools/yapf.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_yapf_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_yapf_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("yapf")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_yapf_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_yapf_args) } #[cfg(test)] diff --git a/mdsf/src/tools/yew_fmt.rs b/mdsf/src/tools/yew_fmt.rs index 05c94b5a..729e37c2 100644 --- a/mdsf/src/tools/yew_fmt.rs +++ b/mdsf/src/tools/yew_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_yew_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -18,22 +18,7 @@ fn set_yew_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("yew-fmt")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_yew_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_yew_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/zig_fmt.rs b/mdsf/src/tools/zig_fmt.rs index c42af0c2..bf69eeee 100644 --- a/mdsf/src/tools/zig_fmt.rs +++ b/mdsf/src/tools/zig_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_zig_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_zig_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("zig")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_zig_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_zig_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ziggy_fmt.rs b/mdsf/src/tools/ziggy_fmt.rs index d207d259..599c5636 100644 --- a/mdsf/src/tools/ziggy_fmt.rs +++ b/mdsf/src/tools/ziggy_fmt.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_ziggy_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_ziggy_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("ziggy")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_ziggy_fmt_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_ziggy_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/zprint.rs b/mdsf/src/tools/zprint.rs index 86368260..2c682803 100644 --- a/mdsf/src/tools/zprint.rs +++ b/mdsf/src/tools/zprint.rs @@ -3,7 +3,7 @@ /// use std::process::Command; -use crate::{error::MdsfError, execution::execute_command, runners::CommandType}; +use crate::{error::MdsfError, runners::CommandType}; #[inline] fn set_zprint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { @@ -16,22 +16,7 @@ fn set_zprint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { let commands = [CommandType::Direct("zprint")]; - for (index, cmd) in commands.iter().enumerate() { - let cmd = set_zprint_args(cmd.build(), file_path); - let execution_result = execute_command(cmd, file_path, timeout); - - if index == commands.len() - 1 { - return execution_result; - } - - if let Ok(r) = execution_result { - if !r.0 { - return Ok(r); - } - } - } - - Ok((true, None)) + crate::execution::run_tools(&commands, file_path, timeout, set_zprint_args) } #[cfg(test)] diff --git a/tools/tool.schema.json b/tools/tool.schema.json index b4163e9c..dbe5c9d6 100644 --- a/tools/tool.schema.json +++ b/tools/tool.schema.json @@ -62,7 +62,7 @@ "definitions": { "ToolCommand": { "type": "object", - "required": ["arguments", "ignore_output"], + "required": ["arguments"], "properties": { "arguments": { "type": "array", @@ -76,10 +76,6 @@ "homepage": { "type": ["string", "null"] }, - "ignore_output": { - "description": "Whether to ignore the output of the command execution", - "type": "boolean" - }, "tests": { "type": ["array", "null"], "items": { From 38f771bdbbcca0924e99b8226ea3d203a41aed2c Mon Sep 17 00:00:00 2001 From: Mads Hougesen Date: Mon, 27 Jan 2025 22:53:32 +0100 Subject: [PATCH 2/5] refactor(schema): remove ignore_output Removing ignore_output since I realised it was not necessary anymore --- tools/actionlint/plugin.json | 1 - tools/alejandra/plugin.json | 1 - tools/ameba/plugin.json | 3 +-- tools/ansible-lint/plugin.json | 3 +-- tools/asmfmt/plugin.json | 3 +-- tools/astyle/plugin.json | 3 +-- tools/auto-optional/plugin.json | 1 - tools/autocorrect/plugin.json | 3 +-- tools/autoflake/plugin.json | 1 - tools/autopep8/plugin.json | 1 - tools/beancount-black/plugin.json | 3 +-- tools/beautysh/plugin.json | 1 - tools/bibtex-tidy/plugin.json | 3 +-- tools/bicep/plugin.json | 3 +-- tools/biome/plugin.json | 7 ++----- tools/black/plugin.json | 1 - tools/blade-formatter/plugin.json | 1 - tools/blue/plugin.json | 1 - tools/bpfmt/plugin.json | 3 +-- tools/brighterscript-formatter/plugin.json | 3 +-- tools/brittany/plugin.json | 3 +-- tools/brunette/plugin.json | 1 - tools/bslint/plugin.json | 3 +-- tools/buf/plugin.json | 1 - tools/buildifier/plugin.json | 3 +-- tools/cabal-fmt/plugin.json | 3 +-- tools/cabal-prettify/plugin.json | 3 +-- tools/cabal/plugin.json | 1 - tools/caddy/plugin.json | 3 +-- tools/caramel/plugin.json | 3 +-- tools/clang-format/plugin.json | 1 - tools/clang-tidy/plugin.json | 3 +-- tools/cljfmt/plugin.json | 3 +-- tools/cljstyle/plugin.json | 1 - tools/cmake-format/plugin.json | 3 +-- tools/codespell/plugin.json | 3 +-- tools/crlfmt/plugin.json | 3 +-- tools/crystal/plugin.json | 1 - tools/csharpier/plugin.json | 1 - tools/css-beautify/plugin.json | 1 - tools/csscomb/plugin.json | 1 - tools/csslint/plugin.json | 3 +-- tools/curlylint/plugin.json | 3 +-- tools/d2/plugin.json | 3 +-- tools/dart/plugin.json | 4 +--- tools/dcm/plugin.json | 6 ++---- tools/deadnix/plugin.json | 3 +-- tools/deno/plugin.json | 4 +--- tools/dfmt/plugin.json | 3 +-- tools/dhall/plugin.json | 3 +-- tools/djade/plugin.json | 3 +-- tools/djlint/plugin.json | 3 +-- tools/docformatter/plugin.json | 3 +-- tools/dockfmt/plugin.json | 3 +-- tools/docstrfmt/plugin.json | 3 +-- tools/doctoc/plugin.json | 3 +-- tools/dotenv-linter/plugin.json | 3 +-- tools/dprint/plugin.json | 3 +-- tools/easy-coding-standard/plugin.json | 3 +-- tools/efmt/plugin.json | 1 - tools/elm-format/plugin.json | 1 - tools/erb-formatter/plugin.json | 3 +-- tools/erlfmt/plugin.json | 1 - tools/eslint/plugin.json | 3 +-- tools/fantomas/plugin.json | 1 - tools/fish_indent/plugin.json | 3 +-- tools/fixjson/plugin.json | 3 +-- tools/floskell/plugin.json | 3 +-- tools/fnlfmt/plugin.json | 3 +-- tools/forge/plugin.json | 3 +-- tools/fourmolu/plugin.json | 1 - tools/fprettify/plugin.json | 1 - tools/futhark/plugin.json | 3 +-- tools/gci/plugin.json | 3 +-- tools/gdformat/plugin.json | 3 +-- tools/gdlint/tool.json | 3 +-- tools/gersemi/plugin.json | 3 +-- tools/gleam/plugin.json | 1 - tools/gluon/plugin.json | 3 +-- tools/gofmt/plugin.json | 1 - tools/gofumpt/plugin.json | 1 - tools/goimports-reviser/plugin.json | 3 +-- tools/goimports/plugin.json | 1 - tools/golines/plugin.json | 1 - tools/google-java-format/plugin.json | 1 - tools/grain/plugin.json | 1 - tools/hadolint/plugin.json | 3 +-- tools/haml-lint/plugin.json | 3 +-- tools/hclfmt/plugin.json | 3 +-- tools/hfmt/plugin.json | 3 +-- tools/hindent/plugin.json | 1 - tools/hlint/plugin.json | 3 +-- tools/html-beautify/plugin.json | 1 - tools/htmlbeautifier/plugin.json | 1 - tools/htmlhint/plugin.json | 3 +-- tools/imba/plugin.json | 3 +-- tools/inko/plugin.json | 3 +-- tools/isort/plugin.json | 1 - tools/joker/plugin.json | 3 +-- tools/js-beautify/plugin.json | 3 +-- tools/json5format/plugin.json | 3 +-- tools/jsona/plugin.json | 6 ++---- tools/jsonlint/plugin.json | 3 +-- tools/jsonnet-lint/plugin.json | 3 +-- tools/jsonnetfmt/plugin.json | 3 +-- tools/juliaformatter_jl/plugin.json | 1 - tools/just/plugin.json | 1 - tools/kcl/plugin.json | 2 -- tools/kdlfmt/plugin.json | 3 +-- tools/kdoc-formatter/plugin.json | 3 +-- tools/ktfmt/plugin.json | 1 - tools/ktlint/plugin.json | 1 - tools/kulala-fmt/plugin.json | 3 +-- tools/leptosfmt/plugin.json | 3 +-- tools/liquidsoap-prettier/plugin.json | 3 +-- tools/luacheck/plugin.json | 3 +-- tools/luaformatter/plugin.json | 1 - tools/mado/plugin.json | 1 - tools/markdownfmt/plugin.json | 1 - tools/markdownlint-cli2/plugin.json | 1 - tools/markdownlint/plugin.json | 1 - tools/markuplint/plugin.json | 3 +-- tools/mdformat/plugin.json | 3 +-- tools/mdslw/plugin.json | 3 +-- tools/meson/plugin.json | 3 +-- tools/misspell/plugin.json | 3 +-- tools/mix/plugin.json | 1 - tools/mojo/plugin.json | 3 +-- tools/mypy/plugin.json | 3 +-- tools/nginxbeautifier/plugin.json | 3 +-- tools/nginxfmt/plugin.json | 3 +-- tools/nickel/plugin.json | 3 +-- tools/nimpretty/plugin.json | 1 - tools/nixfmt/plugin.json | 1 - tools/nixpkgs-fmt/plugin.json | 1 - tools/nomad/plugin.json | 3 +-- tools/nph/plugin.json | 3 +-- tools/npm-groovy-lint/plugin.json | 1 - tools/nufmt/plugin.json | 3 +-- tools/ocamlformat/plugin.json | 1 - tools/ocp-indent/plugin.json | 1 - tools/odinfmt/plugin.json | 3 +-- tools/oelint-adv/plugin.json | 3 +-- tools/opa/plugin.json | 3 +-- tools/ormolu/plugin.json | 1 - tools/oxlint/plugin.json | 3 +-- tools/packer/plugin.json | 6 ++---- tools/perltidy/plugin.json | 3 +-- tools/pg_format/plugin.json | 3 +-- tools/php-cs-fixer/plugin.json | 3 +-- tools/phpcbf/plugin.json | 3 +-- tools/phpinsights/plugin.json | 3 +-- tools/pint/plugin.json | 3 +-- tools/prettier/plugin.json | 1 - tools/pretty-php/plugin.json | 3 +-- tools/prettypst/plugin.json | 3 +-- tools/prisma/plugin.json | 1 - tools/protolint/plugin.json | 3 +-- tools/ptop/plugin.json | 3 +-- tools/puppet-lint/plugin.json | 3 +-- tools/purs-tidy/plugin.json | 1 - tools/purty/plugin.json | 3 +-- tools/pycln/plugin.json | 1 - tools/pycodestyle/plugin.json | 3 +-- tools/pyink/plugin.json | 1 - tools/pyment/plugin.json | 3 +-- tools/qmlfmt/plugin.json | 3 +-- tools/quick-lint-js/plugin.json | 3 +-- tools/raco/plugin.json | 3 +-- tools/refmt/plugin.json | 3 +-- tools/reformat-gherkin/plugin.json | 3 +-- tools/regal/plugin.json | 6 ++---- tools/reorder-python-imports/plugin.json | 3 +-- tools/rescript/plugin.json | 1 - tools/roc/plugin.json | 1 - tools/rstfmt/plugin.json | 3 +-- tools/rubocop/plugin.json | 1 - tools/rubyfmt/plugin.json | 1 - tools/ruff/plugin.json | 4 +--- tools/rufo/plugin.json | 1 - tools/rune/plugin.json | 3 +-- tools/rustfmt/plugin.json | 1 - tools/rustywind/plugin.json | 3 +-- tools/salt-lint/plugin.json | 3 +-- tools/scalafmt/plugin.json | 1 - tools/scalariform/plugin.json | 3 +-- tools/selene/plugin.json | 3 +-- tools/shellcheck/plugin.json | 3 +-- tools/shellharden/plugin.json | 3 +-- tools/shfmt/plugin.json | 1 - tools/sleek/plugin.json | 3 +-- tools/smlfmt/plugin.json | 3 +-- tools/snakefmt/plugin.json | 3 +-- tools/solhint/plugin.json | 3 +-- tools/sql-formatter/plugin.json | 1 - tools/sqlfluff/plugin.json | 4 +--- tools/sqlfmt/plugin.json | 3 +-- tools/sqruff/plugin.json | 3 +-- tools/standardjs/plugin.json | 3 +-- tools/standardrb/plugin.json | 1 - tools/statix/plugin.json | 6 ++---- tools/stylefmt/plugin.json | 1 - tools/stylelint/plugin.json | 3 +-- tools/stylish-haskell/plugin.json | 1 - tools/stylua/plugin.json | 1 - tools/superhtml/plugin.json | 1 - tools/swift-format/plugin.json | 1 - tools/swiftformat/plugin.json | 1 - tools/taplo/plugin.json | 1 - tools/templ/plugin.json | 3 +-- tools/terraform/plugin.json | 1 - tools/terragrunt/plugin.json | 3 +-- tools/tex-fmt/plugin.json | 3 +-- tools/tlint/plugin.json | 3 +-- tools/tofu/plugin.json | 1 - tools/toml-sort/plugin.json | 3 +-- tools/topiary/plugin.json | 1 - tools/ts-standard/plugin.json | 3 +-- tools/tsqllint/plugin.json | 3 +-- tools/twig-cs-fixer/plugin.json | 3 +-- tools/typos/plugin.json | 1 - tools/typstfmt/plugin.json | 3 +-- tools/typstyle/plugin.json | 3 +-- tools/ufmt/plugin.json | 3 +-- tools/uiua/plugin.json | 3 +-- tools/unimport/plugin.json | 3 +-- tools/usort/plugin.json | 1 - tools/v/plugin.json | 3 +-- tools/vacuum/plugin.json | 3 +-- tools/veryl/plugin.json | 1 - tools/vhdl-style-guide/plugin.json | 3 +-- tools/wa/plugin.json | 3 +-- tools/wfindent/plugin.json | 3 +-- tools/xmlformat/plugin.json | 1 - tools/xmllint/plugin.json | 1 - tools/xo/plugin.json | 3 +-- tools/yamlfix/plugin.json | 1 - tools/yamlfmt/plugin.json | 1 - tools/yapf/plugin.json | 1 - tools/yew-fmt/plugin.json | 1 - tools/zig/plugin.json | 1 - tools/ziggy/plugin.json | 3 +-- tools/zprint/plugin.json | 1 - 243 files changed, 160 insertions(+), 415 deletions(-) diff --git a/tools/actionlint/plugin.json b/tools/actionlint/plugin.json index d3d0efab..35f48be2 100644 --- a/tools/actionlint/plugin.json +++ b/tools/actionlint/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": true, "tests": [ { "language": "yaml", diff --git a/tools/alejandra/plugin.json b/tools/alejandra/plugin.json index 471c53d2..e5e1e59a 100644 --- a/tools/alejandra/plugin.json +++ b/tools/alejandra/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "nix", diff --git a/tools/ameba/plugin.json b/tools/ameba/plugin.json index 324252d0..5741eb49 100644 --- a/tools/ameba/plugin.json +++ b/tools/ameba/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "A static code analysis tool for Crystal", diff --git a/tools/ansible-lint/plugin.json b/tools/ansible-lint/plugin.json index fadd8411..99e30754 100644 --- a/tools/ansible-lint/plugin.json +++ b/tools/ansible-lint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you", diff --git a/tools/asmfmt/plugin.json b/tools/asmfmt/plugin.json index 57691750..8a554f2c 100644 --- a/tools/asmfmt/plugin.json +++ b/tools/asmfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Go Assembler Formatter", diff --git a/tools/astyle/plugin.json b/tools/astyle/plugin.json index 95bbb65b..71f2f7c4 100644 --- a/tools/astyle/plugin.json +++ b/tools/astyle/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--quiet", "$PATH"], - "ignore_output": false + "arguments": ["--quiet", "$PATH"] } }, "description": "A Free, Fast, and Small Automatic Formatter for C, C++, C++/CLI, Objective-C, C#, and Java Source Code", diff --git a/tools/auto-optional/plugin.json b/tools/auto-optional/plugin.json index a2b3590b..555777c1 100644 --- a/tools/auto-optional/plugin.json +++ b/tools/auto-optional/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/autocorrect/plugin.json b/tools/autocorrect/plugin.json index 3bbeb8f1..412dd12c 100644 --- a/tools/autocorrect/plugin.json +++ b/tools/autocorrect/plugin.json @@ -4,8 +4,7 @@ "categories": ["autocorrection"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean)", diff --git a/tools/autoflake/plugin.json b/tools/autoflake/plugin.json index cb8705ee..869bd724 100644 --- a/tools/autoflake/plugin.json +++ b/tools/autoflake/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "--in-place", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/autopep8/plugin.json b/tools/autopep8/plugin.json index 0d38901e..ca3997f5 100644 --- a/tools/autopep8/plugin.json +++ b/tools/autopep8/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--in-place", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/beancount-black/plugin.json b/tools/beancount-black/plugin.json index a6e1e074..a6240ae9 100644 --- a/tools/beancount-black/plugin.json +++ b/tools/beancount-black/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Opinionated code formatter, just like Python's black code formatter but for Beancount", diff --git a/tools/beautysh/plugin.json b/tools/beautysh/plugin.json index f4f93c41..5dff6ab8 100644 --- a/tools/beautysh/plugin.json +++ b/tools/beautysh/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "shell", diff --git a/tools/bibtex-tidy/plugin.json b/tools/bibtex-tidy/plugin.json index 45a64dd6..7b8d2697 100644 --- a/tools/bibtex-tidy/plugin.json +++ b/tools/bibtex-tidy/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-m", "$PATH"], - "ignore_output": false + "arguments": ["-m", "$PATH"] } }, "description": "Cleaner and Formatter for BibTeX files", diff --git a/tools/bicep/plugin.json b/tools/bicep/plugin.json index faf3667b..ac3e2546 100644 --- a/tools/bicep/plugin.json +++ b/tools/bicep/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "format": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] } }, "description": "Bicep is a declarative language for describing and deploying Azure resources", diff --git a/tools/biome/plugin.json b/tools/biome/plugin.json index 940f4716..05c2a5c0 100644 --- a/tools/biome/plugin.json +++ b/tools/biome/plugin.json @@ -4,12 +4,10 @@ "categories": ["formatter", "linter"], "commands": { "check": { - "arguments": ["check", "--write", "$PATH"], - "ignore_output": false + "arguments": ["check", "--write", "$PATH"] }, "format": { "arguments": ["format", "--write", "$PATH"], - "ignore_output": false, "tests": [ { "language": "json", @@ -29,8 +27,7 @@ ] }, "lint": { - "arguments": ["lint", "--write", "$PATH"], - "ignore_output": false + "arguments": ["lint", "--write", "$PATH"] } }, "description": "One toolchain for your web project", diff --git a/tools/black/plugin.json b/tools/black/plugin.json index f6c65398..f15d0b9e 100644 --- a/tools/black/plugin.json +++ b/tools/black/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/blade-formatter/plugin.json b/tools/blade-formatter/plugin.json index 778d42ff..c9b1f8c1 100644 --- a/tools/blade-formatter/plugin.json +++ b/tools/blade-formatter/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--write", "$PATH"], - "ignore_output": false, "tests": [ { "language": "blade", diff --git a/tools/blue/plugin.json b/tools/blue/plugin.json index 8c0388ba..8c9de8e9 100644 --- a/tools/blue/plugin.json +++ b/tools/blue/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/bpfmt/plugin.json b/tools/bpfmt/plugin.json index 0ed8d504..f15b9db6 100644 --- a/tools/bpfmt/plugin.json +++ b/tools/bpfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "A formatter for Blueprint files", diff --git a/tools/brighterscript-formatter/plugin.json b/tools/brighterscript-formatter/plugin.json index 44599cd1..6d488e8c 100644 --- a/tools/brighterscript-formatter/plugin.json +++ b/tools/brighterscript-formatter/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH", "--write"], - "ignore_output": false + "arguments": ["$PATH", "--write"] } }, "description": "A code formatter for BrightScript and BrighterScript", diff --git a/tools/brittany/plugin.json b/tools/brittany/plugin.json index 84f356b1..938ccb02 100644 --- a/tools/brittany/plugin.json +++ b/tools/brittany/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--write-mode=inplace", "$PATH"], - "ignore_output": false + "arguments": ["--write-mode=inplace", "$PATH"] } }, "description": "A Haskell source code formatter", diff --git a/tools/brunette/plugin.json b/tools/brunette/plugin.json index 809fe5d4..2a74ba08 100644 --- a/tools/brunette/plugin.json +++ b/tools/brunette/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/bslint/plugin.json b/tools/bslint/plugin.json index 9a78a5fa..ca5d619f 100644 --- a/tools/bslint/plugin.json +++ b/tools/bslint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "A linter for BrightScript and BrighterScript", diff --git a/tools/buf/plugin.json b/tools/buf/plugin.json index 2ca93345..11edfed0 100644 --- a/tools/buf/plugin.json +++ b/tools/buf/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "--write", "$PATH"], - "ignore_output": false, "tests": [ { "language": "protobuf", diff --git a/tools/buildifier/plugin.json b/tools/buildifier/plugin.json index ee7dce40..123e44f8 100644 --- a/tools/buildifier/plugin.json +++ b/tools/buildifier/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "A bazel BUILD file formatter and", diff --git a/tools/cabal-fmt/plugin.json b/tools/cabal-fmt/plugin.json index 5a2d7b05..efba7569 100644 --- a/tools/cabal-fmt/plugin.json +++ b/tools/cabal-fmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--inplace", "$PATH"], - "ignore_output": false + "arguments": ["--inplace", "$PATH"] } }, "description": "An experiment of formatting .cabal files", diff --git a/tools/cabal-prettify/plugin.json b/tools/cabal-prettify/plugin.json index 76a3ef7d..a2c8f431 100644 --- a/tools/cabal-prettify/plugin.json +++ b/tools/cabal-prettify/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Prettify your Cabal package configuration files", diff --git a/tools/cabal/plugin.json b/tools/cabal/plugin.json index 85e4dffd..4efee88a 100644 --- a/tools/cabal/plugin.json +++ b/tools/cabal/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "cabal", diff --git a/tools/caddy/plugin.json b/tools/caddy/plugin.json index 79bf4dba..66c9e50f 100644 --- a/tools/caddy/plugin.json +++ b/tools/caddy/plugin.json @@ -6,8 +6,7 @@ "fmt": { "arguments": ["fmt", "$PATH", "-w"], "description": "Formats or prettifies a Caddyfile", - "homepage": "https://caddyserver.com/docs/command-line#caddy-fmt", - "ignore_output": false + "homepage": "https://caddyserver.com/docs/command-line#caddy-fmt" } }, "description": "Formats or prettifies a Caddyfile", diff --git a/tools/caramel/plugin.json b/tools/caramel/plugin.json index 98bb0d45..c88962c1 100644 --- a/tools/caramel/plugin.json +++ b/tools/caramel/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Formatter for the Caramel programming language", diff --git a/tools/clang-format/plugin.json b/tools/clang-format/plugin.json index fd48f0f4..d9dcb77b 100644 --- a/tools/clang-format/plugin.json +++ b/tools/clang-format/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-i", "$PATH"], - "ignore_output": false, "tests": [ { "language": "java", diff --git a/tools/clang-tidy/plugin.json b/tools/clang-tidy/plugin.json index 99ff9eb9..b507ce7c 100644 --- a/tools/clang-tidy/plugin.json +++ b/tools/clang-tidy/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "clang-tidy is a clang-based C++ “linter” tool", diff --git a/tools/cljfmt/plugin.json b/tools/cljfmt/plugin.json index c0df3f25..9071b415 100644 --- a/tools/cljfmt/plugin.json +++ b/tools/cljfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fix": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] } }, "description": "A tool for formatting Clojure code", diff --git a/tools/cljstyle/plugin.json b/tools/cljstyle/plugin.json index ad852980..2adeeaa9 100644 --- a/tools/cljstyle/plugin.json +++ b/tools/cljstyle/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["fix", "$PATH"], - "ignore_output": false, "tests": [ { "language": "clojure", diff --git a/tools/cmake-format/plugin.json b/tools/cmake-format/plugin.json index da1bd732..3fef6647 100644 --- a/tools/cmake-format/plugin.json +++ b/tools/cmake-format/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-i", "$PATH"], - "ignore_output": false + "arguments": ["-i", "$PATH"] } }, "description": "cmake-format can format your listfiles nicely so that they don't look like crap", diff --git a/tools/codespell/plugin.json b/tools/codespell/plugin.json index ffdd7171..83fa7d5f 100644 --- a/tools/codespell/plugin.json +++ b/tools/codespell/plugin.json @@ -4,8 +4,7 @@ "categories": ["autocorrection"], "commands": { "": { - "arguments": ["$PATH", "--check-hidden", "--write-changes"], - "ignore_output": false + "arguments": ["$PATH", "--check-hidden", "--write-changes"] } }, "description": "Check code for common misspellings", diff --git a/tools/crlfmt/plugin.json b/tools/crlfmt/plugin.json index e3f9d394..565c3cc1 100644 --- a/tools/crlfmt/plugin.json +++ b/tools/crlfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Formatter for CockroachDB's additions to the Go style guide", diff --git a/tools/crystal/plugin.json b/tools/crystal/plugin.json index 86fbcb9d..6ef76e42 100644 --- a/tools/crystal/plugin.json +++ b/tools/crystal/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["tool", "format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "crystal", diff --git a/tools/csharpier/plugin.json b/tools/csharpier/plugin.json index 97fe9a91..99bf940d 100644 --- a/tools/csharpier/plugin.json +++ b/tools/csharpier/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["csharpier", "$PATH"], - "ignore_output": false, "tests": [ { "language": "csharp", diff --git a/tools/css-beautify/plugin.json b/tools/css-beautify/plugin.json index 9a9b09ef..92f58c3d 100644 --- a/tools/css-beautify/plugin.json +++ b/tools/css-beautify/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-r", "--type", "css", "-f", "$PATH"], - "ignore_output": false, "tests": [ { "language": "css", diff --git a/tools/csscomb/plugin.json b/tools/csscomb/plugin.json index da77f482..fb69af62 100644 --- a/tools/csscomb/plugin.json +++ b/tools/csscomb/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-t", "$PATH"], - "ignore_output": false, "tests": [ { "language": "css", diff --git a/tools/csslint/plugin.json b/tools/csslint/plugin.json index b7b798c4..bde54a9a 100644 --- a/tools/csslint/plugin.json +++ b/tools/csslint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--quiet", "$PATH"], - "ignore_output": true + "arguments": ["--quiet", "$PATH"] } }, "description": "Automated linting of Cascading Stylesheets", diff --git a/tools/curlylint/plugin.json b/tools/curlylint/plugin.json index 7e5587f2..4fd3baec 100644 --- a/tools/curlylint/plugin.json +++ b/tools/curlylint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["-q", "$PATH"], - "ignore_output": true + "arguments": ["-q", "$PATH"] } }, "description": "Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid", diff --git a/tools/d2/plugin.json b/tools/d2/plugin.json index ee93562c..79beb124 100644 --- a/tools/d2/plugin.json +++ b/tools/d2/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Formatter for the d2 language", diff --git a/tools/dart/plugin.json b/tools/dart/plugin.json index 4e240c3a..c7e5bbb8 100644 --- a/tools/dart/plugin.json +++ b/tools/dart/plugin.json @@ -4,12 +4,10 @@ "categories": ["formatter", "linter"], "commands": { "fix": { - "arguments": ["fix", "--apply", "$PATH"], - "ignore_output": false + "arguments": ["fix", "--apply", "$PATH"] }, "format": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "dart", diff --git a/tools/dcm/plugin.json b/tools/dcm/plugin.json index 029737e4..f95fadbf 100644 --- a/tools/dcm/plugin.json +++ b/tools/dcm/plugin.json @@ -4,12 +4,10 @@ "categories": ["formatter", "linter"], "commands": { "fix": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] }, "format": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] } }, "description": "Code Quality Tool for Flutter Developers", diff --git a/tools/deadnix/plugin.json b/tools/deadnix/plugin.json index 83b7c66c..5807218a 100644 --- a/tools/deadnix/plugin.json +++ b/tools/deadnix/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["-q", "--edit", "$PATH"], - "ignore_output": false + "arguments": ["-q", "--edit", "$PATH"] } }, "description": "Scan Nix files for dead code", diff --git a/tools/deno/plugin.json b/tools/deno/plugin.json index 4b0beda5..95b6b754 100644 --- a/tools/deno/plugin.json +++ b/tools/deno/plugin.json @@ -5,7 +5,6 @@ "commands": { "fmt": { "arguments": ["fmt", "--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "javascript", @@ -25,8 +24,7 @@ ] }, "lint": { - "arguments": ["lint", "--fix", "$PATH"], - "ignore_output": false + "arguments": ["lint", "--fix", "$PATH"] } }, "description": "Formatter and linter for JavaScript and TypeScript", diff --git a/tools/dfmt/plugin.json b/tools/dfmt/plugin.json index 839423a9..4a3ad8f3 100644 --- a/tools/dfmt/plugin.json +++ b/tools/dfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-i", "$PATH"], - "ignore_output": false + "arguments": ["-i", "$PATH"] } }, "description": "Dfmt is a formatter for D source code", diff --git a/tools/dhall/plugin.json b/tools/dhall/plugin.json index addc8f7d..22d57fa7 100644 --- a/tools/dhall/plugin.json +++ b/tools/dhall/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] } }, "description": "Format Dhall files", diff --git a/tools/djade/plugin.json b/tools/djade/plugin.json index 5fc6d9e6..01f9e6cc 100644 --- a/tools/djade/plugin.json +++ b/tools/djade/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "A Django template formatter", diff --git a/tools/djlint/plugin.json b/tools/djlint/plugin.json index 01486656..62014789 100644 --- a/tools/djlint/plugin.json +++ b/tools/djlint/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["$PATH", "--reformat"], - "ignore_output": false + "arguments": ["$PATH", "--reformat"] } }, "description": "Lint & Format HTML Templates", diff --git a/tools/docformatter/plugin.json b/tools/docformatter/plugin.json index 3c3d4145..80a1af8f 100644 --- a/tools/docformatter/plugin.json +++ b/tools/docformatter/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--in-place", "$PATH"], - "ignore_output": false + "arguments": ["--in-place", "$PATH"] } }, "description": "Formats docstrings to follow PEP 257", diff --git a/tools/dockfmt/plugin.json b/tools/dockfmt/plugin.json index 1929358d..d7606c0c 100644 --- a/tools/dockfmt/plugin.json +++ b/tools/dockfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["fmt", "-w", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "-w", "$PATH"] } }, "description": "Dockerfile format and parser. Like `gofmt` but for Dockerfiles", diff --git a/tools/docstrfmt/plugin.json b/tools/docstrfmt/plugin.json index 2fd95997..dbab935c 100644 --- a/tools/docstrfmt/plugin.json +++ b/tools/docstrfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "A formatter for Sphinx flavored reStructuredText", diff --git a/tools/doctoc/plugin.json b/tools/doctoc/plugin.json index 07dd772f..80a825e9 100644 --- a/tools/doctoc/plugin.json +++ b/tools/doctoc/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Generates table of contents for markdown files", diff --git a/tools/dotenv-linter/plugin.json b/tools/dotenv-linter/plugin.json index 4013a49c..f91368d5 100644 --- a/tools/dotenv-linter/plugin.json +++ b/tools/dotenv-linter/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "fix": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] } }, "description": "Lightning-fast linter for .env files", diff --git a/tools/dprint/plugin.json b/tools/dprint/plugin.json index 15f06f69..4652e555 100644 --- a/tools/dprint/plugin.json +++ b/tools/dprint/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "A pluggable and configurable code formatting platform written in Rust", diff --git a/tools/easy-coding-standard/plugin.json b/tools/easy-coding-standard/plugin.json index ef8d606e..77fd2064 100644 --- a/tools/easy-coding-standard/plugin.json +++ b/tools/easy-coding-standard/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["check", "$PATH", "--fix", "--no-interaction"], - "ignore_output": false + "arguments": ["check", "$PATH", "--fix", "--no-interaction"] } }, "description": "The Easiest way to add coding standard to your PHP project", diff --git a/tools/efmt/plugin.json b/tools/efmt/plugin.json index 3f721beb..43899c11 100644 --- a/tools/efmt/plugin.json +++ b/tools/efmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH"], - "ignore_output": false, "tests": [ { "language": "erlang", diff --git a/tools/elm-format/plugin.json b/tools/elm-format/plugin.json index 6db81915..e9635a86 100644 --- a/tools/elm-format/plugin.json +++ b/tools/elm-format/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--elm-version=0.19", "--yes", "$PATH"], - "ignore_output": false, "tests": [ { "language": "elm", diff --git a/tools/erb-formatter/plugin.json b/tools/erb-formatter/plugin.json index c556021e..be9963cb 100644 --- a/tools/erb-formatter/plugin.json +++ b/tools/erb-formatter/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH", "--write"], - "ignore_output": false + "arguments": ["$PATH", "--write"] } }, "description": "Format ERB files with speed and precision", diff --git a/tools/erlfmt/plugin.json b/tools/erlfmt/plugin.json index 84fe829e..222af315 100644 --- a/tools/erlfmt/plugin.json +++ b/tools/erlfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH_STRING"], - "ignore_output": false, "tests": [ { "language": "erlang", diff --git a/tools/eslint/plugin.json b/tools/eslint/plugin.json index 09124abb..3544f5cd 100644 --- a/tools/eslint/plugin.json +++ b/tools/eslint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "Find and fix problems in your JavaScript code", diff --git a/tools/fantomas/plugin.json b/tools/fantomas/plugin.json index eb0ffb37..dfaec30f 100644 --- a/tools/fantomas/plugin.json +++ b/tools/fantomas/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "fsharp", diff --git a/tools/fish_indent/plugin.json b/tools/fish_indent/plugin.json index bcc5fac9..7e391747 100644 --- a/tools/fish_indent/plugin.json +++ b/tools/fish_indent/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Fish indenter and prettifier", diff --git a/tools/fixjson/plugin.json b/tools/fixjson/plugin.json index cb97aa79..53e84534 100644 --- a/tools/fixjson/plugin.json +++ b/tools/fixjson/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "JSON Fixer for Humans using (relaxed) JSON5", diff --git a/tools/floskell/plugin.json b/tools/floskell/plugin.json index 7099d24b..30eb35c0 100644 --- a/tools/floskell/plugin.json +++ b/tools/floskell/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Floskell is a flexible Haskell source code pretty printer", diff --git a/tools/fnlfmt/plugin.json b/tools/fnlfmt/plugin.json index a5e3be9b..d6a7a106 100644 --- a/tools/fnlfmt/plugin.json +++ b/tools/fnlfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "A formatter for Fennel code", diff --git a/tools/forge/plugin.json b/tools/forge/plugin.json index 33b1fa81..6b51962e 100644 --- a/tools/forge/plugin.json +++ b/tools/forge/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "A Solidity formatter", diff --git a/tools/fourmolu/plugin.json b/tools/fourmolu/plugin.json index d5fd4cce..fd8b3a1a 100644 --- a/tools/fourmolu/plugin.json +++ b/tools/fourmolu/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-i", "$PATH"], - "ignore_output": false, "tests": [ { "language": "haskell", diff --git a/tools/fprettify/plugin.json b/tools/fprettify/plugin.json index 17bdc739..c151da19 100644 --- a/tools/fprettify/plugin.json +++ b/tools/fprettify/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "fortran", diff --git a/tools/futhark/plugin.json b/tools/futhark/plugin.json index 0a836baa..7906de49 100644 --- a/tools/futhark/plugin.json +++ b/tools/futhark/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Code formatter for the furhark programming language", diff --git a/tools/gci/plugin.json b/tools/gci/plugin.json index 1ed9ba72..f7b25e32 100644 --- a/tools/gci/plugin.json +++ b/tools/gci/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["write", "--skip-generated", "--skip-vendor", "$PATH"], - "ignore_output": false + "arguments": ["write", "--skip-generated", "--skip-vendor", "$PATH"] } }, "description": "GCI, a tool that control golang package import order and make it always deterministic", diff --git a/tools/gdformat/plugin.json b/tools/gdformat/plugin.json index 44088b90..1efbf7da 100644 --- a/tools/gdformat/plugin.json +++ b/tools/gdformat/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "GDScript formatter", diff --git a/tools/gdlint/tool.json b/tools/gdlint/tool.json index 5a72e051..c9afb9e9 100644 --- a/tools/gdlint/tool.json +++ b/tools/gdlint/tool.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "GDScript linter", diff --git a/tools/gersemi/plugin.json b/tools/gersemi/plugin.json index 226b33df..57640425 100644 --- a/tools/gersemi/plugin.json +++ b/tools/gersemi/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-i", "-q", "$PATH"], - "ignore_output": false + "arguments": ["-i", "-q", "$PATH"] } }, "description": "A formatter to make your CMake code the real treasure", diff --git a/tools/gleam/plugin.json b/tools/gleam/plugin.json index 5174ae7f..4f4c495b 100644 --- a/tools/gleam/plugin.json +++ b/tools/gleam/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "gleam", diff --git a/tools/gluon/plugin.json b/tools/gluon/plugin.json index 7f4b8af3..f2f67cfd 100644 --- a/tools/gluon/plugin.json +++ b/tools/gluon/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Code formatting for the gluon programming language", diff --git a/tools/gofmt/plugin.json b/tools/gofmt/plugin.json index 19a1b2d4..c9caf97c 100644 --- a/tools/gofmt/plugin.json +++ b/tools/gofmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH"], - "ignore_output": false, "tests": [ { "language": "go", diff --git a/tools/gofumpt/plugin.json b/tools/gofumpt/plugin.json index 6b1d55da..38de626e 100644 --- a/tools/gofumpt/plugin.json +++ b/tools/gofumpt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH"], - "ignore_output": false, "tests": [ { "language": "go", diff --git a/tools/goimports-reviser/plugin.json b/tools/goimports-reviser/plugin.json index 0c3a6626..aa15fe1e 100644 --- a/tools/goimports-reviser/plugin.json +++ b/tools/goimports-reviser/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-format", "$PATH"], - "ignore_output": false + "arguments": ["-format", "$PATH"] } }, "description": "Right imports sorting & code formatting tool (goimports alternative)", diff --git a/tools/goimports/plugin.json b/tools/goimports/plugin.json index 2eb4ca0c..223685f8 100644 --- a/tools/goimports/plugin.json +++ b/tools/goimports/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH"], - "ignore_output": false, "tests": [ { "language": "go", diff --git a/tools/golines/plugin.json b/tools/golines/plugin.json index bb80e18f..0161066c 100644 --- a/tools/golines/plugin.json +++ b/tools/golines/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH"], - "ignore_output": false, "tests": [ { "language": "go", diff --git a/tools/google-java-format/plugin.json b/tools/google-java-format/plugin.json index e4555def..ce52db70 100644 --- a/tools/google-java-format/plugin.json +++ b/tools/google-java-format/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-i", "$PATH"], - "ignore_output": false, "tests": [ { "language": "java", diff --git a/tools/grain/plugin.json b/tools/grain/plugin.json index 594ca8a3..91878e85 100644 --- a/tools/grain/plugin.json +++ b/tools/grain/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "$PATH", "-o", "$PATH"], - "ignore_output": false, "tests": [ { "language": "grain", diff --git a/tools/hadolint/plugin.json b/tools/hadolint/plugin.json index 4eea4d03..4094044c 100644 --- a/tools/hadolint/plugin.json +++ b/tools/hadolint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "Dockerfile linter, validate inline bash, written in Haskell", diff --git a/tools/haml-lint/plugin.json b/tools/haml-lint/plugin.json index 4f175041..dfb2df61 100644 --- a/tools/haml-lint/plugin.json +++ b/tools/haml-lint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--auto-correct", "$PATH"], - "ignore_output": false + "arguments": ["--auto-correct", "$PATH"] } }, "description": "Tool for writing clean and consistent HAML", diff --git a/tools/hclfmt/plugin.json b/tools/hclfmt/plugin.json index 6adb00fc..6bf8eaae 100644 --- a/tools/hclfmt/plugin.json +++ b/tools/hclfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Formatter for hcl files", diff --git a/tools/hfmt/plugin.json b/tools/hfmt/plugin.json index 59cbf848..8f371240 100644 --- a/tools/hfmt/plugin.json +++ b/tools/hfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Format Haskell programs. Inspired by the gofmt utility", diff --git a/tools/hindent/plugin.json b/tools/hindent/plugin.json index ec944f6f..1d13660c 100644 --- a/tools/hindent/plugin.json +++ b/tools/hindent/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "haskell", diff --git a/tools/hlint/plugin.json b/tools/hlint/plugin.json index d57ccf72..f301e587 100644 --- a/tools/hlint/plugin.json +++ b/tools/hlint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--refactor", "-i", "$PATH"], - "ignore_output": false + "arguments": ["--refactor", "-i", "$PATH"] } }, "description": "Haskell source code suggestions", diff --git a/tools/html-beautify/plugin.json b/tools/html-beautify/plugin.json index 832edeaf..897fe1e5 100644 --- a/tools/html-beautify/plugin.json +++ b/tools/html-beautify/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-r", "--type", "html", "-f", "$PATH"], - "ignore_output": false, "tests": [ { "language": "html", diff --git a/tools/htmlbeautifier/plugin.json b/tools/htmlbeautifier/plugin.json index 3f29fd0e..04a4ef7f 100644 --- a/tools/htmlbeautifier/plugin.json +++ b/tools/htmlbeautifier/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "html", diff --git a/tools/htmlhint/plugin.json b/tools/htmlhint/plugin.json index 538bf7b5..ad8c7927 100644 --- a/tools/htmlhint/plugin.json +++ b/tools/htmlhint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "The static code analysis tool you need for your HTML", diff --git a/tools/imba/plugin.json b/tools/imba/plugin.json index 74b50329..96d10509 100644 --- a/tools/imba/plugin.json +++ b/tools/imba/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "-f", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "-f", "$PATH"] } }, "description": "A formatter for Imba", diff --git a/tools/inko/plugin.json b/tools/inko/plugin.json index c7c3c65c..605d7f95 100644 --- a/tools/inko/plugin.json +++ b/tools/inko/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Code formatter for the inko programming language", diff --git a/tools/isort/plugin.json b/tools/isort/plugin.json index 04713dd1..cf4cc0c1 100644 --- a/tools/isort/plugin.json +++ b/tools/isort/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/joker/plugin.json b/tools/joker/plugin.json index fbd763d5..dfef40a5 100644 --- a/tools/joker/plugin.json +++ b/tools/joker/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["--format", "--write", "$PATH"], - "ignore_output": false + "arguments": ["--format", "--write", "$PATH"] } }, "description": "Small Clojure interpreter, linter and formatter", diff --git a/tools/js-beautify/plugin.json b/tools/js-beautify/plugin.json index ecc7d097..00c58e7d 100644 --- a/tools/js-beautify/plugin.json +++ b/tools/js-beautify/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-r", "--type", "js", "-f", "$PATH"], - "ignore_output": false + "arguments": ["-r", "--type", "js", "-f", "$PATH"] } }, "description": "A JavaScript formatter", diff --git a/tools/json5format/plugin.json b/tools/json5format/plugin.json index 4f625173..e85820b6 100644 --- a/tools/json5format/plugin.json +++ b/tools/json5format/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-r", "$PATH"], - "ignore_output": false + "arguments": ["-r", "$PATH"] } }, "description": "JSON5 (a.k.a., \"JSON for Humans\") formatter that preserves contextual comments", diff --git a/tools/jsona/plugin.json b/tools/jsona/plugin.json index fa47e46a..01bf906c 100644 --- a/tools/jsona/plugin.json +++ b/tools/jsona/plugin.json @@ -4,12 +4,10 @@ "categories": ["formatter", "linter"], "commands": { "format": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] }, "lint": { - "arguments": ["lint", "$PATH"], - "ignore_output": false + "arguments": ["lint", "$PATH"] } }, "description": "JSONA linter and formatter", diff --git a/tools/jsonlint/plugin.json b/tools/jsonlint/plugin.json index 3b99af9c..89160b54 100644 --- a/tools/jsonlint/plugin.json +++ b/tools/jsonlint/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["-i", "$PATH"], - "ignore_output": false + "arguments": ["-i", "$PATH"] } }, "description": "A JSON parser and validator with a CLI", diff --git a/tools/jsonnet-lint/plugin.json b/tools/jsonnet-lint/plugin.json index 7333f06e..0e157910 100644 --- a/tools/jsonnet-lint/plugin.json +++ b/tools/jsonnet-lint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "Linter for jsonnet files", diff --git a/tools/jsonnetfmt/plugin.json b/tools/jsonnetfmt/plugin.json index 0f4a3a66..0ed70688 100644 --- a/tools/jsonnetfmt/plugin.json +++ b/tools/jsonnetfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-i", "$PATH"], - "ignore_output": false + "arguments": ["-i", "$PATH"] } }, "description": "Formatter for automatically fixing jsonnet stylistic problems", diff --git a/tools/juliaformatter_jl/plugin.json b/tools/juliaformatter_jl/plugin.json index 8445dd37..dcee024b 100644 --- a/tools/juliaformatter_jl/plugin.json +++ b/tools/juliaformatter_jl/plugin.json @@ -8,7 +8,6 @@ "-E", "using JuliaFormatter;format_file(\\\"{$PATH_STRING}\\\")" ], - "ignore_output": false, "tests": [ { "language": "julia", diff --git a/tools/just/plugin.json b/tools/just/plugin.json index 54964958..831ed02d 100644 --- a/tools/just/plugin.json +++ b/tools/just/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--fmt", "--unstable", "--justfile", "$PATH"], - "ignore_output": false, "tests": [ { "language": "just", diff --git a/tools/kcl/plugin.json b/tools/kcl/plugin.json index 0cb863f7..07c476dd 100644 --- a/tools/kcl/plugin.json +++ b/tools/kcl/plugin.json @@ -7,7 +7,6 @@ "arguments": ["fmt", "$PATH"], "description": "The KCL Format tool supports reformatting KCL files to the standard code style", "homepage": "https://www.kcl-lang.io/docs/tools/cli/kcl/fmt", - "ignore_output": false, "tests": [ { "language": "kcl", @@ -20,7 +19,6 @@ "arguments": ["lint", "$PATH"], "description": "The KCL Lint tool supports checking some warning-level defects in KCL code and supports multiple output formats", "homepage": "https://www.kcl-lang.io/docs/tools/cli/kcl/lint", - "ignore_output": false, "tests": [] } }, diff --git a/tools/kdlfmt/plugin.json b/tools/kdlfmt/plugin.json index 006bae34..d1600eda 100644 --- a/tools/kdlfmt/plugin.json +++ b/tools/kdlfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] } }, "description": "A formatter for kdl documents", diff --git a/tools/kdoc-formatter/plugin.json b/tools/kdoc-formatter/plugin.json index 3b6a2054..05599738 100644 --- a/tools/kdoc-formatter/plugin.json +++ b/tools/kdoc-formatter/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--quiet", "$PATH"], - "ignore_output": false + "arguments": ["--quiet", "$PATH"] } }, "description": "Reformats Kotlin KDoc comments, reflowing text and other cleanup", diff --git a/tools/ktfmt/plugin.json b/tools/ktfmt/plugin.json index b4abb706..4ad00594 100644 --- a/tools/ktfmt/plugin.json +++ b/tools/ktfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--format", "--log-level=error", "$PATH"], - "ignore_output": false, "tests": [ { "language": "kotlin", diff --git a/tools/ktlint/plugin.json b/tools/ktlint/plugin.json index 76a34b62..68090397 100644 --- a/tools/ktlint/plugin.json +++ b/tools/ktlint/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--format", "--log-level=error", "$PATH"], - "ignore_output": false, "tests": [ { "language": "kotlin", diff --git a/tools/kulala-fmt/plugin.json b/tools/kulala-fmt/plugin.json index fbdcc3bb..0d979340 100644 --- a/tools/kulala-fmt/plugin.json +++ b/tools/kulala-fmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "An opinionated 🦄 .http and .rest 🐼 files linter 💄 and formatter ⚡", diff --git a/tools/leptosfmt/plugin.json b/tools/leptosfmt/plugin.json index ca0bdde6..f7e99265 100644 --- a/tools/leptosfmt/plugin.json +++ b/tools/leptosfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--quiet", "$PATH"], - "ignore_output": false + "arguments": ["--quiet", "$PATH"] } }, "description": "A formatter for the leptos view! macro", diff --git a/tools/liquidsoap-prettier/plugin.json b/tools/liquidsoap-prettier/plugin.json index 3055ef77..cc5d7ce7 100644 --- a/tools/liquidsoap-prettier/plugin.json +++ b/tools/liquidsoap-prettier/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--write", "$PATH"], - "ignore_output": false + "arguments": ["--write", "$PATH"] } }, "description": "Prettier plugin for liquidsoap script", diff --git a/tools/luacheck/plugin.json b/tools/luacheck/plugin.json index 85d87ddb..35c25e4e 100644 --- a/tools/luacheck/plugin.json +++ b/tools/luacheck/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "A tool for linting and static analysis of Lua code", diff --git a/tools/luaformatter/plugin.json b/tools/luaformatter/plugin.json index 4b6af960..f4337214 100644 --- a/tools/luaformatter/plugin.json +++ b/tools/luaformatter/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-i", "$PATH"], - "ignore_output": false, "tests": [ { "language": "lua", diff --git a/tools/mado/plugin.json b/tools/mado/plugin.json index 6b36d4e3..0fb7a834 100644 --- a/tools/mado/plugin.json +++ b/tools/mado/plugin.json @@ -5,7 +5,6 @@ "commands": { "check": { "arguments": ["check", "$PATH"], - "ignore_output": true, "tests": [ { "language": "markdown", diff --git a/tools/markdownfmt/plugin.json b/tools/markdownfmt/plugin.json index dfb4e8ff..2184fa2d 100644 --- a/tools/markdownfmt/plugin.json +++ b/tools/markdownfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH"], - "ignore_output": false, "tests": [ { "language": "markdown", diff --git a/tools/markdownlint-cli2/plugin.json b/tools/markdownlint-cli2/plugin.json index 55ea567a..76fe64d2 100644 --- a/tools/markdownlint-cli2/plugin.json +++ b/tools/markdownlint-cli2/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--fix", "$PATH"], - "ignore_output": false, "tests": [ { "language": "markdown", diff --git a/tools/markdownlint/plugin.json b/tools/markdownlint/plugin.json index cf1bc0b7..a8fb6991 100644 --- a/tools/markdownlint/plugin.json +++ b/tools/markdownlint/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--fix", "$PATH"], - "ignore_output": false, "tests": [ { "language": "markdown", diff --git a/tools/markuplint/plugin.json b/tools/markuplint/plugin.json index 305b06c5..18ca9e9f 100644 --- a/tools/markuplint/plugin.json +++ b/tools/markuplint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "An HTML linter for all markup developers", diff --git a/tools/mdformat/plugin.json b/tools/mdformat/plugin.json index 60664bb7..ed07ad00 100644 --- a/tools/mdformat/plugin.json +++ b/tools/mdformat/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "CommonMark compliant Markdown formatter", diff --git a/tools/mdslw/plugin.json b/tools/mdslw/plugin.json index 9b4e7c1f..96b23f73 100644 --- a/tools/mdslw/plugin.json +++ b/tools/mdslw/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Prepare your markdown for easy diff'ing!", diff --git a/tools/meson/plugin.json b/tools/meson/plugin.json index 1e53cb06..a939e66c 100644 --- a/tools/meson/plugin.json +++ b/tools/meson/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "-i", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "-i", "$PATH"] } }, "description": "Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible", diff --git a/tools/misspell/plugin.json b/tools/misspell/plugin.json index 50b9b979..ea55a998 100644 --- a/tools/misspell/plugin.json +++ b/tools/misspell/plugin.json @@ -4,8 +4,7 @@ "categories": ["autocorrection"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Correct commonly misspelled English words in source files", diff --git a/tools/mix/plugin.json b/tools/mix/plugin.json index a18278ec..7d25d9ae 100644 --- a/tools/mix/plugin.json +++ b/tools/mix/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "elixir", diff --git a/tools/mojo/plugin.json b/tools/mojo/plugin.json index 7f36ed5a..f7fb312d 100644 --- a/tools/mojo/plugin.json +++ b/tools/mojo/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "format": { - "arguments": ["format", "-q", "$PATH"], - "ignore_output": false + "arguments": ["format", "-q", "$PATH"] } }, "description": "Formats Mojo source files", diff --git a/tools/mypy/plugin.json b/tools/mypy/plugin.json index 601c2494..0ce360de 100644 --- a/tools/mypy/plugin.json +++ b/tools/mypy/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "Optional static typing for Python", diff --git a/tools/nginxbeautifier/plugin.json b/tools/nginxbeautifier/plugin.json index d5cd85c8..a80ef9ad 100644 --- a/tools/nginxbeautifier/plugin.json +++ b/tools/nginxbeautifier/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Format and beautify nginx config files", diff --git a/tools/nginxfmt/plugin.json b/tools/nginxfmt/plugin.json index 8e0c0d1a..45c5e034 100644 --- a/tools/nginxfmt/plugin.json +++ b/tools/nginxfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "nginx config file formatter/beautifier written in Python with no additional dependencies", diff --git a/tools/nickel/plugin.json b/tools/nickel/plugin.json index 51334393..5b52460b 100644 --- a/tools/nickel/plugin.json +++ b/tools/nickel/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "format": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] } }, "description": "Better configuration for less", diff --git a/tools/nimpretty/plugin.json b/tools/nimpretty/plugin.json index eb7a676b..a064d7b0 100644 --- a/tools/nimpretty/plugin.json +++ b/tools/nimpretty/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "nim", diff --git a/tools/nixfmt/plugin.json b/tools/nixfmt/plugin.json index d40b8e37..942d8bac 100644 --- a/tools/nixfmt/plugin.json +++ b/tools/nixfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "nix", diff --git a/tools/nixpkgs-fmt/plugin.json b/tools/nixpkgs-fmt/plugin.json index 19025562..26d770d7 100644 --- a/tools/nixpkgs-fmt/plugin.json +++ b/tools/nixpkgs-fmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "nix", diff --git a/tools/nomad/plugin.json b/tools/nomad/plugin.json index cee48674..01b35fbc 100644 --- a/tools/nomad/plugin.json +++ b/tools/nomad/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "CLI for HashiCorp Nomad", diff --git a/tools/nph/plugin.json b/tools/nph/plugin.json index 037084b0..0b902c65 100644 --- a/tools/nph/plugin.json +++ b/tools/nph/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "An opinionated code formatter for Nim", diff --git a/tools/npm-groovy-lint/plugin.json b/tools/npm-groovy-lint/plugin.json index 7d624887..1f359288 100644 --- a/tools/npm-groovy-lint/plugin.json +++ b/tools/npm-groovy-lint/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "groovy", diff --git a/tools/nufmt/plugin.json b/tools/nufmt/plugin.json index 7b398822..b0a2aa9d 100644 --- a/tools/nufmt/plugin.json +++ b/tools/nufmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "the nushell formatter", diff --git a/tools/ocamlformat/plugin.json b/tools/ocamlformat/plugin.json index 507fc2c0..ee5b705c 100644 --- a/tools/ocamlformat/plugin.json +++ b/tools/ocamlformat/plugin.json @@ -10,7 +10,6 @@ "--enable-outside-detected-project", "$PATH" ], - "ignore_output": false, "tests": [ { "language": "ocaml", diff --git a/tools/ocp-indent/plugin.json b/tools/ocp-indent/plugin.json index 3b3608c2..9652fccb 100644 --- a/tools/ocp-indent/plugin.json +++ b/tools/ocp-indent/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--inplace", "$PATH"], - "ignore_output": false, "tests": [ { "language": "ocaml", diff --git a/tools/odinfmt/plugin.json b/tools/odinfmt/plugin.json index 8e4b9590..b4e93147 100644 --- a/tools/odinfmt/plugin.json +++ b/tools/odinfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Formatter for the Odin programming language", diff --git a/tools/oelint-adv/plugin.json b/tools/oelint-adv/plugin.json index c3c25397..4116a8fa 100644 --- a/tools/oelint-adv/plugin.json +++ b/tools/oelint-adv/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "--nobackup", "--quiet", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "--nobackup", "--quiet", "$PATH"] } }, "description": "Advanced oelint", diff --git a/tools/opa/plugin.json b/tools/opa/plugin.json index 591b5fb9..a8323ebd 100644 --- a/tools/opa/plugin.json +++ b/tools/opa/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH", "-w"], - "ignore_output": false + "arguments": ["fmt", "$PATH", "-w"] } }, "description": "Format Rego source files", diff --git a/tools/ormolu/plugin.json b/tools/ormolu/plugin.json index 63f6cb21..decd91b6 100644 --- a/tools/ormolu/plugin.json +++ b/tools/ormolu/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--mode", "inplace", "$PATH"], - "ignore_output": false, "tests": [ { "language": "haskell", diff --git a/tools/oxlint/plugin.json b/tools/oxlint/plugin.json index 80e77934..8fb9253f 100644 --- a/tools/oxlint/plugin.json +++ b/tools/oxlint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "Oxlint is designed to catch erroneous or useless code without requiring any configurations by default", diff --git a/tools/packer/plugin.json b/tools/packer/plugin.json index 02435204..d8550688 100644 --- a/tools/packer/plugin.json +++ b/tools/packer/plugin.json @@ -4,12 +4,10 @@ "categories": ["formatter"], "commands": { "fix": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] }, "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Packer is used to format HCL2 configuration files", diff --git a/tools/perltidy/plugin.json b/tools/perltidy/plugin.json index 75409273..203a65f2 100644 --- a/tools/perltidy/plugin.json +++ b/tools/perltidy/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-b", "$PATH"], - "ignore_output": false + "arguments": ["-b", "$PATH"] } }, "description": "Perl::Tidy, a source code formatter for Perl", diff --git a/tools/pg_format/plugin.json b/tools/pg_format/plugin.json index e62ea28e..6482fa0f 100644 --- a/tools/pg_format/plugin.json +++ b/tools/pg_format/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--inplace", "$PATH"], - "ignore_output": false + "arguments": ["--inplace", "$PATH"] } }, "description": "A PostgreSQL SQL syntax beautifier", diff --git a/tools/php-cs-fixer/plugin.json b/tools/php-cs-fixer/plugin.json index a3b6284d..128833a4 100644 --- a/tools/php-cs-fixer/plugin.json +++ b/tools/php-cs-fixer/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "fix": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] } }, "description": "A tool to automatically fix PHP Coding Standards issues", diff --git a/tools/phpcbf/plugin.json b/tools/phpcbf/plugin.json index 4072e0c1..45ad0446 100644 --- a/tools/phpcbf/plugin.json +++ b/tools/phpcbf/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "PHP Code Beautifier and Fixer fixes violations of a defined coding standard", diff --git a/tools/phpinsights/plugin.json b/tools/phpinsights/plugin.json index f0da4ef5..b606db67 100644 --- a/tools/phpinsights/plugin.json +++ b/tools/phpinsights/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "fix": { - "arguments": ["fix", "$PATH", "--no-interaction", "--quiet"], - "ignore_output": false + "arguments": ["fix", "$PATH", "--no-interaction", "--quiet"] } }, "description": "Instant PHP quality checks from your console", diff --git a/tools/pint/plugin.json b/tools/pint/plugin.json index 07d2d0a4..e3654432 100644 --- a/tools/pint/plugin.json +++ b/tools/pint/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Laravel Pint is an opinionated PHP code style fixer for minimalists", diff --git a/tools/prettier/plugin.json b/tools/prettier/plugin.json index 29d36691..58c90253 100644 --- a/tools/prettier/plugin.json +++ b/tools/prettier/plugin.json @@ -12,7 +12,6 @@ "--write", "$PATH" ], - "ignore_output": false, "tests": [ { "language": "json", diff --git a/tools/pretty-php/plugin.json b/tools/pretty-php/plugin.json index 28f77ddc..4388386b 100644 --- a/tools/pretty-php/plugin.json +++ b/tools/pretty-php/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "The opinionated PHP code formatter", diff --git a/tools/prettypst/plugin.json b/tools/prettypst/plugin.json index 3ad515d5..ec554122 100644 --- a/tools/prettypst/plugin.json +++ b/tools/prettypst/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Formatter for Typst", diff --git a/tools/prisma/plugin.json b/tools/prisma/plugin.json index 4d649c80..a8fe777a 100644 --- a/tools/prisma/plugin.json +++ b/tools/prisma/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "--schema={$PATH_STRING}"], - "ignore_output": false, "tests": [ { "language": "schema", diff --git a/tools/protolint/plugin.json b/tools/protolint/plugin.json index cdde9dc7..8c41ecec 100644 --- a/tools/protolint/plugin.json +++ b/tools/protolint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["lint", "-fix", "$PATH"], - "ignore_output": false + "arguments": ["lint", "-fix", "$PATH"] } }, "description": "A pluggable linter and fixer to enforce Protocol Buffer style and conventions", diff --git a/tools/ptop/plugin.json b/tools/ptop/plugin.json index 3d1a69c0..f2471b73 100644 --- a/tools/ptop/plugin.json +++ b/tools/ptop/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH", "$PATH"], - "ignore_output": false + "arguments": ["$PATH", "$PATH"] } }, "description": "Free Pascal source formatter", diff --git a/tools/puppet-lint/plugin.json b/tools/puppet-lint/plugin.json index ee164fd0..0b831f75 100644 --- a/tools/puppet-lint/plugin.json +++ b/tools/puppet-lint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "Check that your Puppet manifests conform to the style guide", diff --git a/tools/purs-tidy/plugin.json b/tools/purs-tidy/plugin.json index c183cc74..88ed4148 100644 --- a/tools/purs-tidy/plugin.json +++ b/tools/purs-tidy/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["format-in-place", "$PATH"], - "ignore_output": false, "tests": [ { "language": "purescript", diff --git a/tools/purty/plugin.json b/tools/purty/plugin.json index da8d0cae..b15d68c3 100644 --- a/tools/purty/plugin.json +++ b/tools/purty/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--write", "$PATH"], - "ignore_output": false + "arguments": ["--write", "$PATH"] } }, "description": "PureScript pretty-printer", diff --git a/tools/pycln/plugin.json b/tools/pycln/plugin.json index df118f74..e1316fa6 100644 --- a/tools/pycln/plugin.json +++ b/tools/pycln/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--no-gitignore", "--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/pycodestyle/plugin.json b/tools/pycodestyle/plugin.json index 0f561154..f51b9d72 100644 --- a/tools/pycodestyle/plugin.json +++ b/tools/pycodestyle/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Simple Python style checker in one Python file", diff --git a/tools/pyink/plugin.json b/tools/pyink/plugin.json index 529158f0..09bb2998 100644 --- a/tools/pyink/plugin.json +++ b/tools/pyink/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/pyment/plugin.json b/tools/pyment/plugin.json index 33e89922..4ddaf6b2 100644 --- a/tools/pyment/plugin.json +++ b/tools/pyment/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "Format and convert Python docstrings and generates patches", diff --git a/tools/qmlfmt/plugin.json b/tools/qmlfmt/plugin.json index 1d196ee4..effa8bef 100644 --- a/tools/qmlfmt/plugin.json +++ b/tools/qmlfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-w", "$PATH"], - "ignore_output": false + "arguments": ["-w", "$PATH"] } }, "description": "qmlfmt - command line application that formats QML files", diff --git a/tools/quick-lint-js/plugin.json b/tools/quick-lint-js/plugin.json index d853dd9e..cd3f4820 100644 --- a/tools/quick-lint-js/plugin.json +++ b/tools/quick-lint-js/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "quick-lint-js finds bugs in JavaScript programs", diff --git a/tools/raco/plugin.json b/tools/raco/plugin.json index 839aa08f..5c97c3b0 100644 --- a/tools/raco/plugin.json +++ b/tools/raco/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "-i", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "-i", "$PATH"] } }, "description": "An extensible code formatter for Racket", diff --git a/tools/refmt/plugin.json b/tools/refmt/plugin.json index 2a1fb88d..ac8c48df 100644 --- a/tools/refmt/plugin.json +++ b/tools/refmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--in-place", "$PATH"], - "ignore_output": false + "arguments": ["--in-place", "$PATH"] } }, "description": "refmt stands by Reason Formatter and it formats Reason programs, is a parser and pretty-printer for Reason", diff --git a/tools/reformat-gherkin/plugin.json b/tools/reformat-gherkin/plugin.json index d144f9f2..2e68494f 100644 --- a/tools/reformat-gherkin/plugin.json +++ b/tools/reformat-gherkin/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Reformat-gherkin automatically formats Gherkin files", diff --git a/tools/regal/plugin.json b/tools/regal/plugin.json index 5ad39af0..2494b664 100644 --- a/tools/regal/plugin.json +++ b/tools/regal/plugin.json @@ -4,12 +4,10 @@ "categories": ["linter"], "commands": { "fix": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] }, "lint": { - "arguments": ["lint", "$PATH"], - "ignore_output": true + "arguments": ["lint", "$PATH"] } }, "description": "Regal is a linter and language server for Rego, bringing your policy development experience to the next level", diff --git a/tools/reorder-python-imports/plugin.json b/tools/reorder-python-imports/plugin.json index dbc04c2c..1c8e59ad 100644 --- a/tools/reorder-python-imports/plugin.json +++ b/tools/reorder-python-imports/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Rewrites source to reorder python imports", diff --git a/tools/rescript/plugin.json b/tools/rescript/plugin.json index 54c0a426..21bcf86f 100644 --- a/tools/rescript/plugin.json +++ b/tools/rescript/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "rescript", diff --git a/tools/roc/plugin.json b/tools/roc/plugin.json index 99f7a4c7..6ee01d54 100644 --- a/tools/roc/plugin.json +++ b/tools/roc/plugin.json @@ -5,7 +5,6 @@ "commands": { "format": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "roc", diff --git a/tools/rstfmt/plugin.json b/tools/rstfmt/plugin.json index 93c96ede..24456d71 100644 --- a/tools/rstfmt/plugin.json +++ b/tools/rstfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "A formatter for reStructuredText", diff --git a/tools/rubocop/plugin.json b/tools/rubocop/plugin.json index b7bf5cc7..ddc17a21 100644 --- a/tools/rubocop/plugin.json +++ b/tools/rubocop/plugin.json @@ -11,7 +11,6 @@ "quiet", "$PATH" ], - "ignore_output": false, "tests": [ { "language": "ruby", diff --git a/tools/rubyfmt/plugin.json b/tools/rubyfmt/plugin.json index fb7f8107..06d92c8c 100644 --- a/tools/rubyfmt/plugin.json +++ b/tools/rubyfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-i", "$PATH"], - "ignore_output": false, "tests": [ { "language": "ruby", diff --git a/tools/ruff/plugin.json b/tools/ruff/plugin.json index 9e585ad0..2a3710ae 100644 --- a/tools/ruff/plugin.json +++ b/tools/ruff/plugin.json @@ -4,12 +4,10 @@ "categories": ["formatter", "linter"], "commands": { "check": { - "arguments": ["check", "--fix", "--quiet", "$PATH"], - "ignore_output": false + "arguments": ["check", "--fix", "--quiet", "$PATH"] }, "format": { "arguments": ["format", "--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/rufo/plugin.json b/tools/rufo/plugin.json index 1dccfbc5..e0c688fe 100644 --- a/tools/rufo/plugin.json +++ b/tools/rufo/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--simple-exit", "$PATH"], - "ignore_output": false, "tests": [ { "language": "ruby", diff --git a/tools/rune/plugin.json b/tools/rune/plugin.json index f7647c6c..02ec45d2 100644 --- a/tools/rune/plugin.json +++ b/tools/rune/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Tools for the Rune programming language", diff --git a/tools/rustfmt/plugin.json b/tools/rustfmt/plugin.json index aa09cebf..ac790102 100644 --- a/tools/rustfmt/plugin.json +++ b/tools/rustfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--edition", "2021", "--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "rust", diff --git a/tools/rustywind/plugin.json b/tools/rustywind/plugin.json index 964f1bd3..debeb4b2 100644 --- a/tools/rustywind/plugin.json +++ b/tools/rustywind/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--write", "$PATH"], - "ignore_output": false + "arguments": ["--write", "$PATH"] } }, "description": "CLI for organizing Tailwind CSS classes", diff --git a/tools/salt-lint/plugin.json b/tools/salt-lint/plugin.json index 74d14141..9d558977 100644 --- a/tools/salt-lint/plugin.json +++ b/tools/salt-lint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "A command-line utility that checks for best practices in SaltStack", diff --git a/tools/scalafmt/plugin.json b/tools/scalafmt/plugin.json index e1f03578..1bc35b1a 100644 --- a/tools/scalafmt/plugin.json +++ b/tools/scalafmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "--mode", "any", "$PATH"], - "ignore_output": false, "tests": [ { "language": "scala", diff --git a/tools/scalariform/plugin.json b/tools/scalariform/plugin.json index 28387130..dd4a5f2a 100644 --- a/tools/scalariform/plugin.json +++ b/tools/scalariform/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Scala source code formatter", diff --git a/tools/selene/plugin.json b/tools/selene/plugin.json index c90e0692..13e15196 100644 --- a/tools/selene/plugin.json +++ b/tools/selene/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "A blazing-fast modern Lua linter written in Rust", diff --git a/tools/shellcheck/plugin.json b/tools/shellcheck/plugin.json index 8795e463..df2a6594 100644 --- a/tools/shellcheck/plugin.json +++ b/tools/shellcheck/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": true + "arguments": ["$PATH"] } }, "description": "ShellCheck, a static analysis tool for shell scripts", diff --git a/tools/shellharden/plugin.json b/tools/shellharden/plugin.json index ab2a8191..d55a3da9 100644 --- a/tools/shellharden/plugin.json +++ b/tools/shellharden/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--transform", "--replace", "$PATH"], - "ignore_output": false + "arguments": ["--transform", "--replace", "$PATH"] } }, "description": "The corrective bash syntax highlighter", diff --git a/tools/shfmt/plugin.json b/tools/shfmt/plugin.json index e579a3c1..f3aeae23 100644 --- a/tools/shfmt/plugin.json +++ b/tools/shfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--write", "$PATH"], - "ignore_output": false, "tests": [ { "language": "shell", diff --git a/tools/sleek/plugin.json b/tools/sleek/plugin.json index 224047f7..87cd8c8e 100644 --- a/tools/sleek/plugin.json +++ b/tools/sleek/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Sleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability and productivity", diff --git a/tools/smlfmt/plugin.json b/tools/smlfmt/plugin.json index 766d1396..00ef2387 100644 --- a/tools/smlfmt/plugin.json +++ b/tools/smlfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["--force", "$PATH"], - "ignore_output": false + "arguments": ["--force", "$PATH"] } }, "description": "A custom parser/auto-formatter for Standard ML", diff --git a/tools/snakefmt/plugin.json b/tools/snakefmt/plugin.json index 4bcaa2eb..f8020639 100644 --- a/tools/snakefmt/plugin.json +++ b/tools/snakefmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "The uncompromising Snakemake code formatter", diff --git a/tools/solhint/plugin.json b/tools/solhint/plugin.json index 0faafa41..e8ce6178 100644 --- a/tools/solhint/plugin.json +++ b/tools/solhint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--quiet", "--fix", "--noPrompt", "$PATH"], - "ignore_output": false + "arguments": ["--quiet", "--fix", "--noPrompt", "$PATH"] } }, "description": "Solhint is an open-source project to provide a linting utility for Solidity code", diff --git a/tools/sql-formatter/plugin.json b/tools/sql-formatter/plugin.json index 4629958c..b78f5dbd 100644 --- a/tools/sql-formatter/plugin.json +++ b/tools/sql-formatter/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--fix", "$PATH"], - "ignore_output": false, "tests": [ { "language": "sql", diff --git a/tools/sqlfluff/plugin.json b/tools/sqlfluff/plugin.json index 3074abf9..48ee3013 100644 --- a/tools/sqlfluff/plugin.json +++ b/tools/sqlfluff/plugin.json @@ -4,12 +4,10 @@ "categories": ["formatter", "linter"], "commands": { "fix": { - "arguments": ["fix", "--dialect", "ansi", "$PATH"], - "ignore_output": false + "arguments": ["fix", "--dialect", "ansi", "$PATH"] }, "format": { "arguments": ["format", "--dialect", "ansi", "$PATH"], - "ignore_output": false, "tests": [ { "language": "sql", diff --git a/tools/sqlfmt/plugin.json b/tools/sqlfmt/plugin.json index 81bffcfb..e5a31c34 100644 --- a/tools/sqlfmt/plugin.json +++ b/tools/sqlfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "sqlfmt formats your dbt SQL files so you don't have to", diff --git a/tools/sqruff/plugin.json b/tools/sqruff/plugin.json index af489679..89c845c9 100644 --- a/tools/sqruff/plugin.json +++ b/tools/sqruff/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] } }, "description": "Fast SQL formatter/linter", diff --git a/tools/standardjs/plugin.json b/tools/standardjs/plugin.json index e3546780..28176a15 100644 --- a/tools/standardjs/plugin.json +++ b/tools/standardjs/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "JavaScript style guide, linter, and formatter", diff --git a/tools/standardrb/plugin.json b/tools/standardrb/plugin.json index eefeaee1..6581ce11 100644 --- a/tools/standardrb/plugin.json +++ b/tools/standardrb/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--fix", "$PATH"], - "ignore_output": false, "tests": [ { "language": "ruby", diff --git a/tools/statix/plugin.json b/tools/statix/plugin.json index eea592be..b095001b 100644 --- a/tools/statix/plugin.json +++ b/tools/statix/plugin.json @@ -4,12 +4,10 @@ "categories": ["linter"], "commands": { "check": { - "arguments": ["check", "$PATH"], - "ignore_output": true + "arguments": ["check", "$PATH"] }, "fix": { - "arguments": ["fix", "$PATH"], - "ignore_output": false + "arguments": ["fix", "$PATH"] } }, "description": "lints and suggestions for the nix programming language", diff --git a/tools/stylefmt/plugin.json b/tools/stylefmt/plugin.json index c8f1a108..b5cd0abc 100644 --- a/tools/stylefmt/plugin.json +++ b/tools/stylefmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "scss", diff --git a/tools/stylelint/plugin.json b/tools/stylelint/plugin.json index ffd35ca6..d0cf4eec 100644 --- a/tools/stylelint/plugin.json +++ b/tools/stylelint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "A mighty CSS linter that helps you avoid errors and enforce conventions", diff --git a/tools/stylish-haskell/plugin.json b/tools/stylish-haskell/plugin.json index 2908ce3c..f9ca6705 100644 --- a/tools/stylish-haskell/plugin.json +++ b/tools/stylish-haskell/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--inplace", "$PATH"], - "ignore_output": false, "tests": [ { "language": "haskell", diff --git a/tools/stylua/plugin.json b/tools/stylua/plugin.json index 032941bc..2704f298 100644 --- a/tools/stylua/plugin.json +++ b/tools/stylua/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--verify", "$PATH"], - "ignore_output": false, "tests": [ { "language": "lua", diff --git a/tools/superhtml/plugin.json b/tools/superhtml/plugin.json index 7b993195..ff2eebae 100644 --- a/tools/superhtml/plugin.json +++ b/tools/superhtml/plugin.json @@ -5,7 +5,6 @@ "commands": { "fmt": { "arguments": ["fmt", "$PATH"], - "ignore_output": false, "tests": [ { "language": "html", diff --git a/tools/swift-format/plugin.json b/tools/swift-format/plugin.json index bd05f205..12591039 100644 --- a/tools/swift-format/plugin.json +++ b/tools/swift-format/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--in-place", "$PATH"], - "ignore_output": false, "tests": [ { "language": "swift", diff --git a/tools/swiftformat/plugin.json b/tools/swiftformat/plugin.json index 3e95da6b..1fc166cd 100644 --- a/tools/swiftformat/plugin.json +++ b/tools/swiftformat/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "swift", diff --git a/tools/taplo/plugin.json b/tools/taplo/plugin.json index 59a7c2dd..d8c49b6e 100644 --- a/tools/taplo/plugin.json +++ b/tools/taplo/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "toml", diff --git a/tools/templ/plugin.json b/tools/templ/plugin.json index efc0e553..128bd3e7 100644 --- a/tools/templ/plugin.json +++ b/tools/templ/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Tooling for the Templ template language", diff --git a/tools/terraform/plugin.json b/tools/terraform/plugin.json index d0286dee..c61c0729 100644 --- a/tools/terraform/plugin.json +++ b/tools/terraform/plugin.json @@ -5,7 +5,6 @@ "commands": { "fmt": { "arguments": ["fmt", "-write=true", "$PATH"], - "ignore_output": false, "tests": [ { "language": "tf", diff --git a/tools/terragrunt/plugin.json b/tools/terragrunt/plugin.json index 23054c65..faf033c0 100644 --- a/tools/terragrunt/plugin.json +++ b/tools/terragrunt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "hclfmt": { - "arguments": ["hclfmt", "--terragrunt-hclfmt-file", "$PATH"], - "ignore_output": false + "arguments": ["hclfmt", "--terragrunt-hclfmt-file", "$PATH"] } }, "description": "Recursively find hcl files and rewrite them into a canonical format", diff --git a/tools/tex-fmt/plugin.json b/tools/tex-fmt/plugin.json index 34417bfd..595916a1 100644 --- a/tools/tex-fmt/plugin.json +++ b/tools/tex-fmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "An extremely fast LaTeX formatter written in Rust", diff --git a/tools/tlint/plugin.json b/tools/tlint/plugin.json index 842d68ac..023d5cbf 100644 --- a/tools/tlint/plugin.json +++ b/tools/tlint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "format": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] } }, "description": "Tighten linter for Laravel conventions", diff --git a/tools/tofu/plugin.json b/tools/tofu/plugin.json index e06bc3d2..4e338741 100644 --- a/tools/tofu/plugin.json +++ b/tools/tofu/plugin.json @@ -5,7 +5,6 @@ "commands": { "fmt": { "arguments": ["fmt", "-write=true", "$PATH"], - "ignore_output": false, "tests": [ { "language": "terraform", diff --git a/tools/toml-sort/plugin.json b/tools/toml-sort/plugin.json index e9e40cb0..561f1182 100644 --- a/tools/toml-sort/plugin.json +++ b/tools/toml-sort/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-i", "$PATH"], - "ignore_output": false + "arguments": ["-i", "$PATH"] } }, "description": "A command line utility to sort and format toml files", diff --git a/tools/topiary/plugin.json b/tools/topiary/plugin.json index 892530be..770396ff 100644 --- a/tools/topiary/plugin.json +++ b/tools/topiary/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "json", diff --git a/tools/ts-standard/plugin.json b/tools/ts-standard/plugin.json index 402bf335..66383c0e 100644 --- a/tools/ts-standard/plugin.json +++ b/tools/ts-standard/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "Typescript style guide, linter, and formatter using StandardJS", diff --git a/tools/tsqllint/plugin.json b/tools/tsqllint/plugin.json index 8c2630a3..447e163d 100644 --- a/tools/tsqllint/plugin.json +++ b/tools/tsqllint/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "Configurable linting for TSQL", diff --git a/tools/twig-cs-fixer/plugin.json b/tools/twig-cs-fixer/plugin.json index a80b0402..d69ac516 100644 --- a/tools/twig-cs-fixer/plugin.json +++ b/tools/twig-cs-fixer/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter", "linter"], "commands": { "lint": { - "arguments": ["lint", "$PATH", "--fix", "--no-interaction", "--quiet"], - "ignore_output": false + "arguments": ["lint", "$PATH", "--fix", "--no-interaction", "--quiet"] } }, "description": "A tool to automatically fix Twig Coding Standards issues", diff --git a/tools/typos/plugin.json b/tools/typos/plugin.json index 35ee99ee..cf729957 100644 --- a/tools/typos/plugin.json +++ b/tools/typos/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "--no-ignore", "--hidden", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/typstfmt/plugin.json b/tools/typstfmt/plugin.json index 27adaea5..d9b389a1 100644 --- a/tools/typstfmt/plugin.json +++ b/tools/typstfmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Basic formatter for the Typst language", diff --git a/tools/typstyle/plugin.json b/tools/typstyle/plugin.json index 7720ba29..44dde8f5 100644 --- a/tools/typstyle/plugin.json +++ b/tools/typstyle/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-i", "$PATH"], - "ignore_output": false + "arguments": ["-i", "$PATH"] } }, "description": "Beautiful and reliable typst code formatter", diff --git a/tools/ufmt/plugin.json b/tools/ufmt/plugin.json index 1c0d900f..042782c9 100644 --- a/tools/ufmt/plugin.json +++ b/tools/ufmt/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["format", "$PATH"], - "ignore_output": false + "arguments": ["format", "$PATH"] } }, "description": "Safe, atomic formatting with black and usort", diff --git a/tools/uiua/plugin.json b/tools/uiua/plugin.json index 15bb80ba..1c9f1119 100644 --- a/tools/uiua/plugin.json +++ b/tools/uiua/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "A stack-based array programming language", diff --git a/tools/unimport/plugin.json b/tools/unimport/plugin.json index 26937da8..7b6e9582 100644 --- a/tools/unimport/plugin.json +++ b/tools/unimport/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-r", "$PATH"], - "ignore_output": false + "arguments": ["-r", "$PATH"] } }, "description": "The ultimate linter and formatter for removing unused import statements in your code", diff --git a/tools/usort/plugin.json b/tools/usort/plugin.json index eb9127c6..1410ba41 100644 --- a/tools/usort/plugin.json +++ b/tools/usort/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["format", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/v/plugin.json b/tools/v/plugin.json index c3dc5f7d..261a51dc 100644 --- a/tools/v/plugin.json +++ b/tools/v/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "-w", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "-w", "$PATH"] } }, "description": "Tooling for V lang", diff --git a/tools/vacuum/plugin.json b/tools/vacuum/plugin.json index 961663ea..bd3bd912 100644 --- a/tools/vacuum/plugin.json +++ b/tools/vacuum/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "lint": { - "arguments": ["lint", "$PATH"], - "ignore_output": false + "arguments": ["lint", "$PATH"] } }, "description": "vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool", diff --git a/tools/veryl/plugin.json b/tools/veryl/plugin.json index 29f02deb..5f8a61b4 100644 --- a/tools/veryl/plugin.json +++ b/tools/veryl/plugin.json @@ -5,7 +5,6 @@ "commands": { "fmt": { "arguments": ["fmt", "$PATH"], - "ignore_output": false, "tests": [ { "language": "veryl", diff --git a/tools/vhdl-style-guide/plugin.json b/tools/vhdl-style-guide/plugin.json index 090cb436..67b214da 100644 --- a/tools/vhdl-style-guide/plugin.json +++ b/tools/vhdl-style-guide/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["-f", "$PATH", "--fix"], - "ignore_output": false + "arguments": ["-f", "$PATH", "--fix"] } }, "description": "Style guide enforcement for VHDL", diff --git a/tools/wa/plugin.json b/tools/wa/plugin.json index 5bebb8d9..343ca7ac 100644 --- a/tools/wa/plugin.json +++ b/tools/wa/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Formatter for the wa programming language", diff --git a/tools/wfindent/plugin.json b/tools/wfindent/plugin.json index 2467f431..7c10161b 100644 --- a/tools/wfindent/plugin.json +++ b/tools/wfindent/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "": { - "arguments": ["$PATH"], - "ignore_output": false + "arguments": ["$PATH"] } }, "description": "Indents and optionally converts Fortran program sources", diff --git a/tools/xmlformat/plugin.json b/tools/xmlformat/plugin.json index 766ebf87..70f38ce3 100644 --- a/tools/xmlformat/plugin.json +++ b/tools/xmlformat/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--overwrite", "$PATH"], - "ignore_output": false, "tests": [ { "language": "xml", diff --git a/tools/xmllint/plugin.json b/tools/xmllint/plugin.json index 8c558a15..73691980 100644 --- a/tools/xmllint/plugin.json +++ b/tools/xmllint/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--format", "$PATH", "--output", "$PATH"], - "ignore_output": false, "tests": [ { "language": "xml", diff --git a/tools/xo/plugin.json b/tools/xo/plugin.json index 15546d13..4e6e0db2 100644 --- a/tools/xo/plugin.json +++ b/tools/xo/plugin.json @@ -4,8 +4,7 @@ "categories": ["linter"], "commands": { "": { - "arguments": ["--fix", "$PATH"], - "ignore_output": false + "arguments": ["--fix", "$PATH"] } }, "description": "JavaScript/TypeScript linter (ESLint wrapper) with great defaults", diff --git a/tools/yamlfix/plugin.json b/tools/yamlfix/plugin.json index a8dd783f..403365c5 100644 --- a/tools/yamlfix/plugin.json +++ b/tools/yamlfix/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["$PATH"], - "ignore_output": false, "tests": [ { "language": "yaml", diff --git a/tools/yamlfmt/plugin.json b/tools/yamlfmt/plugin.json index e195d980..9d434ad6 100644 --- a/tools/yamlfmt/plugin.json +++ b/tools/yamlfmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "yaml", diff --git a/tools/yapf/plugin.json b/tools/yapf/plugin.json index 8415d3e2..eedd3e14 100644 --- a/tools/yapf/plugin.json +++ b/tools/yapf/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--in-place", "$PATH"], - "ignore_output": false, "tests": [ { "language": "python", diff --git a/tools/yew-fmt/plugin.json b/tools/yew-fmt/plugin.json index f419a7b5..b95ceff3 100644 --- a/tools/yew-fmt/plugin.json +++ b/tools/yew-fmt/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["--edition", "2021", "--quiet", "$PATH"], - "ignore_output": false, "tests": [ { "language": "rust", diff --git a/tools/zig/plugin.json b/tools/zig/plugin.json index 97d559f8..55052cab 100644 --- a/tools/zig/plugin.json +++ b/tools/zig/plugin.json @@ -5,7 +5,6 @@ "commands": { "fmt": { "arguments": ["fmt", "$PATH"], - "ignore_output": false, "tests": [ { "language": "zig", diff --git a/tools/ziggy/plugin.json b/tools/ziggy/plugin.json index 221102a1..a38a3dda 100644 --- a/tools/ziggy/plugin.json +++ b/tools/ziggy/plugin.json @@ -4,8 +4,7 @@ "categories": ["formatter"], "commands": { "fmt": { - "arguments": ["fmt", "$PATH"], - "ignore_output": false + "arguments": ["fmt", "$PATH"] } }, "description": "Formats Ziggy documents and Ziggy schemas", diff --git a/tools/zprint/plugin.json b/tools/zprint/plugin.json index 436c924c..b20512f3 100644 --- a/tools/zprint/plugin.json +++ b/tools/zprint/plugin.json @@ -5,7 +5,6 @@ "commands": { "": { "arguments": ["-w", "$PATH"], - "ignore_output": false, "tests": [ { "language": "clojure", From 293b39438c2222eca02c7b450ccf60cad848d499 Mon Sep 17 00:00:00 2001 From: Mads Hougesen Date: Mon, 27 Jan 2025 22:54:19 +0100 Subject: [PATCH 3/5] refactor: moved the different command binaries to a shared array --- codegen/src/tools.rs | 26 +++++++++++++--------- mdsf/src/tools/actionlint.rs | 20 ++++++++++------- mdsf/src/tools/alejandra.rs | 20 ++++++++++------- mdsf/src/tools/ameba.rs | 20 ++++++++++------- mdsf/src/tools/ansible_lint.rs | 20 ++++++++++------- mdsf/src/tools/asmfmt.rs | 20 ++++++++++------- mdsf/src/tools/astyle.rs | 20 ++++++++++------- mdsf/src/tools/auto_optional.rs | 20 ++++++++++------- mdsf/src/tools/autocorrect.rs | 20 ++++++++++------- mdsf/src/tools/autoflake.rs | 20 ++++++++++------- mdsf/src/tools/autopep_8.rs | 20 ++++++++++------- mdsf/src/tools/beancount_black.rs | 20 ++++++++++------- mdsf/src/tools/beautysh.rs | 20 ++++++++++------- mdsf/src/tools/bibtex_tidy.rs | 28 ++++++++++++++---------- mdsf/src/tools/bicep_format.rs | 20 ++++++++++------- mdsf/src/tools/biome_check.rs | 28 ++++++++++++++---------- mdsf/src/tools/biome_format.rs | 28 ++++++++++++++---------- mdsf/src/tools/biome_lint.rs | 28 ++++++++++++++---------- mdsf/src/tools/black.rs | 20 ++++++++++------- mdsf/src/tools/blade_formatter.rs | 28 ++++++++++++++---------- mdsf/src/tools/blue.rs | 20 ++++++++++------- mdsf/src/tools/bpfmt.rs | 20 ++++++++++------- mdsf/src/tools/brittany.rs | 20 ++++++++++------- mdsf/src/tools/brunette.rs | 20 ++++++++++------- mdsf/src/tools/bsfmt.rs | 28 ++++++++++++++---------- mdsf/src/tools/bslint.rs | 28 ++++++++++++++---------- mdsf/src/tools/buf_format.rs | 28 ++++++++++++++---------- mdsf/src/tools/buildifier.rs | 20 ++++++++++------- mdsf/src/tools/cabal_fmt.rs | 20 ++++++++++------- mdsf/src/tools/cabal_format.rs | 20 ++++++++++------- mdsf/src/tools/cabal_prettify.rs | 20 ++++++++++------- mdsf/src/tools/caddy_fmt.rs | 20 ++++++++++------- mdsf/src/tools/caramel_fmt.rs | 20 ++++++++++------- mdsf/src/tools/clang_format.rs | 20 ++++++++++------- mdsf/src/tools/clang_tidy.rs | 20 ++++++++++------- mdsf/src/tools/cljfmt_fix.rs | 20 ++++++++++------- mdsf/src/tools/cljstyle.rs | 20 ++++++++++------- mdsf/src/tools/cmake_format.rs | 20 ++++++++++------- mdsf/src/tools/codespell.rs | 20 ++++++++++------- mdsf/src/tools/crlfmt.rs | 20 ++++++++++------- mdsf/src/tools/crystal_format.rs | 20 ++++++++++------- mdsf/src/tools/csharpier.rs | 20 ++++++++++------- mdsf/src/tools/css_beautify.rs | 28 ++++++++++++++---------- mdsf/src/tools/csscomb.rs | 28 ++++++++++++++---------- mdsf/src/tools/csslint.rs | 28 ++++++++++++++---------- mdsf/src/tools/curlylint.rs | 20 ++++++++++------- mdsf/src/tools/d_2_fmt.rs | 20 ++++++++++------- mdsf/src/tools/dart_fix.rs | 20 ++++++++++------- mdsf/src/tools/dart_format.rs | 20 ++++++++++------- mdsf/src/tools/dcm_fix.rs | 20 ++++++++++------- mdsf/src/tools/dcm_format.rs | 20 ++++++++++------- mdsf/src/tools/deadnix.rs | 20 ++++++++++------- mdsf/src/tools/deno_fmt.rs | 20 ++++++++++------- mdsf/src/tools/deno_lint.rs | 20 ++++++++++------- mdsf/src/tools/dfmt.rs | 20 ++++++++++------- mdsf/src/tools/dhall.rs | 20 ++++++++++------- mdsf/src/tools/djade.rs | 20 ++++++++++------- mdsf/src/tools/djlint.rs | 20 ++++++++++------- mdsf/src/tools/docformatter.rs | 20 ++++++++++------- mdsf/src/tools/dockfmt.rs | 20 ++++++++++------- mdsf/src/tools/docstrfmt.rs | 20 ++++++++++------- mdsf/src/tools/doctoc.rs | 28 ++++++++++++++---------- mdsf/src/tools/dotenv_linter_fix.rs | 20 ++++++++++------- mdsf/src/tools/dprint_fmt.rs | 28 ++++++++++++++---------- mdsf/src/tools/easy_coding_standard.rs | 20 ++++++++++------- mdsf/src/tools/efmt.rs | 20 ++++++++++------- mdsf/src/tools/elm_format.rs | 28 ++++++++++++++---------- mdsf/src/tools/erb_formatter.rs | 20 ++++++++++------- mdsf/src/tools/erlfmt.rs | 20 ++++++++++------- mdsf/src/tools/eslint.rs | 28 ++++++++++++++---------- mdsf/src/tools/fantomas.rs | 20 ++++++++++------- mdsf/src/tools/fish_indent.rs | 20 ++++++++++------- mdsf/src/tools/fixjson.rs | 28 ++++++++++++++---------- mdsf/src/tools/floskell.rs | 20 ++++++++++------- mdsf/src/tools/fnlfmt.rs | 20 ++++++++++------- mdsf/src/tools/forge_fmt.rs | 20 ++++++++++------- mdsf/src/tools/fourmolu.rs | 20 ++++++++++------- mdsf/src/tools/fprettify.rs | 20 ++++++++++------- mdsf/src/tools/futhark_fmt.rs | 20 ++++++++++------- mdsf/src/tools/gci.rs | 20 ++++++++++------- mdsf/src/tools/gdformat.rs | 20 ++++++++++------- mdsf/src/tools/gersemi.rs | 20 ++++++++++------- mdsf/src/tools/gleam_format.rs | 20 ++++++++++------- mdsf/src/tools/gluon_fmt.rs | 20 ++++++++++------- mdsf/src/tools/gofmt.rs | 20 ++++++++++------- mdsf/src/tools/gofumpt.rs | 20 ++++++++++------- mdsf/src/tools/goimports.rs | 20 ++++++++++------- mdsf/src/tools/goimports_reviser.rs | 20 ++++++++++------- mdsf/src/tools/golines.rs | 20 ++++++++++------- mdsf/src/tools/google_java_format.rs | 20 ++++++++++------- mdsf/src/tools/grain_format.rs | 20 ++++++++++------- mdsf/src/tools/hadolint.rs | 20 ++++++++++------- mdsf/src/tools/haml_lint.rs | 20 ++++++++++------- mdsf/src/tools/hclfmt.rs | 20 ++++++++++------- mdsf/src/tools/hfmt.rs | 20 ++++++++++------- mdsf/src/tools/hindent.rs | 20 ++++++++++------- mdsf/src/tools/hlint.rs | 20 ++++++++++------- mdsf/src/tools/html_beautify.rs | 28 ++++++++++++++---------- mdsf/src/tools/htmlbeautifier.rs | 20 ++++++++++------- mdsf/src/tools/htmlhint.rs | 28 ++++++++++++++---------- mdsf/src/tools/imba_fmt.rs | 28 ++++++++++++++---------- mdsf/src/tools/inko_fmt.rs | 20 ++++++++++------- mdsf/src/tools/isort.rs | 20 ++++++++++------- mdsf/src/tools/joker.rs | 20 ++++++++++------- mdsf/src/tools/js_beautify.rs | 28 ++++++++++++++---------- mdsf/src/tools/json_5_format.rs | 20 ++++++++++------- mdsf/src/tools/jsona_format.rs | 20 ++++++++++------- mdsf/src/tools/jsona_lint.rs | 20 ++++++++++------- mdsf/src/tools/jsonlint.rs | 28 ++++++++++++++---------- mdsf/src/tools/jsonnet_lint.rs | 20 ++++++++++------- mdsf/src/tools/jsonnetfmt.rs | 20 ++++++++++------- mdsf/src/tools/juliaformatter_jl.rs | 20 ++++++++++------- mdsf/src/tools/just.rs | 28 ++++++++++++++---------- mdsf/src/tools/kcl_fmt.rs | 20 ++++++++++------- mdsf/src/tools/kcl_lint.rs | 20 ++++++++++------- mdsf/src/tools/kdlfmt.rs | 20 ++++++++++------- mdsf/src/tools/kdoc_formatter.rs | 20 ++++++++++------- mdsf/src/tools/ktfmt.rs | 20 ++++++++++------- mdsf/src/tools/ktlint.rs | 20 ++++++++++------- mdsf/src/tools/kulala_fmt.rs | 20 ++++++++++------- mdsf/src/tools/leptosfmt.rs | 20 ++++++++++------- mdsf/src/tools/liquidsoap_prettier.rs | 28 ++++++++++++++---------- mdsf/src/tools/luacheck.rs | 20 ++++++++++------- mdsf/src/tools/luaformatter.rs | 20 ++++++++++------- mdsf/src/tools/mado_check.rs | 20 ++++++++++------- mdsf/src/tools/markdownfmt.rs | 20 ++++++++++------- mdsf/src/tools/markdownlint.rs | 28 ++++++++++++++---------- mdsf/src/tools/markdownlint_cli_2.rs | 28 ++++++++++++++---------- mdsf/src/tools/markuplint.rs | 28 ++++++++++++++---------- mdsf/src/tools/mdformat.rs | 20 ++++++++++------- mdsf/src/tools/mdslw.rs | 20 ++++++++++------- mdsf/src/tools/meson_fmt.rs | 20 ++++++++++------- mdsf/src/tools/misspell.rs | 20 ++++++++++------- mdsf/src/tools/mix_format.rs | 20 ++++++++++------- mdsf/src/tools/mojo_format.rs | 20 ++++++++++------- mdsf/src/tools/mypy.rs | 20 ++++++++++------- mdsf/src/tools/nginxbeautifier.rs | 28 ++++++++++++++---------- mdsf/src/tools/nginxfmt.rs | 20 ++++++++++------- mdsf/src/tools/nickel_format.rs | 20 ++++++++++------- mdsf/src/tools/nimpretty.rs | 20 ++++++++++------- mdsf/src/tools/nixfmt.rs | 20 ++++++++++------- mdsf/src/tools/nixpkgs_fmt.rs | 20 ++++++++++------- mdsf/src/tools/nomad_fmt.rs | 20 ++++++++++------- mdsf/src/tools/nph.rs | 20 ++++++++++------- mdsf/src/tools/npm_groovy_lint.rs | 28 ++++++++++++++---------- mdsf/src/tools/nufmt.rs | 20 ++++++++++------- mdsf/src/tools/ocamlformat.rs | 20 ++++++++++------- mdsf/src/tools/ocp_indent.rs | 20 ++++++++++------- mdsf/src/tools/odinfmt.rs | 20 ++++++++++------- mdsf/src/tools/oelint_adv.rs | 20 ++++++++++------- mdsf/src/tools/opa_fmt.rs | 20 ++++++++++------- mdsf/src/tools/ormolu.rs | 20 ++++++++++------- mdsf/src/tools/oxlint.rs | 28 ++++++++++++++---------- mdsf/src/tools/packer_fix.rs | 20 ++++++++++------- mdsf/src/tools/packer_fmt.rs | 20 ++++++++++------- mdsf/src/tools/perltidy.rs | 20 ++++++++++------- mdsf/src/tools/pg_format.rs | 20 ++++++++++------- mdsf/src/tools/php_cs_fixer_fix.rs | 26 ++++++++++++---------- mdsf/src/tools/phpcbf.rs | 26 ++++++++++++---------- mdsf/src/tools/phpinsights_fix.rs | 26 ++++++++++++---------- mdsf/src/tools/pint.rs | 20 ++++++++++------- mdsf/src/tools/prettier.rs | 28 ++++++++++++++---------- mdsf/src/tools/pretty_php.rs | 26 ++++++++++++---------- mdsf/src/tools/prettypst.rs | 20 ++++++++++------- mdsf/src/tools/prisma_format.rs | 28 ++++++++++++++---------- mdsf/src/tools/protolint.rs | 20 ++++++++++------- mdsf/src/tools/ptop.rs | 20 ++++++++++------- mdsf/src/tools/puppet_lint.rs | 20 ++++++++++------- mdsf/src/tools/purs_tidy.rs | 28 ++++++++++++++---------- mdsf/src/tools/purty.rs | 28 ++++++++++++++---------- mdsf/src/tools/pycln.rs | 20 ++++++++++------- mdsf/src/tools/pycodestyle.rs | 20 ++++++++++------- mdsf/src/tools/pyink.rs | 20 ++++++++++------- mdsf/src/tools/pyment.rs | 20 ++++++++++------- mdsf/src/tools/qmlfmt.rs | 20 ++++++++++------- mdsf/src/tools/quick_lint_js.rs | 28 ++++++++++++++---------- mdsf/src/tools/raco_fmt.rs | 20 ++++++++++------- mdsf/src/tools/refmt.rs | 20 ++++++++++------- mdsf/src/tools/reformat_gherkin.rs | 20 ++++++++++------- mdsf/src/tools/regal_fix.rs | 20 ++++++++++------- mdsf/src/tools/regal_lint.rs | 20 ++++++++++------- mdsf/src/tools/reorder_python_imports.rs | 20 ++++++++++------- mdsf/src/tools/rescript_format.rs | 28 ++++++++++++++---------- mdsf/src/tools/roc_format.rs | 20 ++++++++++------- mdsf/src/tools/rstfmt.rs | 20 ++++++++++------- mdsf/src/tools/rubocop.rs | 20 ++++++++++------- mdsf/src/tools/rubyfmt.rs | 20 ++++++++++------- mdsf/src/tools/ruff_check.rs | 20 ++++++++++------- mdsf/src/tools/ruff_format.rs | 20 ++++++++++------- mdsf/src/tools/rufo.rs | 20 ++++++++++------- mdsf/src/tools/rune_fmt.rs | 20 ++++++++++------- mdsf/src/tools/rustfmt.rs | 20 ++++++++++------- mdsf/src/tools/rustywind.rs | 20 ++++++++++------- mdsf/src/tools/salt_lint.rs | 20 ++++++++++------- mdsf/src/tools/scalafmt.rs | 20 ++++++++++------- mdsf/src/tools/scalariform.rs | 20 ++++++++++------- mdsf/src/tools/selene.rs | 20 ++++++++++------- mdsf/src/tools/shellcheck.rs | 20 ++++++++++------- mdsf/src/tools/shellharden.rs | 20 ++++++++++------- mdsf/src/tools/shfmt.rs | 20 ++++++++++------- mdsf/src/tools/sleek.rs | 20 ++++++++++------- mdsf/src/tools/smlfmt.rs | 20 ++++++++++------- mdsf/src/tools/snakefmt.rs | 20 ++++++++++------- mdsf/src/tools/solhint.rs | 28 ++++++++++++++---------- mdsf/src/tools/sql_formatter.rs | 28 ++++++++++++++---------- mdsf/src/tools/sqlfluff_fix.rs | 20 ++++++++++------- mdsf/src/tools/sqlfluff_format.rs | 20 ++++++++++------- mdsf/src/tools/sqlfmt.rs | 20 ++++++++++------- mdsf/src/tools/sqruff.rs | 20 ++++++++++------- mdsf/src/tools/standardjs.rs | 28 ++++++++++++++---------- mdsf/src/tools/standardrb.rs | 20 ++++++++++------- mdsf/src/tools/statix_check.rs | 20 ++++++++++------- mdsf/src/tools/statix_fix.rs | 20 ++++++++++------- mdsf/src/tools/stylefmt.rs | 28 ++++++++++++++---------- mdsf/src/tools/stylelint.rs | 28 ++++++++++++++---------- mdsf/src/tools/stylish_haskell.rs | 20 ++++++++++------- mdsf/src/tools/stylua.rs | 28 ++++++++++++++---------- mdsf/src/tools/superhtml_fmt.rs | 20 ++++++++++------- mdsf/src/tools/swift_format.rs | 20 ++++++++++------- mdsf/src/tools/swiftformat.rs | 20 ++++++++++------- mdsf/src/tools/taplo.rs | 28 ++++++++++++++---------- mdsf/src/tools/templ_fmt.rs | 20 ++++++++++------- mdsf/src/tools/terraform_fmt.rs | 20 ++++++++++------- mdsf/src/tools/terragrunt_hclfmt.rs | 20 ++++++++++------- mdsf/src/tools/tex_fmt.rs | 20 ++++++++++------- mdsf/src/tools/tlint_format.rs | 26 ++++++++++++---------- mdsf/src/tools/tofu_fmt.rs | 20 ++++++++++------- mdsf/src/tools/toml_sort.rs | 20 ++++++++++------- mdsf/src/tools/topiary.rs | 20 ++++++++++------- mdsf/src/tools/ts_standard.rs | 28 ++++++++++++++---------- mdsf/src/tools/tsqllint.rs | 28 ++++++++++++++---------- mdsf/src/tools/twig_cs_fixer_lint.rs | 26 ++++++++++++---------- mdsf/src/tools/typos.rs | 20 ++++++++++------- mdsf/src/tools/typstfmt.rs | 20 ++++++++++------- mdsf/src/tools/typstyle.rs | 20 ++++++++++------- mdsf/src/tools/ufmt.rs | 20 ++++++++++------- mdsf/src/tools/uiua_fmt.rs | 20 ++++++++++------- mdsf/src/tools/unimport.rs | 20 ++++++++++------- mdsf/src/tools/usort.rs | 20 ++++++++++------- mdsf/src/tools/v_fmt.rs | 20 ++++++++++------- mdsf/src/tools/vacuum_lint.rs | 28 ++++++++++++++---------- mdsf/src/tools/veryl_fmt.rs | 20 ++++++++++------- mdsf/src/tools/vhdl_style_guide.rs | 20 ++++++++++------- mdsf/src/tools/wa_fmt.rs | 20 ++++++++++------- mdsf/src/tools/wfindent.rs | 20 ++++++++++------- mdsf/src/tools/xmlformat.rs | 20 ++++++++++------- mdsf/src/tools/xmllint.rs | 20 ++++++++++------- mdsf/src/tools/xo.rs | 28 ++++++++++++++---------- mdsf/src/tools/yamlfix.rs | 20 ++++++++++------- mdsf/src/tools/yamlfmt.rs | 20 ++++++++++------- mdsf/src/tools/yapf.rs | 20 ++++++++++------- mdsf/src/tools/yew_fmt.rs | 20 ++++++++++------- mdsf/src/tools/zig_fmt.rs | 20 ++++++++++------- mdsf/src/tools/ziggy_fmt.rs | 20 ++++++++++------- mdsf/src/tools/zprint.rs | 20 ++++++++++------- 255 files changed, 3266 insertions(+), 2244 deletions(-) diff --git a/codegen/src/tools.rs b/codegen/src/tools.rs index ac8d67c1..ed5abf72 100644 --- a/codegen/src/tools.rs +++ b/codegen/src/tools.rs @@ -220,8 +220,8 @@ impl Tool { // TODO: generate if statements instead of array let command_arr = if command_types.len() > 1 { format!( - "\n{INDENT}{INDENT}{},\n{INDENT}", - command_types.join(format!(",\n{INDENT}{INDENT}").as_str()) + "\n{INDENT}{},\n", + command_types.join(format!(",\n{INDENT}").as_str()) ) } else { command_types.join(", ") @@ -274,23 +274,29 @@ impl Tool { format!("\n{}\n", tests.join("\n\n")) }; + let command_type_count = command_types.len(); + let code = format!( "{GENERATED_FILE_COMMENT} -use std::process::Command; - -use crate::{{error::MdsfError, runners::CommandType}}; +use crate::runners::CommandType; #[inline] -fn {set_args_fn_name}(mut cmd: Command, file_path: &std::path::Path) -> Command {{ +fn {set_args_fn_name}( +{INDENT}mut cmd: std::process::Command, +{INDENT}file_path: &std::path::Path, +) -> std::process::Command {{ {string_args} {INDENT}cmd }} -#[inline] -pub fn {run_fn_name}(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> {{ -{INDENT}let commands = [{command_arr}]; +const COMMANDS: [CommandType; {command_type_count}] = [{command_arr}]; -{INDENT}crate::execution::run_tools(&commands, file_path, timeout, {set_args_fn_name}) +#[inline] +pub fn {run_fn_name}( +{INDENT}file_path: &std::path::Path, +{INDENT}timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> {{ +{INDENT}crate::execution::run_tools(&COMMANDS, file_path, timeout, {set_args_fn_name}) }} #[cfg(test)] diff --git a/mdsf/src/tools/actionlint.rs b/mdsf/src/tools/actionlint.rs index 7bc73916..6b986d45 100644 --- a/mdsf/src/tools/actionlint.rs +++ b/mdsf/src/tools/actionlint.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_actionlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_actionlint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("actionlint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("actionlint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_actionlint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_actionlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/alejandra.rs b/mdsf/src/tools/alejandra.rs index 1b3f8b3b..ae9c3c16 100644 --- a/mdsf/src/tools/alejandra.rs +++ b/mdsf/src/tools/alejandra.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_alejandra_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_alejandra_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("alejandra")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("alejandra")]; - crate::execution::run_tools(&commands, file_path, timeout, set_alejandra_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_alejandra_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ameba.rs b/mdsf/src/tools/ameba.rs index af180173..b7d40502 100644 --- a/mdsf/src/tools/ameba.rs +++ b/mdsf/src/tools/ameba.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ameba_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ameba_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ameba")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ameba")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ameba_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ameba_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ansible_lint.rs b/mdsf/src/tools/ansible_lint.rs index 925b8299..5c30820f 100644 --- a/mdsf/src/tools/ansible_lint.rs +++ b/mdsf/src/tools/ansible_lint.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ansible_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ansible_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ansible-lint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ansible-lint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ansible_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ansible_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/asmfmt.rs b/mdsf/src/tools/asmfmt.rs index edc36fca..2ebeeef3 100644 --- a/mdsf/src/tools/asmfmt.rs +++ b/mdsf/src/tools/asmfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_asmfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_asmfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("asmfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("asmfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_asmfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_asmfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/astyle.rs b/mdsf/src/tools/astyle.rs index 6d107c5f..b6563ad9 100644 --- a/mdsf/src/tools/astyle.rs +++ b/mdsf/src/tools/astyle.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_astyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_astyle_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("astyle")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("astyle")]; - crate::execution::run_tools(&commands, file_path, timeout, set_astyle_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_astyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/auto_optional.rs b/mdsf/src/tools/auto_optional.rs index ed9372bf..fa6cdfe9 100644 --- a/mdsf/src/tools/auto_optional.rs +++ b/mdsf/src/tools/auto_optional.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_auto_optional_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_auto_optional_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("auto-optional")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("auto-optional")]; - crate::execution::run_tools(&commands, file_path, timeout, set_auto_optional_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_auto_optional_args) } #[cfg(test)] diff --git a/mdsf/src/tools/autocorrect.rs b/mdsf/src/tools/autocorrect.rs index ae2cf106..281fc6d8 100644 --- a/mdsf/src/tools/autocorrect.rs +++ b/mdsf/src/tools/autocorrect.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_autocorrect_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_autocorrect_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("autocorrect")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("autocorrect")]; - crate::execution::run_tools(&commands, file_path, timeout, set_autocorrect_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_autocorrect_args) } #[cfg(test)] diff --git a/mdsf/src/tools/autoflake.rs b/mdsf/src/tools/autoflake.rs index a14cb8ab..8270bd87 100644 --- a/mdsf/src/tools/autoflake.rs +++ b/mdsf/src/tools/autoflake.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_autoflake_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_autoflake_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg("--in-place"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("autoflake")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("autoflake")]; - crate::execution::run_tools(&commands, file_path, timeout, set_autoflake_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_autoflake_args) } #[cfg(test)] diff --git a/mdsf/src/tools/autopep_8.rs b/mdsf/src/tools/autopep_8.rs index 684c6930..5717d691 100644 --- a/mdsf/src/tools/autopep_8.rs +++ b/mdsf/src/tools/autopep_8.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_autopep_8_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_autopep_8_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--in-place"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("autopep8")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("autopep8")]; - crate::execution::run_tools(&commands, file_path, timeout, set_autopep_8_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_autopep_8_args) } #[cfg(test)] diff --git a/mdsf/src/tools/beancount_black.rs b/mdsf/src/tools/beancount_black.rs index 4bb3c691..b58bf7cc 100644 --- a/mdsf/src/tools/beancount_black.rs +++ b/mdsf/src/tools/beancount_black.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_beancount_black_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_beancount_black_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("bean-black")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("bean-black")]; - crate::execution::run_tools(&commands, file_path, timeout, set_beancount_black_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_beancount_black_args) } #[cfg(test)] diff --git a/mdsf/src/tools/beautysh.rs b/mdsf/src/tools/beautysh.rs index 55212607..a24fd0cc 100644 --- a/mdsf/src/tools/beautysh.rs +++ b/mdsf/src/tools/beautysh.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_beautysh_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_beautysh_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("beautysh")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("beautysh")]; - crate::execution::run_tools(&commands, file_path, timeout, set_beautysh_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_beautysh_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bibtex_tidy.rs b/mdsf/src/tools/bibtex_tidy.rs index 20345efb..cbd6db8c 100644 --- a/mdsf/src/tools/bibtex_tidy.rs +++ b/mdsf/src/tools/bibtex_tidy.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_bibtex_tidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_bibtex_tidy_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-m"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("bibtex-tidy"), - CommandType::Direct("bibtex-tidy"), - CommandType::Npm("bibtex-tidy"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("bibtex-tidy"), + CommandType::Direct("bibtex-tidy"), + CommandType::Npm("bibtex-tidy"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_bibtex_tidy_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bibtex_tidy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bicep_format.rs b/mdsf/src/tools/bicep_format.rs index a08bd23e..c315b292 100644 --- a/mdsf/src/tools/bicep_format.rs +++ b/mdsf/src/tools/bicep_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_bicep_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_bicep_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("bicep")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("bicep")]; - crate::execution::run_tools(&commands, file_path, timeout, set_bicep_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bicep_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/biome_check.rs b/mdsf/src/tools/biome_check.rs index 7ce50ca4..f253ac5b 100644 --- a/mdsf/src/tools/biome_check.rs +++ b/mdsf/src/tools/biome_check.rs @@ -1,27 +1,31 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_biome_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_biome_check_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("check"); cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("biome"), - CommandType::Direct("biome"), - CommandType::Npm("@biomejs/biome"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("biome"), + CommandType::Direct("biome"), + CommandType::Npm("@biomejs/biome"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_biome_check_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_biome_check_args) } #[cfg(test)] diff --git a/mdsf/src/tools/biome_format.rs b/mdsf/src/tools/biome_format.rs index c2da2fa3..462c8559 100644 --- a/mdsf/src/tools/biome_format.rs +++ b/mdsf/src/tools/biome_format.rs @@ -1,27 +1,31 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_biome_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_biome_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("biome"), - CommandType::Direct("biome"), - CommandType::Npm("@biomejs/biome"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("biome"), + CommandType::Direct("biome"), + CommandType::Npm("@biomejs/biome"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_biome_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_biome_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/biome_lint.rs b/mdsf/src/tools/biome_lint.rs index 019b01a4..09e66197 100644 --- a/mdsf/src/tools/biome_lint.rs +++ b/mdsf/src/tools/biome_lint.rs @@ -1,27 +1,31 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_biome_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_biome_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("biome"), - CommandType::Direct("biome"), - CommandType::Npm("@biomejs/biome"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("biome"), + CommandType::Direct("biome"), + CommandType::Npm("@biomejs/biome"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_biome_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_biome_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/black.rs b/mdsf/src/tools/black.rs index c4e07eca..159dd2e2 100644 --- a/mdsf/src/tools/black.rs +++ b/mdsf/src/tools/black.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_black_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_black_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("black")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("black")]; - crate::execution::run_tools(&commands, file_path, timeout, set_black_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_black_args) } #[cfg(test)] diff --git a/mdsf/src/tools/blade_formatter.rs b/mdsf/src/tools/blade_formatter.rs index 186746c3..54fdb8af 100644 --- a/mdsf/src/tools/blade_formatter.rs +++ b/mdsf/src/tools/blade_formatter.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_blade_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_blade_formatter_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("blade-formatter"), - CommandType::Direct("blade-formatter"), - CommandType::Npm("blade-formatter"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("blade-formatter"), + CommandType::Direct("blade-formatter"), + CommandType::Npm("blade-formatter"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_blade_formatter_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_blade_formatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/blue.rs b/mdsf/src/tools/blue.rs index a2b9453c..ac08feb5 100644 --- a/mdsf/src/tools/blue.rs +++ b/mdsf/src/tools/blue.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_blue_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_blue_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("blue")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("blue")]; - crate::execution::run_tools(&commands, file_path, timeout, set_blue_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_blue_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bpfmt.rs b/mdsf/src/tools/bpfmt.rs index 11bc5d51..f465a850 100644 --- a/mdsf/src/tools/bpfmt.rs +++ b/mdsf/src/tools/bpfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_bpfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_bpfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("bpfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("bpfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_bpfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bpfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/brittany.rs b/mdsf/src/tools/brittany.rs index e22f9abe..9b471ca2 100644 --- a/mdsf/src/tools/brittany.rs +++ b/mdsf/src/tools/brittany.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_brittany_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_brittany_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--write-mode=inplace"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("brittany")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("brittany")]; - crate::execution::run_tools(&commands, file_path, timeout, set_brittany_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_brittany_args) } #[cfg(test)] diff --git a/mdsf/src/tools/brunette.rs b/mdsf/src/tools/brunette.rs index e6051e51..8c8c5bd9 100644 --- a/mdsf/src/tools/brunette.rs +++ b/mdsf/src/tools/brunette.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_brunette_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_brunette_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("brunette")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("brunette")]; - crate::execution::run_tools(&commands, file_path, timeout, set_brunette_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_brunette_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bsfmt.rs b/mdsf/src/tools/bsfmt.rs index 2620a11f..96bc57b5 100644 --- a/mdsf/src/tools/bsfmt.rs +++ b/mdsf/src/tools/bsfmt.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_bsfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_bsfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd.arg("--write"); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("bsfmt"), - CommandType::Direct("bsfmt"), - CommandType::Npm("brighterscript-formatter"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("bsfmt"), + CommandType::Direct("bsfmt"), + CommandType::Npm("brighterscript-formatter"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_bsfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bsfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/bslint.rs b/mdsf/src/tools/bslint.rs index f6f9def9..042e242e 100644 --- a/mdsf/src/tools/bslint.rs +++ b/mdsf/src/tools/bslint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_bslint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_bslint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("bslint"), - CommandType::Direct("bslint"), - CommandType::Npm("bslint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("bslint"), + CommandType::Direct("bslint"), + CommandType::Npm("bslint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_bslint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bslint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/buf_format.rs b/mdsf/src/tools/buf_format.rs index b02a41d6..4a34ad46 100644 --- a/mdsf/src/tools/buf_format.rs +++ b/mdsf/src/tools/buf_format.rs @@ -1,27 +1,31 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_buf_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_buf_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("buf"), - CommandType::Direct("buf"), - CommandType::Npm("@bufbuild/buf"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("buf"), + CommandType::Direct("buf"), + CommandType::Npm("@bufbuild/buf"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_buf_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_buf_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/buildifier.rs b/mdsf/src/tools/buildifier.rs index 40a6bddb..a23de043 100644 --- a/mdsf/src/tools/buildifier.rs +++ b/mdsf/src/tools/buildifier.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_buildifier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_buildifier_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("buildifier")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("buildifier")]; - crate::execution::run_tools(&commands, file_path, timeout, set_buildifier_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_buildifier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cabal_fmt.rs b/mdsf/src/tools/cabal_fmt.rs index fe74e1dd..7694ea8e 100644 --- a/mdsf/src/tools/cabal_fmt.rs +++ b/mdsf/src/tools/cabal_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_cabal_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_cabal_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--inplace"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("cabal-fmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal-fmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_cabal_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cabal_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cabal_format.rs b/mdsf/src/tools/cabal_format.rs index 6f180761..91f46ff3 100644 --- a/mdsf/src/tools/cabal_format.rs +++ b/mdsf/src/tools/cabal_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_cabal_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_cabal_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("cabal")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal")]; - crate::execution::run_tools(&commands, file_path, timeout, set_cabal_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cabal_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cabal_prettify.rs b/mdsf/src/tools/cabal_prettify.rs index e820d71b..a144b195 100644 --- a/mdsf/src/tools/cabal_prettify.rs +++ b/mdsf/src/tools/cabal_prettify.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_cabal_prettify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_cabal_prettify_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("cabal-prettify")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal-prettify")]; - crate::execution::run_tools(&commands, file_path, timeout, set_cabal_prettify_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cabal_prettify_args) } #[cfg(test)] diff --git a/mdsf/src/tools/caddy_fmt.rs b/mdsf/src/tools/caddy_fmt.rs index 1bae9d16..11aad21a 100644 --- a/mdsf/src/tools/caddy_fmt.rs +++ b/mdsf/src/tools/caddy_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_caddy_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_caddy_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd.arg("-w"); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("caddy")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("caddy")]; - crate::execution::run_tools(&commands, file_path, timeout, set_caddy_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_caddy_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/caramel_fmt.rs b/mdsf/src/tools/caramel_fmt.rs index 3b27c3cc..e4435ac0 100644 --- a/mdsf/src/tools/caramel_fmt.rs +++ b/mdsf/src/tools/caramel_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_caramel_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_caramel_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("caramel")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("caramel")]; - crate::execution::run_tools(&commands, file_path, timeout, set_caramel_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_caramel_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/clang_format.rs b/mdsf/src/tools/clang_format.rs index 9976d08d..fe14b89c 100644 --- a/mdsf/src/tools/clang_format.rs +++ b/mdsf/src/tools/clang_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_clang_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_clang_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("clang-format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("clang-format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_clang_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_clang_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/clang_tidy.rs b/mdsf/src/tools/clang_tidy.rs index 1af07ab3..5b803b8b 100644 --- a/mdsf/src/tools/clang_tidy.rs +++ b/mdsf/src/tools/clang_tidy.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_clang_tidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_clang_tidy_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("clang-tidy")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("clang-tidy")]; - crate::execution::run_tools(&commands, file_path, timeout, set_clang_tidy_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_clang_tidy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cljfmt_fix.rs b/mdsf/src/tools/cljfmt_fix.rs index 8ca4f366..079b4785 100644 --- a/mdsf/src/tools/cljfmt_fix.rs +++ b/mdsf/src/tools/cljfmt_fix.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_cljfmt_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_cljfmt_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("cljfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("cljfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_cljfmt_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cljfmt_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cljstyle.rs b/mdsf/src/tools/cljstyle.rs index 4db90c64..f458d1f9 100644 --- a/mdsf/src/tools/cljstyle.rs +++ b/mdsf/src/tools/cljstyle.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_cljstyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_cljstyle_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("cljstyle")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("cljstyle")]; - crate::execution::run_tools(&commands, file_path, timeout, set_cljstyle_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cljstyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/cmake_format.rs b/mdsf/src/tools/cmake_format.rs index a2da2ff8..8dd53acd 100644 --- a/mdsf/src/tools/cmake_format.rs +++ b/mdsf/src/tools/cmake_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_cmake_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_cmake_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("cmake-format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("cmake-format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_cmake_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cmake_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/codespell.rs b/mdsf/src/tools/codespell.rs index 4d5567a3..365ffe5d 100644 --- a/mdsf/src/tools/codespell.rs +++ b/mdsf/src/tools/codespell.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_codespell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_codespell_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd.arg("--check-hidden"); cmd.arg("--write-changes"); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("codespell")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("codespell")]; - crate::execution::run_tools(&commands, file_path, timeout, set_codespell_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_codespell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/crlfmt.rs b/mdsf/src/tools/crlfmt.rs index 38cc96fd..7fb6bfaf 100644 --- a/mdsf/src/tools/crlfmt.rs +++ b/mdsf/src/tools/crlfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_crlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_crlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("crlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("crlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_crlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_crlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/crystal_format.rs b/mdsf/src/tools/crystal_format.rs index 6ce497a7..f7628036 100644 --- a/mdsf/src/tools/crystal_format.rs +++ b/mdsf/src/tools/crystal_format.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_crystal_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_crystal_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("tool"); cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("crystal")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("crystal")]; - crate::execution::run_tools(&commands, file_path, timeout, set_crystal_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_crystal_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/csharpier.rs b/mdsf/src/tools/csharpier.rs index c40452fa..070d4d4a 100644 --- a/mdsf/src/tools/csharpier.rs +++ b/mdsf/src/tools/csharpier.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_csharpier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_csharpier_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("csharpier"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dotnet")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dotnet")]; - crate::execution::run_tools(&commands, file_path, timeout, set_csharpier_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_csharpier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/css_beautify.rs b/mdsf/src/tools/css_beautify.rs index ba663954..8796e276 100644 --- a/mdsf/src/tools/css_beautify.rs +++ b/mdsf/src/tools/css_beautify.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_css_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_css_beautify_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-r"); cmd.arg("--type"); cmd.arg("css"); @@ -15,15 +16,18 @@ fn set_css_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Comma cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("css-beautify"), - CommandType::Direct("css-beautify"), - CommandType::Npm("js-beautify"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("css-beautify"), + CommandType::Direct("css-beautify"), + CommandType::Npm("js-beautify"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_css_beautify_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_css_beautify_args) } #[cfg(test)] diff --git a/mdsf/src/tools/csscomb.rs b/mdsf/src/tools/csscomb.rs index 159dcf33..30575ad3 100644 --- a/mdsf/src/tools/csscomb.rs +++ b/mdsf/src/tools/csscomb.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_csscomb_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_csscomb_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-t"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("csscomb"), - CommandType::Direct("csscomb"), - CommandType::Npm("csscomb"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("csscomb"), + CommandType::Direct("csscomb"), + CommandType::Npm("csscomb"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_csscomb_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_csscomb_args) } #[cfg(test)] diff --git a/mdsf/src/tools/csslint.rs b/mdsf/src/tools/csslint.rs index 64d00576..67684d54 100644 --- a/mdsf/src/tools/csslint.rs +++ b/mdsf/src/tools/csslint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_csslint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_csslint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("csslint"), - CommandType::Direct("csslint"), - CommandType::Npm("csslint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("csslint"), + CommandType::Direct("csslint"), + CommandType::Npm("csslint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_csslint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_csslint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/curlylint.rs b/mdsf/src/tools/curlylint.rs index 7485bd99..83cacf4a 100644 --- a/mdsf/src/tools/curlylint.rs +++ b/mdsf/src/tools/curlylint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_curlylint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_curlylint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-q"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("curlylint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("curlylint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_curlylint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_curlylint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/d_2_fmt.rs b/mdsf/src/tools/d_2_fmt.rs index 2b0aede1..1f481e05 100644 --- a/mdsf/src/tools/d_2_fmt.rs +++ b/mdsf/src/tools/d_2_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_d_2_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_d_2_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("d2")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("d2")]; - crate::execution::run_tools(&commands, file_path, timeout, set_d_2_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_d_2_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dart_fix.rs b/mdsf/src/tools/dart_fix.rs index 5c94a7c6..78a72b76 100644 --- a/mdsf/src/tools/dart_fix.rs +++ b/mdsf/src/tools/dart_fix.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dart_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dart_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg("--apply"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dart")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dart")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dart_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dart_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dart_format.rs b/mdsf/src/tools/dart_format.rs index 702fe393..5fc66d75 100644 --- a/mdsf/src/tools/dart_format.rs +++ b/mdsf/src/tools/dart_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dart_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dart_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dart")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dart")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dart_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dart_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dcm_fix.rs b/mdsf/src/tools/dcm_fix.rs index 61d3460b..0cbd7fc3 100644 --- a/mdsf/src/tools/dcm_fix.rs +++ b/mdsf/src/tools/dcm_fix.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dcm_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dcm_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dcm")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dcm")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dcm_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dcm_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dcm_format.rs b/mdsf/src/tools/dcm_format.rs index 3b4f8619..f781ce59 100644 --- a/mdsf/src/tools/dcm_format.rs +++ b/mdsf/src/tools/dcm_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dcm_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dcm_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dcm")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dcm")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dcm_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dcm_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/deadnix.rs b/mdsf/src/tools/deadnix.rs index 34826ec5..e1c3c6b1 100644 --- a/mdsf/src/tools/deadnix.rs +++ b/mdsf/src/tools/deadnix.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_deadnix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_deadnix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-q"); cmd.arg("--edit"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("deadnix")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("deadnix")]; - crate::execution::run_tools(&commands, file_path, timeout, set_deadnix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_deadnix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/deno_fmt.rs b/mdsf/src/tools/deno_fmt.rs index 5ea043e3..fddccff0 100644 --- a/mdsf/src/tools/deno_fmt.rs +++ b/mdsf/src/tools/deno_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_deno_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_deno_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("deno")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("deno")]; - crate::execution::run_tools(&commands, file_path, timeout, set_deno_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_deno_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/deno_lint.rs b/mdsf/src/tools/deno_lint.rs index b4f2fdd3..f226d1ea 100644 --- a/mdsf/src/tools/deno_lint.rs +++ b/mdsf/src/tools/deno_lint.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_deno_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_deno_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("deno")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("deno")]; - crate::execution::run_tools(&commands, file_path, timeout, set_deno_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_deno_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dfmt.rs b/mdsf/src/tools/dfmt.rs index 5aa03c05..e4e2c414 100644 --- a/mdsf/src/tools/dfmt.rs +++ b/mdsf/src/tools/dfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dhall.rs b/mdsf/src/tools/dhall.rs index d4eb5e40..5785511e 100644 --- a/mdsf/src/tools/dhall.rs +++ b/mdsf/src/tools/dhall.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dhall_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dhall_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dhall")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dhall")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dhall_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dhall_args) } #[cfg(test)] diff --git a/mdsf/src/tools/djade.rs b/mdsf/src/tools/djade.rs index 40a73111..7bb7a4d3 100644 --- a/mdsf/src/tools/djade.rs +++ b/mdsf/src/tools/djade.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_djade_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_djade_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("djade")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("djade")]; - crate::execution::run_tools(&commands, file_path, timeout, set_djade_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_djade_args) } #[cfg(test)] diff --git a/mdsf/src/tools/djlint.rs b/mdsf/src/tools/djlint.rs index 98729fbd..5d6b4a13 100644 --- a/mdsf/src/tools/djlint.rs +++ b/mdsf/src/tools/djlint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_djlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_djlint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd.arg("--reformat"); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("djlint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("djlint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_djlint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_djlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/docformatter.rs b/mdsf/src/tools/docformatter.rs index 8477dfc3..d57a2951 100644 --- a/mdsf/src/tools/docformatter.rs +++ b/mdsf/src/tools/docformatter.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_docformatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_docformatter_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--in-place"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("docformatter")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("docformatter")]; - crate::execution::run_tools(&commands, file_path, timeout, set_docformatter_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_docformatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dockfmt.rs b/mdsf/src/tools/dockfmt.rs index 76375760..48d5191a 100644 --- a/mdsf/src/tools/dockfmt.rs +++ b/mdsf/src/tools/dockfmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dockfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dockfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dockfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dockfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dockfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dockfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/docstrfmt.rs b/mdsf/src/tools/docstrfmt.rs index 5c832ac6..04da6a53 100644 --- a/mdsf/src/tools/docstrfmt.rs +++ b/mdsf/src/tools/docstrfmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_docstrfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_docstrfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("docstrfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("docstrfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_docstrfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_docstrfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/doctoc.rs b/mdsf/src/tools/doctoc.rs index a2200c3f..2de77e94 100644 --- a/mdsf/src/tools/doctoc.rs +++ b/mdsf/src/tools/doctoc.rs @@ -1,25 +1,29 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_doctoc_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_doctoc_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("doctoc"), - CommandType::Direct("doctoc"), - CommandType::Npm("doctoc"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("doctoc"), + CommandType::Direct("doctoc"), + CommandType::Npm("doctoc"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_doctoc_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_doctoc_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dotenv_linter_fix.rs b/mdsf/src/tools/dotenv_linter_fix.rs index dfc6e085..a6dacc12 100644 --- a/mdsf/src/tools/dotenv_linter_fix.rs +++ b/mdsf/src/tools/dotenv_linter_fix.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dotenv_linter_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dotenv_linter_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("dotenv-linter")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("dotenv-linter")]; - crate::execution::run_tools(&commands, file_path, timeout, set_dotenv_linter_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dotenv_linter_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/dprint_fmt.rs b/mdsf/src/tools/dprint_fmt.rs index dad34e1c..35b1df5a 100644 --- a/mdsf/src/tools/dprint_fmt.rs +++ b/mdsf/src/tools/dprint_fmt.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_dprint_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_dprint_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("dprint"), - CommandType::Direct("dprint"), - CommandType::Npm("dprint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("dprint"), + CommandType::Direct("dprint"), + CommandType::Npm("dprint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_dprint_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dprint_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/easy_coding_standard.rs b/mdsf/src/tools/easy_coding_standard.rs index 0329f09b..9b67dc55 100644 --- a/mdsf/src/tools/easy_coding_standard.rs +++ b/mdsf/src/tools/easy_coding_standard.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_easy_coding_standard_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_easy_coding_standard_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("check"); cmd.arg(file_path); cmd.arg("--fix"); @@ -14,11 +15,14 @@ fn set_easy_coding_standard_args(mut cmd: Command, file_path: &std::path::Path) cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::PhpVendor("ecs"), CommandType::Direct("ecs")]; +const COMMANDS: [CommandType; 2] = [CommandType::PhpVendor("ecs"), CommandType::Direct("ecs")]; - crate::execution::run_tools(&commands, file_path, timeout, set_easy_coding_standard_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_easy_coding_standard_args) } #[cfg(test)] diff --git a/mdsf/src/tools/efmt.rs b/mdsf/src/tools/efmt.rs index 10849f64..6077fa3c 100644 --- a/mdsf/src/tools/efmt.rs +++ b/mdsf/src/tools/efmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_efmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_efmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("efmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("efmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_efmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_efmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/elm_format.rs b/mdsf/src/tools/elm_format.rs index 4532940c..0e2cd7ec 100644 --- a/mdsf/src/tools/elm_format.rs +++ b/mdsf/src/tools/elm_format.rs @@ -1,27 +1,31 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_elm_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_elm_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--elm-version=0.19"); cmd.arg("--yes"); cmd.arg(file_path); cmd } +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("elm-format"), + CommandType::Direct("elm-format"), + CommandType::Npm("elm-format"), +]; + #[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("elm-format"), - CommandType::Direct("elm-format"), - CommandType::Npm("elm-format"), - ]; - - crate::execution::run_tools(&commands, file_path, timeout, set_elm_format_args) +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_elm_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/erb_formatter.rs b/mdsf/src/tools/erb_formatter.rs index 0e409885..07125351 100644 --- a/mdsf/src/tools/erb_formatter.rs +++ b/mdsf/src/tools/erb_formatter.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_erb_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_erb_formatter_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd.arg("--write"); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("erb-format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("erb-format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_erb_formatter_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_erb_formatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/erlfmt.rs b/mdsf/src/tools/erlfmt.rs index 60862dac..60252ca7 100644 --- a/mdsf/src/tools/erlfmt.rs +++ b/mdsf/src/tools/erlfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_erlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_erlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(format!("'{}'", file_path.to_string_lossy())); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("erlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("erlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_erlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_erlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/eslint.rs b/mdsf/src/tools/eslint.rs index 82772487..4dab0a15 100644 --- a/mdsf/src/tools/eslint.rs +++ b/mdsf/src/tools/eslint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_eslint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_eslint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("eslint"), - CommandType::Direct("eslint"), - CommandType::Npm("eslint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("eslint"), + CommandType::Direct("eslint"), + CommandType::Npm("eslint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_eslint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_eslint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fantomas.rs b/mdsf/src/tools/fantomas.rs index 82766ad2..fcaa90ea 100644 --- a/mdsf/src/tools/fantomas.rs +++ b/mdsf/src/tools/fantomas.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_fantomas_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_fantomas_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("fantomas")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("fantomas")]; - crate::execution::run_tools(&commands, file_path, timeout, set_fantomas_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fantomas_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fish_indent.rs b/mdsf/src/tools/fish_indent.rs index 6039d250..dcdfcbe6 100644 --- a/mdsf/src/tools/fish_indent.rs +++ b/mdsf/src/tools/fish_indent.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_fish_indent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_fish_indent_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("fish_indent")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("fish_indent")]; - crate::execution::run_tools(&commands, file_path, timeout, set_fish_indent_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fish_indent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fixjson.rs b/mdsf/src/tools/fixjson.rs index 144bbe93..fa5d9921 100644 --- a/mdsf/src/tools/fixjson.rs +++ b/mdsf/src/tools/fixjson.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_fixjson_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_fixjson_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("fixjson"), - CommandType::Direct("fixjson"), - CommandType::Npm("fixjson"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("fixjson"), + CommandType::Direct("fixjson"), + CommandType::Npm("fixjson"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_fixjson_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fixjson_args) } #[cfg(test)] diff --git a/mdsf/src/tools/floskell.rs b/mdsf/src/tools/floskell.rs index b58a011f..fab5503e 100644 --- a/mdsf/src/tools/floskell.rs +++ b/mdsf/src/tools/floskell.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_floskell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_floskell_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("floskell")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("floskell")]; - crate::execution::run_tools(&commands, file_path, timeout, set_floskell_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_floskell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fnlfmt.rs b/mdsf/src/tools/fnlfmt.rs index 3fff1c3a..361b6ee1 100644 --- a/mdsf/src/tools/fnlfmt.rs +++ b/mdsf/src/tools/fnlfmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_fnlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_fnlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("fnlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("fnlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_fnlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fnlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/forge_fmt.rs b/mdsf/src/tools/forge_fmt.rs index acea1f18..971ff229 100644 --- a/mdsf/src/tools/forge_fmt.rs +++ b/mdsf/src/tools/forge_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_forge_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_forge_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("forge")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("forge")]; - crate::execution::run_tools(&commands, file_path, timeout, set_forge_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_forge_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fourmolu.rs b/mdsf/src/tools/fourmolu.rs index e4d2b5b8..da3fa369 100644 --- a/mdsf/src/tools/fourmolu.rs +++ b/mdsf/src/tools/fourmolu.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_fourmolu_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_fourmolu_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("fourmolu")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("fourmolu")]; - crate::execution::run_tools(&commands, file_path, timeout, set_fourmolu_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fourmolu_args) } #[cfg(test)] diff --git a/mdsf/src/tools/fprettify.rs b/mdsf/src/tools/fprettify.rs index d5bcf76d..5e0b3436 100644 --- a/mdsf/src/tools/fprettify.rs +++ b/mdsf/src/tools/fprettify.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_fprettify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_fprettify_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("fprettify")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("fprettify")]; - crate::execution::run_tools(&commands, file_path, timeout, set_fprettify_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fprettify_args) } #[cfg(test)] diff --git a/mdsf/src/tools/futhark_fmt.rs b/mdsf/src/tools/futhark_fmt.rs index 411725dc..52905549 100644 --- a/mdsf/src/tools/futhark_fmt.rs +++ b/mdsf/src/tools/futhark_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_futhark_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_futhark_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("futhark")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("futhark")]; - crate::execution::run_tools(&commands, file_path, timeout, set_futhark_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_futhark_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gci.rs b/mdsf/src/tools/gci.rs index 0fbcafd5..106e615f 100644 --- a/mdsf/src/tools/gci.rs +++ b/mdsf/src/tools/gci.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_gci_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_gci_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("write"); cmd.arg("--skip-generated"); cmd.arg("--skip-vendor"); @@ -14,11 +15,14 @@ fn set_gci_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("gci")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("gci")]; - crate::execution::run_tools(&commands, file_path, timeout, set_gci_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gci_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gdformat.rs b/mdsf/src/tools/gdformat.rs index 1d89ddb3..2c18395c 100644 --- a/mdsf/src/tools/gdformat.rs +++ b/mdsf/src/tools/gdformat.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_gdformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_gdformat_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("gdformat")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("gdformat")]; - crate::execution::run_tools(&commands, file_path, timeout, set_gdformat_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gdformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gersemi.rs b/mdsf/src/tools/gersemi.rs index 7e24e232..56956725 100644 --- a/mdsf/src/tools/gersemi.rs +++ b/mdsf/src/tools/gersemi.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_gersemi_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_gersemi_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg("-q"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("gersemi")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("gersemi")]; - crate::execution::run_tools(&commands, file_path, timeout, set_gersemi_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gersemi_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gleam_format.rs b/mdsf/src/tools/gleam_format.rs index 5d41b440..ea210ff8 100644 --- a/mdsf/src/tools/gleam_format.rs +++ b/mdsf/src/tools/gleam_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_gleam_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_gleam_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("gleam")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("gleam")]; - crate::execution::run_tools(&commands, file_path, timeout, set_gleam_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gleam_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gluon_fmt.rs b/mdsf/src/tools/gluon_fmt.rs index 5f351baf..94f9e40f 100644 --- a/mdsf/src/tools/gluon_fmt.rs +++ b/mdsf/src/tools/gluon_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_gluon_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_gluon_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("gluon")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("gluon")]; - crate::execution::run_tools(&commands, file_path, timeout, set_gluon_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gluon_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gofmt.rs b/mdsf/src/tools/gofmt.rs index 885a13e8..bb446d0c 100644 --- a/mdsf/src/tools/gofmt.rs +++ b/mdsf/src/tools/gofmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_gofmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_gofmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("gofmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("gofmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_gofmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gofmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/gofumpt.rs b/mdsf/src/tools/gofumpt.rs index 1a03b9b8..4fabfd37 100644 --- a/mdsf/src/tools/gofumpt.rs +++ b/mdsf/src/tools/gofumpt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_gofumpt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_gofumpt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("gofumpt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("gofumpt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_gofumpt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gofumpt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/goimports.rs b/mdsf/src/tools/goimports.rs index 18d13baf..f82b4d65 100644 --- a/mdsf/src/tools/goimports.rs +++ b/mdsf/src/tools/goimports.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_goimports_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_goimports_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("goimports")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("goimports")]; - crate::execution::run_tools(&commands, file_path, timeout, set_goimports_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_goimports_args) } #[cfg(test)] diff --git a/mdsf/src/tools/goimports_reviser.rs b/mdsf/src/tools/goimports_reviser.rs index c03857fd..1b22d0a0 100644 --- a/mdsf/src/tools/goimports_reviser.rs +++ b/mdsf/src/tools/goimports_reviser.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_goimports_reviser_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_goimports_reviser_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("goimports-reviser")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("goimports-reviser")]; - crate::execution::run_tools(&commands, file_path, timeout, set_goimports_reviser_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_goimports_reviser_args) } #[cfg(test)] diff --git a/mdsf/src/tools/golines.rs b/mdsf/src/tools/golines.rs index 41ed276e..39c61871 100644 --- a/mdsf/src/tools/golines.rs +++ b/mdsf/src/tools/golines.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_golines_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_golines_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("golines")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("golines")]; - crate::execution::run_tools(&commands, file_path, timeout, set_golines_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_golines_args) } #[cfg(test)] diff --git a/mdsf/src/tools/google_java_format.rs b/mdsf/src/tools/google_java_format.rs index 1d6d481d..a333f8a6 100644 --- a/mdsf/src/tools/google_java_format.rs +++ b/mdsf/src/tools/google_java_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_google_java_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_google_java_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("google-java-format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("google-java-format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_google_java_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_google_java_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/grain_format.rs b/mdsf/src/tools/grain_format.rs index 98c01ef6..d1cd7373 100644 --- a/mdsf/src/tools/grain_format.rs +++ b/mdsf/src/tools/grain_format.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_grain_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_grain_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd.arg("-o"); @@ -14,11 +15,14 @@ fn set_grain_format_args(mut cmd: Command, file_path: &std::path::Path) -> Comma cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("grain")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("grain")]; - crate::execution::run_tools(&commands, file_path, timeout, set_grain_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_grain_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hadolint.rs b/mdsf/src/tools/hadolint.rs index 41fa934f..280bfb8f 100644 --- a/mdsf/src/tools/hadolint.rs +++ b/mdsf/src/tools/hadolint.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_hadolint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_hadolint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("hadolint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("hadolint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_hadolint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hadolint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/haml_lint.rs b/mdsf/src/tools/haml_lint.rs index b3ffef61..76c4501f 100644 --- a/mdsf/src/tools/haml_lint.rs +++ b/mdsf/src/tools/haml_lint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_haml_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_haml_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--auto-correct"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("haml-lint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("haml-lint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_haml_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_haml_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hclfmt.rs b/mdsf/src/tools/hclfmt.rs index 8eeb5fb0..def4f70e 100644 --- a/mdsf/src/tools/hclfmt.rs +++ b/mdsf/src/tools/hclfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_hclfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_hclfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("hclfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("hclfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_hclfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hclfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hfmt.rs b/mdsf/src/tools/hfmt.rs index be56258f..3ff26b4d 100644 --- a/mdsf/src/tools/hfmt.rs +++ b/mdsf/src/tools/hfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_hfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_hfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("hfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("hfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_hfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hindent.rs b/mdsf/src/tools/hindent.rs index 74c27937..148d5ecf 100644 --- a/mdsf/src/tools/hindent.rs +++ b/mdsf/src/tools/hindent.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_hindent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_hindent_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("hindent")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("hindent")]; - crate::execution::run_tools(&commands, file_path, timeout, set_hindent_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hindent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/hlint.rs b/mdsf/src/tools/hlint.rs index 1848cbbe..45623ac2 100644 --- a/mdsf/src/tools/hlint.rs +++ b/mdsf/src/tools/hlint.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_hlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_hlint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--refactor"); cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("hlint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("hlint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_hlint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/html_beautify.rs b/mdsf/src/tools/html_beautify.rs index 3ccbedae..a1b1a28c 100644 --- a/mdsf/src/tools/html_beautify.rs +++ b/mdsf/src/tools/html_beautify.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_html_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_html_beautify_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-r"); cmd.arg("--type"); cmd.arg("html"); @@ -15,15 +16,18 @@ fn set_html_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Comm cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("html-beautify"), - CommandType::Direct("html-beautify"), - CommandType::Npm("js-beautify"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("html-beautify"), + CommandType::Direct("html-beautify"), + CommandType::Npm("js-beautify"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_html_beautify_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_html_beautify_args) } #[cfg(test)] diff --git a/mdsf/src/tools/htmlbeautifier.rs b/mdsf/src/tools/htmlbeautifier.rs index d53841c8..447f403a 100644 --- a/mdsf/src/tools/htmlbeautifier.rs +++ b/mdsf/src/tools/htmlbeautifier.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_htmlbeautifier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_htmlbeautifier_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("htmlbeautifier")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("htmlbeautifier")]; - crate::execution::run_tools(&commands, file_path, timeout, set_htmlbeautifier_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_htmlbeautifier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/htmlhint.rs b/mdsf/src/tools/htmlhint.rs index 75e24dc9..fdae2f8e 100644 --- a/mdsf/src/tools/htmlhint.rs +++ b/mdsf/src/tools/htmlhint.rs @@ -1,25 +1,29 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_htmlhint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_htmlhint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("htmlhint"), - CommandType::Direct("htmlhint"), - CommandType::Npm("htmlhint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("htmlhint"), + CommandType::Direct("htmlhint"), + CommandType::Npm("htmlhint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_htmlhint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_htmlhint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/imba_fmt.rs b/mdsf/src/tools/imba_fmt.rs index ca581319..8d9cea35 100644 --- a/mdsf/src/tools/imba_fmt.rs +++ b/mdsf/src/tools/imba_fmt.rs @@ -1,27 +1,31 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_imba_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_imba_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("-f"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("imba"), - CommandType::Direct("imba"), - CommandType::Npm("imba"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("imba"), + CommandType::Direct("imba"), + CommandType::Npm("imba"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_imba_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_imba_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/inko_fmt.rs b/mdsf/src/tools/inko_fmt.rs index 91ebf274..1f529997 100644 --- a/mdsf/src/tools/inko_fmt.rs +++ b/mdsf/src/tools/inko_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_inko_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_inko_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("inko")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("inko")]; - crate::execution::run_tools(&commands, file_path, timeout, set_inko_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_inko_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/isort.rs b/mdsf/src/tools/isort.rs index cd307e27..41774885 100644 --- a/mdsf/src/tools/isort.rs +++ b/mdsf/src/tools/isort.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_isort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_isort_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("isort")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("isort")]; - crate::execution::run_tools(&commands, file_path, timeout, set_isort_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_isort_args) } #[cfg(test)] diff --git a/mdsf/src/tools/joker.rs b/mdsf/src/tools/joker.rs index b530105d..49e0df5a 100644 --- a/mdsf/src/tools/joker.rs +++ b/mdsf/src/tools/joker.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_joker_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_joker_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--format"); cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("joker")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("joker")]; - crate::execution::run_tools(&commands, file_path, timeout, set_joker_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_joker_args) } #[cfg(test)] diff --git a/mdsf/src/tools/js_beautify.rs b/mdsf/src/tools/js_beautify.rs index 63c84fa8..7e5256f6 100644 --- a/mdsf/src/tools/js_beautify.rs +++ b/mdsf/src/tools/js_beautify.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_js_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_js_beautify_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-r"); cmd.arg("--type"); cmd.arg("js"); @@ -15,15 +16,18 @@ fn set_js_beautify_args(mut cmd: Command, file_path: &std::path::Path) -> Comman cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("js-beautify"), - CommandType::Direct("js-beautify"), - CommandType::Npm("js-beautify"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("js-beautify"), + CommandType::Direct("js-beautify"), + CommandType::Npm("js-beautify"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_js_beautify_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_js_beautify_args) } #[cfg(test)] diff --git a/mdsf/src/tools/json_5_format.rs b/mdsf/src/tools/json_5_format.rs index 53627165..29467a59 100644 --- a/mdsf/src/tools/json_5_format.rs +++ b/mdsf/src/tools/json_5_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_json_5_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_json_5_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-r"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("json5format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("json5format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_json_5_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_json_5_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsona_format.rs b/mdsf/src/tools/jsona_format.rs index b8a3df37..446cf1e5 100644 --- a/mdsf/src/tools/jsona_format.rs +++ b/mdsf/src/tools/jsona_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_jsona_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_jsona_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("jsona")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsona")]; - crate::execution::run_tools(&commands, file_path, timeout, set_jsona_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsona_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsona_lint.rs b/mdsf/src/tools/jsona_lint.rs index 7e2cffe7..9a65109c 100644 --- a/mdsf/src/tools/jsona_lint.rs +++ b/mdsf/src/tools/jsona_lint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_jsona_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_jsona_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("jsona")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsona")]; - crate::execution::run_tools(&commands, file_path, timeout, set_jsona_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsona_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsonlint.rs b/mdsf/src/tools/jsonlint.rs index a5e39d82..8fcb49fd 100644 --- a/mdsf/src/tools/jsonlint.rs +++ b/mdsf/src/tools/jsonlint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_jsonlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_jsonlint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("jsonlint"), - CommandType::Direct("jsonlint"), - CommandType::Npm("jsonlint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("jsonlint"), + CommandType::Direct("jsonlint"), + CommandType::Npm("jsonlint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_jsonlint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsonlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsonnet_lint.rs b/mdsf/src/tools/jsonnet_lint.rs index d5c9b2d6..13c26112 100644 --- a/mdsf/src/tools/jsonnet_lint.rs +++ b/mdsf/src/tools/jsonnet_lint.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_jsonnet_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_jsonnet_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("jsonnet-lint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsonnet-lint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_jsonnet_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsonnet_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/jsonnetfmt.rs b/mdsf/src/tools/jsonnetfmt.rs index 2e5ce4ce..3e5823e6 100644 --- a/mdsf/src/tools/jsonnetfmt.rs +++ b/mdsf/src/tools/jsonnetfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_jsonnetfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_jsonnetfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("jsonnetfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsonnetfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_jsonnetfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsonnetfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/juliaformatter_jl.rs b/mdsf/src/tools/juliaformatter_jl.rs index a3e28f2e..cb7d2b50 100644 --- a/mdsf/src/tools/juliaformatter_jl.rs +++ b/mdsf/src/tools/juliaformatter_jl.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_juliaformatter_jl_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_juliaformatter_jl_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-E"); let fps = file_path.to_string_lossy(); cmd.arg(format!("using JuliaFormatter;format_file(\"{fps}\")")); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("julia")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("julia")]; - crate::execution::run_tools(&commands, file_path, timeout, set_juliaformatter_jl_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_juliaformatter_jl_args) } #[cfg(test)] diff --git a/mdsf/src/tools/just.rs b/mdsf/src/tools/just.rs index 8671f979..d1e03c38 100644 --- a/mdsf/src/tools/just.rs +++ b/mdsf/src/tools/just.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_just_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_just_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fmt"); cmd.arg("--unstable"); cmd.arg("--justfile"); @@ -14,15 +15,18 @@ fn set_just_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("just"), - CommandType::Direct("just"), - CommandType::Npm("rust-just"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("just"), + CommandType::Direct("just"), + CommandType::Npm("rust-just"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_just_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_just_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kcl_fmt.rs b/mdsf/src/tools/kcl_fmt.rs index c0b460fd..a1fded88 100644 --- a/mdsf/src/tools/kcl_fmt.rs +++ b/mdsf/src/tools/kcl_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_kcl_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_kcl_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("kcl")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("kcl")]; - crate::execution::run_tools(&commands, file_path, timeout, set_kcl_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kcl_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kcl_lint.rs b/mdsf/src/tools/kcl_lint.rs index b7e6ac12..d2fa253e 100644 --- a/mdsf/src/tools/kcl_lint.rs +++ b/mdsf/src/tools/kcl_lint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_kcl_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_kcl_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("kcl")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("kcl")]; - crate::execution::run_tools(&commands, file_path, timeout, set_kcl_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kcl_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kdlfmt.rs b/mdsf/src/tools/kdlfmt.rs index 69c97382..dd9972e7 100644 --- a/mdsf/src/tools/kdlfmt.rs +++ b/mdsf/src/tools/kdlfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_kdlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_kdlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("kdlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("kdlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_kdlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kdlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kdoc_formatter.rs b/mdsf/src/tools/kdoc_formatter.rs index 3953e527..99273089 100644 --- a/mdsf/src/tools/kdoc_formatter.rs +++ b/mdsf/src/tools/kdoc_formatter.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_kdoc_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_kdoc_formatter_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("kdoc-formatter")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("kdoc-formatter")]; - crate::execution::run_tools(&commands, file_path, timeout, set_kdoc_formatter_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kdoc_formatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ktfmt.rs b/mdsf/src/tools/ktfmt.rs index d9ad8322..4175c743 100644 --- a/mdsf/src/tools/ktfmt.rs +++ b/mdsf/src/tools/ktfmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ktfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ktfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--format"); cmd.arg("--log-level=error"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ktfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ktfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ktfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ktfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ktlint.rs b/mdsf/src/tools/ktlint.rs index f46a5af9..a88f4387 100644 --- a/mdsf/src/tools/ktlint.rs +++ b/mdsf/src/tools/ktlint.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ktlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ktlint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--format"); cmd.arg("--log-level=error"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ktlint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ktlint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ktlint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ktlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/kulala_fmt.rs b/mdsf/src/tools/kulala_fmt.rs index 34b9d182..c745c85b 100644 --- a/mdsf/src/tools/kulala_fmt.rs +++ b/mdsf/src/tools/kulala_fmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_kulala_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_kulala_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("kulala-fmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("kulala-fmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_kulala_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kulala_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/leptosfmt.rs b/mdsf/src/tools/leptosfmt.rs index 12246d18..8e0e3d6d 100644 --- a/mdsf/src/tools/leptosfmt.rs +++ b/mdsf/src/tools/leptosfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_leptosfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_leptosfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("leptosfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("leptosfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_leptosfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_leptosfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/liquidsoap_prettier.rs b/mdsf/src/tools/liquidsoap_prettier.rs index a514bd2b..39e0bbe0 100644 --- a/mdsf/src/tools/liquidsoap_prettier.rs +++ b/mdsf/src/tools/liquidsoap_prettier.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_liquidsoap_prettier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_liquidsoap_prettier_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("liquidsoap-prettier"), - CommandType::Direct("liquidsoap-prettier"), - CommandType::Npm("liquidsoap-prettier"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("liquidsoap-prettier"), + CommandType::Direct("liquidsoap-prettier"), + CommandType::Npm("liquidsoap-prettier"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_liquidsoap_prettier_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_liquidsoap_prettier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/luacheck.rs b/mdsf/src/tools/luacheck.rs index 9ea4453c..70ebd064 100644 --- a/mdsf/src/tools/luacheck.rs +++ b/mdsf/src/tools/luacheck.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_luacheck_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_luacheck_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("luacheck")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("luacheck")]; - crate::execution::run_tools(&commands, file_path, timeout, set_luacheck_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_luacheck_args) } #[cfg(test)] diff --git a/mdsf/src/tools/luaformatter.rs b/mdsf/src/tools/luaformatter.rs index 36f6944d..81257d41 100644 --- a/mdsf/src/tools/luaformatter.rs +++ b/mdsf/src/tools/luaformatter.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_luaformatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_luaformatter_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("lua-format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("lua-format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_luaformatter_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_luaformatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mado_check.rs b/mdsf/src/tools/mado_check.rs index 16c17967..4096cbee 100644 --- a/mdsf/src/tools/mado_check.rs +++ b/mdsf/src/tools/mado_check.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_mado_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_mado_check_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("check"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("mado")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("mado")]; - crate::execution::run_tools(&commands, file_path, timeout, set_mado_check_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mado_check_args) } #[cfg(test)] diff --git a/mdsf/src/tools/markdownfmt.rs b/mdsf/src/tools/markdownfmt.rs index 210c1324..f0ee30f6 100644 --- a/mdsf/src/tools/markdownfmt.rs +++ b/mdsf/src/tools/markdownfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_markdownfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_markdownfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("markdownfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("markdownfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_markdownfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markdownfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/markdownlint.rs b/mdsf/src/tools/markdownlint.rs index 20b17c22..9df92c6b 100644 --- a/mdsf/src/tools/markdownlint.rs +++ b/mdsf/src/tools/markdownlint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_markdownlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_markdownlint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("markdownlint"), - CommandType::Direct("markdownlint"), - CommandType::Npm("markdownlint-cli"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("markdownlint"), + CommandType::Direct("markdownlint"), + CommandType::Npm("markdownlint-cli"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_markdownlint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markdownlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/markdownlint_cli_2.rs b/mdsf/src/tools/markdownlint_cli_2.rs index 31d7d54a..a91ff825 100644 --- a/mdsf/src/tools/markdownlint_cli_2.rs +++ b/mdsf/src/tools/markdownlint_cli_2.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_markdownlint_cli_2_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_markdownlint_cli_2_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("markdownlint-cli2"), - CommandType::Direct("markdownlint-cli2"), - CommandType::Npm("markdownlint-cli2"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("markdownlint-cli2"), + CommandType::Direct("markdownlint-cli2"), + CommandType::Npm("markdownlint-cli2"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_markdownlint_cli_2_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markdownlint_cli_2_args) } #[cfg(test)] diff --git a/mdsf/src/tools/markuplint.rs b/mdsf/src/tools/markuplint.rs index 6b4dcdc5..b4e6a7c8 100644 --- a/mdsf/src/tools/markuplint.rs +++ b/mdsf/src/tools/markuplint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_markuplint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_markuplint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("markuplint"), - CommandType::Direct("markuplint"), - CommandType::Npm("markuplint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("markuplint"), + CommandType::Direct("markuplint"), + CommandType::Npm("markuplint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_markuplint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markuplint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mdformat.rs b/mdsf/src/tools/mdformat.rs index a4321305..3414fb92 100644 --- a/mdsf/src/tools/mdformat.rs +++ b/mdsf/src/tools/mdformat.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_mdformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_mdformat_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("mdformat")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("mdformat")]; - crate::execution::run_tools(&commands, file_path, timeout, set_mdformat_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mdformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mdslw.rs b/mdsf/src/tools/mdslw.rs index 7c77085c..f904f15e 100644 --- a/mdsf/src/tools/mdslw.rs +++ b/mdsf/src/tools/mdslw.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_mdslw_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_mdslw_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("mdslw")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("mdslw")]; - crate::execution::run_tools(&commands, file_path, timeout, set_mdslw_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mdslw_args) } #[cfg(test)] diff --git a/mdsf/src/tools/meson_fmt.rs b/mdsf/src/tools/meson_fmt.rs index bdb8f30e..fba8d0bb 100644 --- a/mdsf/src/tools/meson_fmt.rs +++ b/mdsf/src/tools/meson_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_meson_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_meson_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("meson")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("meson")]; - crate::execution::run_tools(&commands, file_path, timeout, set_meson_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_meson_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/misspell.rs b/mdsf/src/tools/misspell.rs index e6aae3cf..95bfd430 100644 --- a/mdsf/src/tools/misspell.rs +++ b/mdsf/src/tools/misspell.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_misspell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_misspell_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("misspell")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("misspell")]; - crate::execution::run_tools(&commands, file_path, timeout, set_misspell_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_misspell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mix_format.rs b/mdsf/src/tools/mix_format.rs index 450b2b5f..4fd0e85c 100644 --- a/mdsf/src/tools/mix_format.rs +++ b/mdsf/src/tools/mix_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_mix_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_mix_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("mix")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("mix")]; - crate::execution::run_tools(&commands, file_path, timeout, set_mix_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mix_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mojo_format.rs b/mdsf/src/tools/mojo_format.rs index 1e1de033..d147f2e6 100644 --- a/mdsf/src/tools/mojo_format.rs +++ b/mdsf/src/tools/mojo_format.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_mojo_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_mojo_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg("-q"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("mojo")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("mojo")]; - crate::execution::run_tools(&commands, file_path, timeout, set_mojo_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mojo_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/mypy.rs b/mdsf/src/tools/mypy.rs index cb3ea8bd..6788809e 100644 --- a/mdsf/src/tools/mypy.rs +++ b/mdsf/src/tools/mypy.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_mypy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_mypy_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("mypy")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("mypy")]; - crate::execution::run_tools(&commands, file_path, timeout, set_mypy_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mypy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nginxbeautifier.rs b/mdsf/src/tools/nginxbeautifier.rs index 549ca913..146811df 100644 --- a/mdsf/src/tools/nginxbeautifier.rs +++ b/mdsf/src/tools/nginxbeautifier.rs @@ -1,25 +1,29 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nginxbeautifier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nginxbeautifier_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("nginxbeautifier"), - CommandType::Direct("nginxbeautifier"), - CommandType::Npm("nginxbeautifier"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("nginxbeautifier"), + CommandType::Direct("nginxbeautifier"), + CommandType::Npm("nginxbeautifier"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_nginxbeautifier_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nginxbeautifier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nginxfmt.rs b/mdsf/src/tools/nginxfmt.rs index 10cd86ff..4c051a4e 100644 --- a/mdsf/src/tools/nginxfmt.rs +++ b/mdsf/src/tools/nginxfmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nginxfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nginxfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nginxfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nginxfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nginxfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nginxfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nickel_format.rs b/mdsf/src/tools/nickel_format.rs index 1f9ed8fb..7dd9487a 100644 --- a/mdsf/src/tools/nickel_format.rs +++ b/mdsf/src/tools/nickel_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nickel_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nickel_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nickel")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nickel")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nickel_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nickel_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nimpretty.rs b/mdsf/src/tools/nimpretty.rs index 3fe1650f..bedfc6d4 100644 --- a/mdsf/src/tools/nimpretty.rs +++ b/mdsf/src/tools/nimpretty.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nimpretty_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nimpretty_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nimpretty")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nimpretty")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nimpretty_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nimpretty_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nixfmt.rs b/mdsf/src/tools/nixfmt.rs index 0b3b29a6..674ecedb 100644 --- a/mdsf/src/tools/nixfmt.rs +++ b/mdsf/src/tools/nixfmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nixfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nixfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nixfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nixfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nixfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nixfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nixpkgs_fmt.rs b/mdsf/src/tools/nixpkgs_fmt.rs index 59448d4d..54946160 100644 --- a/mdsf/src/tools/nixpkgs_fmt.rs +++ b/mdsf/src/tools/nixpkgs_fmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nixpkgs_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nixpkgs_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nixpkgs-fmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nixpkgs-fmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nixpkgs_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nixpkgs_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nomad_fmt.rs b/mdsf/src/tools/nomad_fmt.rs index da647651..1993e9e1 100644 --- a/mdsf/src/tools/nomad_fmt.rs +++ b/mdsf/src/tools/nomad_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nomad_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nomad_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nomad")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nomad")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nomad_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nomad_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nph.rs b/mdsf/src/tools/nph.rs index 3949eb43..60253829 100644 --- a/mdsf/src/tools/nph.rs +++ b/mdsf/src/tools/nph.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nph_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nph_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nph")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nph")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nph_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nph_args) } #[cfg(test)] diff --git a/mdsf/src/tools/npm_groovy_lint.rs b/mdsf/src/tools/npm_groovy_lint.rs index 5f5eb1be..5ab2adc8 100644 --- a/mdsf/src/tools/npm_groovy_lint.rs +++ b/mdsf/src/tools/npm_groovy_lint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_npm_groovy_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_npm_groovy_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("npm-groovy-lint"), - CommandType::Direct("npm-groovy-lint"), - CommandType::Npm("npm-groovy-lint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("npm-groovy-lint"), + CommandType::Direct("npm-groovy-lint"), + CommandType::Npm("npm-groovy-lint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_npm_groovy_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_npm_groovy_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/nufmt.rs b/mdsf/src/tools/nufmt.rs index 4b88572d..c0b0fd33 100644 --- a/mdsf/src/tools/nufmt.rs +++ b/mdsf/src/tools/nufmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_nufmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_nufmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("nufmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("nufmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_nufmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nufmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ocamlformat.rs b/mdsf/src/tools/ocamlformat.rs index 4433844a..7cc48d38 100644 --- a/mdsf/src/tools/ocamlformat.rs +++ b/mdsf/src/tools/ocamlformat.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ocamlformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ocamlformat_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--ignore-invalid-option"); cmd.arg("--inplace"); cmd.arg("--enable-outside-detected-project"); @@ -14,11 +15,14 @@ fn set_ocamlformat_args(mut cmd: Command, file_path: &std::path::Path) -> Comman cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ocamlformat")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ocamlformat")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ocamlformat_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ocamlformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ocp_indent.rs b/mdsf/src/tools/ocp_indent.rs index 84efae7d..98a3bce1 100644 --- a/mdsf/src/tools/ocp_indent.rs +++ b/mdsf/src/tools/ocp_indent.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ocp_indent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ocp_indent_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--inplace"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ocp-indent")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ocp-indent")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ocp_indent_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ocp_indent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/odinfmt.rs b/mdsf/src/tools/odinfmt.rs index 9e74a63b..a484063f 100644 --- a/mdsf/src/tools/odinfmt.rs +++ b/mdsf/src/tools/odinfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_odinfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_odinfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("odinfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("odinfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_odinfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_odinfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/oelint_adv.rs b/mdsf/src/tools/oelint_adv.rs index 0ab915fa..859e76b0 100644 --- a/mdsf/src/tools/oelint_adv.rs +++ b/mdsf/src/tools/oelint_adv.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_oelint_adv_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_oelint_adv_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg("--nobackup"); cmd.arg("--quiet"); @@ -14,11 +15,14 @@ fn set_oelint_adv_args(mut cmd: Command, file_path: &std::path::Path) -> Command cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("oelint-adv")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("oelint-adv")]; - crate::execution::run_tools(&commands, file_path, timeout, set_oelint_adv_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_oelint_adv_args) } #[cfg(test)] diff --git a/mdsf/src/tools/opa_fmt.rs b/mdsf/src/tools/opa_fmt.rs index d28314ee..6f4f10fc 100644 --- a/mdsf/src/tools/opa_fmt.rs +++ b/mdsf/src/tools/opa_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_opa_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_opa_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd.arg("-w"); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("opa")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("opa")]; - crate::execution::run_tools(&commands, file_path, timeout, set_opa_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_opa_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ormolu.rs b/mdsf/src/tools/ormolu.rs index 07be2c43..3393d7f6 100644 --- a/mdsf/src/tools/ormolu.rs +++ b/mdsf/src/tools/ormolu.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ormolu_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ormolu_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--mode"); cmd.arg("inplace"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ormolu")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ormolu")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ormolu_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ormolu_args) } #[cfg(test)] diff --git a/mdsf/src/tools/oxlint.rs b/mdsf/src/tools/oxlint.rs index 35f96345..fd4b6b53 100644 --- a/mdsf/src/tools/oxlint.rs +++ b/mdsf/src/tools/oxlint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_oxlint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_oxlint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("oxlint"), - CommandType::Direct("oxlint"), - CommandType::Npm("oxlint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("oxlint"), + CommandType::Direct("oxlint"), + CommandType::Npm("oxlint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_oxlint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_oxlint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/packer_fix.rs b/mdsf/src/tools/packer_fix.rs index 243a12df..457152c6 100644 --- a/mdsf/src/tools/packer_fix.rs +++ b/mdsf/src/tools/packer_fix.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_packer_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_packer_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("packer")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("packer")]; - crate::execution::run_tools(&commands, file_path, timeout, set_packer_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_packer_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/packer_fmt.rs b/mdsf/src/tools/packer_fmt.rs index d63cbb3e..d6020e0c 100644 --- a/mdsf/src/tools/packer_fmt.rs +++ b/mdsf/src/tools/packer_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_packer_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_packer_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("packer")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("packer")]; - crate::execution::run_tools(&commands, file_path, timeout, set_packer_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_packer_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/perltidy.rs b/mdsf/src/tools/perltidy.rs index 847cec81..83a57827 100644 --- a/mdsf/src/tools/perltidy.rs +++ b/mdsf/src/tools/perltidy.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_perltidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_perltidy_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-b"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("perltidy")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("perltidy")]; - crate::execution::run_tools(&commands, file_path, timeout, set_perltidy_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_perltidy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pg_format.rs b/mdsf/src/tools/pg_format.rs index 1c685457..a0c32c5e 100644 --- a/mdsf/src/tools/pg_format.rs +++ b/mdsf/src/tools/pg_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_pg_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_pg_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--inplace"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("pg_format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("pg_format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_pg_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pg_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/php_cs_fixer_fix.rs b/mdsf/src/tools/php_cs_fixer_fix.rs index eca8e1ae..e952fc5b 100644 --- a/mdsf/src/tools/php_cs_fixer_fix.rs +++ b/mdsf/src/tools/php_cs_fixer_fix.rs @@ -1,25 +1,29 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_php_cs_fixer_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_php_cs_fixer_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::PhpVendor("php-cs-fixer"), - CommandType::Direct("php-cs-fixer"), - ]; +const COMMANDS: [CommandType; 2] = [ + CommandType::PhpVendor("php-cs-fixer"), + CommandType::Direct("php-cs-fixer"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_php_cs_fixer_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_php_cs_fixer_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/phpcbf.rs b/mdsf/src/tools/phpcbf.rs index 4c58cf52..3c7ac822 100644 --- a/mdsf/src/tools/phpcbf.rs +++ b/mdsf/src/tools/phpcbf.rs @@ -1,24 +1,28 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_phpcbf_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_phpcbf_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::PhpVendor("phpcbf"), - CommandType::Direct("phpcbf"), - ]; +const COMMANDS: [CommandType; 2] = [ + CommandType::PhpVendor("phpcbf"), + CommandType::Direct("phpcbf"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_phpcbf_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_phpcbf_args) } #[cfg(test)] diff --git a/mdsf/src/tools/phpinsights_fix.rs b/mdsf/src/tools/phpinsights_fix.rs index 7401b16b..76e7c4bf 100644 --- a/mdsf/src/tools/phpinsights_fix.rs +++ b/mdsf/src/tools/phpinsights_fix.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_phpinsights_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_phpinsights_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd.arg("--no-interaction"); @@ -14,14 +15,17 @@ fn set_phpinsights_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Co cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::PhpVendor("phpinsights"), - CommandType::Direct("phpinsights"), - ]; +const COMMANDS: [CommandType; 2] = [ + CommandType::PhpVendor("phpinsights"), + CommandType::Direct("phpinsights"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_phpinsights_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_phpinsights_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pint.rs b/mdsf/src/tools/pint.rs index df71c0dd..92a4f40d 100644 --- a/mdsf/src/tools/pint.rs +++ b/mdsf/src/tools/pint.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_pint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_pint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::PhpVendor("pint"), CommandType::Direct("pint")]; +const COMMANDS: [CommandType; 2] = [CommandType::PhpVendor("pint"), CommandType::Direct("pint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_pint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/prettier.rs b/mdsf/src/tools/prettier.rs index b4c88ace..d12ef6d4 100644 --- a/mdsf/src/tools/prettier.rs +++ b/mdsf/src/tools/prettier.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_prettier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_prettier_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--embedded-language-formatting"); cmd.arg("off"); cmd.arg("--log-level"); @@ -16,15 +17,18 @@ fn set_prettier_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("prettier"), - CommandType::Direct("prettier"), - CommandType::Npm("prettier"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("prettier"), + CommandType::Direct("prettier"), + CommandType::Npm("prettier"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_prettier_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_prettier_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pretty_php.rs b/mdsf/src/tools/pretty_php.rs index 7b3bb4c1..ca82c540 100644 --- a/mdsf/src/tools/pretty_php.rs +++ b/mdsf/src/tools/pretty_php.rs @@ -1,24 +1,28 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_pretty_php_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_pretty_php_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::PhpVendor("pretty-php"), - CommandType::Direct("pretty-php"), - ]; +const COMMANDS: [CommandType; 2] = [ + CommandType::PhpVendor("pretty-php"), + CommandType::Direct("pretty-php"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_pretty_php_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pretty_php_args) } #[cfg(test)] diff --git a/mdsf/src/tools/prettypst.rs b/mdsf/src/tools/prettypst.rs index 7c8bc419..9e9f6499 100644 --- a/mdsf/src/tools/prettypst.rs +++ b/mdsf/src/tools/prettypst.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_prettypst_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_prettypst_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("prettypst")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("prettypst")]; - crate::execution::run_tools(&commands, file_path, timeout, set_prettypst_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_prettypst_args) } #[cfg(test)] diff --git a/mdsf/src/tools/prisma_format.rs b/mdsf/src/tools/prisma_format.rs index 55eb7781..c04852d2 100644 --- a/mdsf/src/tools/prisma_format.rs +++ b/mdsf/src/tools/prisma_format.rs @@ -1,27 +1,31 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_prisma_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_prisma_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); let fps = file_path.to_string_lossy(); cmd.arg(format!("--schema={fps}")); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("prisma"), - CommandType::Direct("prisma"), - CommandType::Npm("prisma"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("prisma"), + CommandType::Direct("prisma"), + CommandType::Npm("prisma"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_prisma_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_prisma_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/protolint.rs b/mdsf/src/tools/protolint.rs index 27da7f87..1b794909 100644 --- a/mdsf/src/tools/protolint.rs +++ b/mdsf/src/tools/protolint.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_protolint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_protolint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg("-fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("protolint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("protolint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_protolint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_protolint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ptop.rs b/mdsf/src/tools/ptop.rs index 70548e66..9720520f 100644 --- a/mdsf/src/tools/ptop.rs +++ b/mdsf/src/tools/ptop.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ptop_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ptop_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ptop")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ptop")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ptop_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ptop_args) } #[cfg(test)] diff --git a/mdsf/src/tools/puppet_lint.rs b/mdsf/src/tools/puppet_lint.rs index d753d6b8..306c0322 100644 --- a/mdsf/src/tools/puppet_lint.rs +++ b/mdsf/src/tools/puppet_lint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_puppet_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_puppet_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("puppet-lint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("puppet-lint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_puppet_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_puppet_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/purs_tidy.rs b/mdsf/src/tools/purs_tidy.rs index 4f343465..ff720006 100644 --- a/mdsf/src/tools/purs_tidy.rs +++ b/mdsf/src/tools/purs_tidy.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_purs_tidy_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_purs_tidy_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format-in-place"); cmd.arg(file_path); cmd } +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("purs-tidy"), + CommandType::Direct("purs-tidy"), + CommandType::Npm("purs-tidy"), +]; + #[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("purs-tidy"), - CommandType::Direct("purs-tidy"), - CommandType::Npm("purs-tidy"), - ]; - - crate::execution::run_tools(&commands, file_path, timeout, set_purs_tidy_args) +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_purs_tidy_args) } #[cfg(test)] diff --git a/mdsf/src/tools/purty.rs b/mdsf/src/tools/purty.rs index 8e33dc8e..175cf360 100644 --- a/mdsf/src/tools/purty.rs +++ b/mdsf/src/tools/purty.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_purty_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_purty_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("purty"), - CommandType::Direct("purty"), - CommandType::Npm("purty"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("purty"), + CommandType::Direct("purty"), + CommandType::Npm("purty"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_purty_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_purty_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pycln.rs b/mdsf/src/tools/pycln.rs index 926adeee..d9ed7170 100644 --- a/mdsf/src/tools/pycln.rs +++ b/mdsf/src/tools/pycln.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_pycln_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_pycln_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--no-gitignore"); cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("pycln")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("pycln")]; - crate::execution::run_tools(&commands, file_path, timeout, set_pycln_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pycln_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pycodestyle.rs b/mdsf/src/tools/pycodestyle.rs index 9246491e..15a9c4f4 100644 --- a/mdsf/src/tools/pycodestyle.rs +++ b/mdsf/src/tools/pycodestyle.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_pycodestyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_pycodestyle_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("pycodestyle")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("pycodestyle")]; - crate::execution::run_tools(&commands, file_path, timeout, set_pycodestyle_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pycodestyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pyink.rs b/mdsf/src/tools/pyink.rs index 2f217bf4..22a03126 100644 --- a/mdsf/src/tools/pyink.rs +++ b/mdsf/src/tools/pyink.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_pyink_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_pyink_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("pyink")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("pyink")]; - crate::execution::run_tools(&commands, file_path, timeout, set_pyink_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pyink_args) } #[cfg(test)] diff --git a/mdsf/src/tools/pyment.rs b/mdsf/src/tools/pyment.rs index 0415082a..1a27c89d 100644 --- a/mdsf/src/tools/pyment.rs +++ b/mdsf/src/tools/pyment.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_pyment_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_pyment_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("pyment")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("pyment")]; - crate::execution::run_tools(&commands, file_path, timeout, set_pyment_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pyment_args) } #[cfg(test)] diff --git a/mdsf/src/tools/qmlfmt.rs b/mdsf/src/tools/qmlfmt.rs index 1a0d9b3e..26b8db58 100644 --- a/mdsf/src/tools/qmlfmt.rs +++ b/mdsf/src/tools/qmlfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_qmlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_qmlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("qmlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("qmlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_qmlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_qmlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/quick_lint_js.rs b/mdsf/src/tools/quick_lint_js.rs index fea7566b..3aee8090 100644 --- a/mdsf/src/tools/quick_lint_js.rs +++ b/mdsf/src/tools/quick_lint_js.rs @@ -1,25 +1,29 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_quick_lint_js_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_quick_lint_js_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("quick-lint-js"), - CommandType::Direct("quick-lint-js"), - CommandType::Npm("quick-lint-js"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("quick-lint-js"), + CommandType::Direct("quick-lint-js"), + CommandType::Npm("quick-lint-js"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_quick_lint_js_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_quick_lint_js_args) } #[cfg(test)] diff --git a/mdsf/src/tools/raco_fmt.rs b/mdsf/src/tools/raco_fmt.rs index 293b4070..d1f95d87 100644 --- a/mdsf/src/tools/raco_fmt.rs +++ b/mdsf/src/tools/raco_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_raco_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_raco_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("raco")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("raco")]; - crate::execution::run_tools(&commands, file_path, timeout, set_raco_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_raco_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/refmt.rs b/mdsf/src/tools/refmt.rs index 1999b983..6608ab14 100644 --- a/mdsf/src/tools/refmt.rs +++ b/mdsf/src/tools/refmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_refmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_refmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--in-place"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("refmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("refmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_refmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_refmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/reformat_gherkin.rs b/mdsf/src/tools/reformat_gherkin.rs index 34509fb3..37b9b670 100644 --- a/mdsf/src/tools/reformat_gherkin.rs +++ b/mdsf/src/tools/reformat_gherkin.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_reformat_gherkin_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_reformat_gherkin_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("reformat-gherkin")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("reformat-gherkin")]; - crate::execution::run_tools(&commands, file_path, timeout, set_reformat_gherkin_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_reformat_gherkin_args) } #[cfg(test)] diff --git a/mdsf/src/tools/regal_fix.rs b/mdsf/src/tools/regal_fix.rs index 60d8af69..4e8dd50e 100644 --- a/mdsf/src/tools/regal_fix.rs +++ b/mdsf/src/tools/regal_fix.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_regal_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_regal_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("regal")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("regal")]; - crate::execution::run_tools(&commands, file_path, timeout, set_regal_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_regal_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/regal_lint.rs b/mdsf/src/tools/regal_lint.rs index 39d7359f..044cce09 100644 --- a/mdsf/src/tools/regal_lint.rs +++ b/mdsf/src/tools/regal_lint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_regal_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_regal_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("regal")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("regal")]; - crate::execution::run_tools(&commands, file_path, timeout, set_regal_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_regal_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/reorder_python_imports.rs b/mdsf/src/tools/reorder_python_imports.rs index 5f46bf92..7e61bd1a 100644 --- a/mdsf/src/tools/reorder_python_imports.rs +++ b/mdsf/src/tools/reorder_python_imports.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_reorder_python_imports_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_reorder_python_imports_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("reorder-python-imports")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("reorder-python-imports")]; +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { crate::execution::run_tools( - &commands, + &COMMANDS, file_path, timeout, set_reorder_python_imports_args, diff --git a/mdsf/src/tools/rescript_format.rs b/mdsf/src/tools/rescript_format.rs index d833761e..b2271dc7 100644 --- a/mdsf/src/tools/rescript_format.rs +++ b/mdsf/src/tools/rescript_format.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rescript_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rescript_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("rescript"), - CommandType::Direct("rescript"), - CommandType::Npm("rescript"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("rescript"), + CommandType::Direct("rescript"), + CommandType::Npm("rescript"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_rescript_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rescript_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/roc_format.rs b/mdsf/src/tools/roc_format.rs index adf44d87..0050a965 100644 --- a/mdsf/src/tools/roc_format.rs +++ b/mdsf/src/tools/roc_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_roc_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_roc_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("roc")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("roc")]; - crate::execution::run_tools(&commands, file_path, timeout, set_roc_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_roc_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rstfmt.rs b/mdsf/src/tools/rstfmt.rs index ee85fca8..db30c277 100644 --- a/mdsf/src/tools/rstfmt.rs +++ b/mdsf/src/tools/rstfmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rstfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rstfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("rstfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("rstfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_rstfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rstfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rubocop.rs b/mdsf/src/tools/rubocop.rs index 742f55c4..d56cd07b 100644 --- a/mdsf/src/tools/rubocop.rs +++ b/mdsf/src/tools/rubocop.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rubocop_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rubocop_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix-layout"); cmd.arg("--autocorrect"); cmd.arg("--format"); @@ -15,11 +16,14 @@ fn set_rubocop_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("rubocop")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("rubocop")]; - crate::execution::run_tools(&commands, file_path, timeout, set_rubocop_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rubocop_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rubyfmt.rs b/mdsf/src/tools/rubyfmt.rs index a0c3175b..0437962c 100644 --- a/mdsf/src/tools/rubyfmt.rs +++ b/mdsf/src/tools/rubyfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rubyfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rubyfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("rubyfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("rubyfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_rubyfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rubyfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ruff_check.rs b/mdsf/src/tools/ruff_check.rs index b646ff81..34adde30 100644 --- a/mdsf/src/tools/ruff_check.rs +++ b/mdsf/src/tools/ruff_check.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ruff_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ruff_check_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("check"); cmd.arg("--fix"); cmd.arg("--quiet"); @@ -14,11 +15,14 @@ fn set_ruff_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ruff")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ruff")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ruff_check_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ruff_check_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ruff_format.rs b/mdsf/src/tools/ruff_format.rs index 3f597495..958183d7 100644 --- a/mdsf/src/tools/ruff_format.rs +++ b/mdsf/src/tools/ruff_format.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ruff_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ruff_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ruff")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ruff")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ruff_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ruff_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rufo.rs b/mdsf/src/tools/rufo.rs index 0332d232..b8e08401 100644 --- a/mdsf/src/tools/rufo.rs +++ b/mdsf/src/tools/rufo.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rufo_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rufo_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--simple-exit"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("rufo")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("rufo")]; - crate::execution::run_tools(&commands, file_path, timeout, set_rufo_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rufo_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rune_fmt.rs b/mdsf/src/tools/rune_fmt.rs index 8b9492c5..e6cc06fa 100644 --- a/mdsf/src/tools/rune_fmt.rs +++ b/mdsf/src/tools/rune_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rune_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rune_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("rune")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("rune")]; - crate::execution::run_tools(&commands, file_path, timeout, set_rune_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rune_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rustfmt.rs b/mdsf/src/tools/rustfmt.rs index c688fbe1..45ca4b23 100644 --- a/mdsf/src/tools/rustfmt.rs +++ b/mdsf/src/tools/rustfmt.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rustfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rustfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--edition"); cmd.arg("2021"); cmd.arg("--quiet"); @@ -14,11 +15,14 @@ fn set_rustfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("rustfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("rustfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_rustfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rustfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/rustywind.rs b/mdsf/src/tools/rustywind.rs index 21b89cc5..57e2ed1e 100644 --- a/mdsf/src/tools/rustywind.rs +++ b/mdsf/src/tools/rustywind.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_rustywind_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_rustywind_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("rustywind")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("rustywind")]; - crate::execution::run_tools(&commands, file_path, timeout, set_rustywind_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rustywind_args) } #[cfg(test)] diff --git a/mdsf/src/tools/salt_lint.rs b/mdsf/src/tools/salt_lint.rs index 25ce267a..4dc626da 100644 --- a/mdsf/src/tools/salt_lint.rs +++ b/mdsf/src/tools/salt_lint.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_salt_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_salt_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("salt-lint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("salt-lint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_salt_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_salt_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/scalafmt.rs b/mdsf/src/tools/scalafmt.rs index a6893d35..4a1fc45e 100644 --- a/mdsf/src/tools/scalafmt.rs +++ b/mdsf/src/tools/scalafmt.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_scalafmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_scalafmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg("--mode"); cmd.arg("any"); @@ -14,11 +15,14 @@ fn set_scalafmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("scalafmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("scalafmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_scalafmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_scalafmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/scalariform.rs b/mdsf/src/tools/scalariform.rs index 8cde0fc9..b514f497 100644 --- a/mdsf/src/tools/scalariform.rs +++ b/mdsf/src/tools/scalariform.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_scalariform_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_scalariform_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("scalariform")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("scalariform")]; - crate::execution::run_tools(&commands, file_path, timeout, set_scalariform_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_scalariform_args) } #[cfg(test)] diff --git a/mdsf/src/tools/selene.rs b/mdsf/src/tools/selene.rs index 10d67aac..d6d79179 100644 --- a/mdsf/src/tools/selene.rs +++ b/mdsf/src/tools/selene.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_selene_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_selene_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("selene")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("selene")]; - crate::execution::run_tools(&commands, file_path, timeout, set_selene_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_selene_args) } #[cfg(test)] diff --git a/mdsf/src/tools/shellcheck.rs b/mdsf/src/tools/shellcheck.rs index ba6d0c71..436e0645 100644 --- a/mdsf/src/tools/shellcheck.rs +++ b/mdsf/src/tools/shellcheck.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_shellcheck_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_shellcheck_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("shellcheck")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("shellcheck")]; - crate::execution::run_tools(&commands, file_path, timeout, set_shellcheck_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_shellcheck_args) } #[cfg(test)] diff --git a/mdsf/src/tools/shellharden.rs b/mdsf/src/tools/shellharden.rs index de9bce8f..077ded2b 100644 --- a/mdsf/src/tools/shellharden.rs +++ b/mdsf/src/tools/shellharden.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_shellharden_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_shellharden_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--transform"); cmd.arg("--replace"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("shellharden")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("shellharden")]; - crate::execution::run_tools(&commands, file_path, timeout, set_shellharden_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_shellharden_args) } #[cfg(test)] diff --git a/mdsf/src/tools/shfmt.rs b/mdsf/src/tools/shfmt.rs index 19d9d3bb..92b570d5 100644 --- a/mdsf/src/tools/shfmt.rs +++ b/mdsf/src/tools/shfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_shfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_shfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--write"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("shfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("shfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_shfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_shfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sleek.rs b/mdsf/src/tools/sleek.rs index 8feb0878..98c15a00 100644 --- a/mdsf/src/tools/sleek.rs +++ b/mdsf/src/tools/sleek.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_sleek_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_sleek_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("sleek")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("sleek")]; - crate::execution::run_tools(&commands, file_path, timeout, set_sleek_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sleek_args) } #[cfg(test)] diff --git a/mdsf/src/tools/smlfmt.rs b/mdsf/src/tools/smlfmt.rs index 783b2f1a..6458ef3b 100644 --- a/mdsf/src/tools/smlfmt.rs +++ b/mdsf/src/tools/smlfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_smlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_smlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--force"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("smlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("smlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_smlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_smlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/snakefmt.rs b/mdsf/src/tools/snakefmt.rs index 09b144e9..5d571bc1 100644 --- a/mdsf/src/tools/snakefmt.rs +++ b/mdsf/src/tools/snakefmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_snakefmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_snakefmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("snakefmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("snakefmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_snakefmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_snakefmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/solhint.rs b/mdsf/src/tools/solhint.rs index f948fb08..f2dab03f 100644 --- a/mdsf/src/tools/solhint.rs +++ b/mdsf/src/tools/solhint.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_solhint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_solhint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg("--fix"); cmd.arg("--noPrompt"); @@ -14,15 +15,18 @@ fn set_solhint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("solhint"), - CommandType::Direct("solhint"), - CommandType::Npm("solhint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("solhint"), + CommandType::Direct("solhint"), + CommandType::Npm("solhint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_solhint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_solhint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sql_formatter.rs b/mdsf/src/tools/sql_formatter.rs index 03bf4e0f..7c02c141 100644 --- a/mdsf/src/tools/sql_formatter.rs +++ b/mdsf/src/tools/sql_formatter.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_sql_formatter_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_sql_formatter_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("sql-formatter"), - CommandType::Direct("sql-formatter"), - CommandType::Npm("sql-formatter"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("sql-formatter"), + CommandType::Direct("sql-formatter"), + CommandType::Npm("sql-formatter"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_sql_formatter_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sql_formatter_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sqlfluff_fix.rs b/mdsf/src/tools/sqlfluff_fix.rs index fc9bed31..ff0cc21e 100644 --- a/mdsf/src/tools/sqlfluff_fix.rs +++ b/mdsf/src/tools/sqlfluff_fix.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_sqlfluff_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_sqlfluff_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg("--dialect"); cmd.arg("ansi"); @@ -14,11 +15,14 @@ fn set_sqlfluff_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Comma cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("sqlfluff")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfluff")]; - crate::execution::run_tools(&commands, file_path, timeout, set_sqlfluff_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqlfluff_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sqlfluff_format.rs b/mdsf/src/tools/sqlfluff_format.rs index 7f446de5..a10a4d7c 100644 --- a/mdsf/src/tools/sqlfluff_format.rs +++ b/mdsf/src/tools/sqlfluff_format.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_sqlfluff_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_sqlfluff_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg("--dialect"); cmd.arg("ansi"); @@ -14,11 +15,14 @@ fn set_sqlfluff_format_args(mut cmd: Command, file_path: &std::path::Path) -> Co cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("sqlfluff")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfluff")]; - crate::execution::run_tools(&commands, file_path, timeout, set_sqlfluff_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqlfluff_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sqlfmt.rs b/mdsf/src/tools/sqlfmt.rs index 8de6d81b..8f13a7c6 100644 --- a/mdsf/src/tools/sqlfmt.rs +++ b/mdsf/src/tools/sqlfmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_sqlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_sqlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("sqlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_sqlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/sqruff.rs b/mdsf/src/tools/sqruff.rs index 8ce41129..cb101a38 100644 --- a/mdsf/src/tools/sqruff.rs +++ b/mdsf/src/tools/sqruff.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_sqruff_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_sqruff_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("sqruff")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqruff")]; - crate::execution::run_tools(&commands, file_path, timeout, set_sqruff_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqruff_args) } #[cfg(test)] diff --git a/mdsf/src/tools/standardjs.rs b/mdsf/src/tools/standardjs.rs index 0472b928..07d6ce7b 100644 --- a/mdsf/src/tools/standardjs.rs +++ b/mdsf/src/tools/standardjs.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_standardjs_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_standardjs_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("standard"), - CommandType::Direct("standard"), - CommandType::Npm("standard"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("standard"), + CommandType::Direct("standard"), + CommandType::Npm("standard"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_standardjs_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_standardjs_args) } #[cfg(test)] diff --git a/mdsf/src/tools/standardrb.rs b/mdsf/src/tools/standardrb.rs index dcca3745..1abd5780 100644 --- a/mdsf/src/tools/standardrb.rs +++ b/mdsf/src/tools/standardrb.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_standardrb_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_standardrb_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("standardrb")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("standardrb")]; - crate::execution::run_tools(&commands, file_path, timeout, set_standardrb_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_standardrb_args) } #[cfg(test)] diff --git a/mdsf/src/tools/statix_check.rs b/mdsf/src/tools/statix_check.rs index 3557a46b..8003da17 100644 --- a/mdsf/src/tools/statix_check.rs +++ b/mdsf/src/tools/statix_check.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_statix_check_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_statix_check_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("check"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("statix")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("statix")]; - crate::execution::run_tools(&commands, file_path, timeout, set_statix_check_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_statix_check_args) } #[cfg(test)] diff --git a/mdsf/src/tools/statix_fix.rs b/mdsf/src/tools/statix_fix.rs index 1fae577f..2096be47 100644 --- a/mdsf/src/tools/statix_fix.rs +++ b/mdsf/src/tools/statix_fix.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_statix_fix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_statix_fix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("statix")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("statix")]; - crate::execution::run_tools(&commands, file_path, timeout, set_statix_fix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_statix_fix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/stylefmt.rs b/mdsf/src/tools/stylefmt.rs index aa49b210..7729da29 100644 --- a/mdsf/src/tools/stylefmt.rs +++ b/mdsf/src/tools/stylefmt.rs @@ -1,25 +1,29 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_stylefmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_stylefmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("stylefmt"), + CommandType::Direct("stylefmt"), + CommandType::Npm("stylefmt"), +]; + #[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("stylefmt"), - CommandType::Direct("stylefmt"), - CommandType::Npm("stylefmt"), - ]; - - crate::execution::run_tools(&commands, file_path, timeout, set_stylefmt_args) +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylefmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/stylelint.rs b/mdsf/src/tools/stylelint.rs index 75d5d593..a943467a 100644 --- a/mdsf/src/tools/stylelint.rs +++ b/mdsf/src/tools/stylelint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_stylelint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_stylelint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("stylelint"), - CommandType::Direct("stylelint"), - CommandType::Npm("stylelint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("stylelint"), + CommandType::Direct("stylelint"), + CommandType::Npm("stylelint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_stylelint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylelint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/stylish_haskell.rs b/mdsf/src/tools/stylish_haskell.rs index d71ba791..556d8fd3 100644 --- a/mdsf/src/tools/stylish_haskell.rs +++ b/mdsf/src/tools/stylish_haskell.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_stylish_haskell_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_stylish_haskell_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--inplace"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("stylish-haskell")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("stylish-haskell")]; - crate::execution::run_tools(&commands, file_path, timeout, set_stylish_haskell_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylish_haskell_args) } #[cfg(test)] diff --git a/mdsf/src/tools/stylua.rs b/mdsf/src/tools/stylua.rs index 3003e89c..8f42dca3 100644 --- a/mdsf/src/tools/stylua.rs +++ b/mdsf/src/tools/stylua.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_stylua_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_stylua_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--verify"); cmd.arg(file_path); cmd } +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("stylua"), + CommandType::Direct("stylua"), + CommandType::Npm("@johnnymorganz/stylua-bin"), +]; + #[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("stylua"), - CommandType::Direct("stylua"), - CommandType::Npm("@johnnymorganz/stylua-bin"), - ]; - - crate::execution::run_tools(&commands, file_path, timeout, set_stylua_args) +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylua_args) } #[cfg(test)] diff --git a/mdsf/src/tools/superhtml_fmt.rs b/mdsf/src/tools/superhtml_fmt.rs index b7d6589f..8f19b54a 100644 --- a/mdsf/src/tools/superhtml_fmt.rs +++ b/mdsf/src/tools/superhtml_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_superhtml_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_superhtml_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("superhtml")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("superhtml")]; - crate::execution::run_tools(&commands, file_path, timeout, set_superhtml_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_superhtml_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/swift_format.rs b/mdsf/src/tools/swift_format.rs index f0741562..87b540e1 100644 --- a/mdsf/src/tools/swift_format.rs +++ b/mdsf/src/tools/swift_format.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_swift_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_swift_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--in-place"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("swift-format")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("swift-format")]; - crate::execution::run_tools(&commands, file_path, timeout, set_swift_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_swift_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/swiftformat.rs b/mdsf/src/tools/swiftformat.rs index c6f1bc9f..8afc1b49 100644 --- a/mdsf/src/tools/swiftformat.rs +++ b/mdsf/src/tools/swiftformat.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_swiftformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_swiftformat_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("swiftformat")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("swiftformat")]; - crate::execution::run_tools(&commands, file_path, timeout, set_swiftformat_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_swiftformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/taplo.rs b/mdsf/src/tools/taplo.rs index 5e7ad813..6ccf4c81 100644 --- a/mdsf/src/tools/taplo.rs +++ b/mdsf/src/tools/taplo.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_taplo_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_taplo_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("taplo"), - CommandType::Direct("taplo"), - CommandType::Npm("@taplo/cli"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("taplo"), + CommandType::Direct("taplo"), + CommandType::Npm("@taplo/cli"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_taplo_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_taplo_args) } #[cfg(test)] diff --git a/mdsf/src/tools/templ_fmt.rs b/mdsf/src/tools/templ_fmt.rs index 9b6df417..3d38c347 100644 --- a/mdsf/src/tools/templ_fmt.rs +++ b/mdsf/src/tools/templ_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_templ_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_templ_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("templ")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("templ")]; - crate::execution::run_tools(&commands, file_path, timeout, set_templ_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_templ_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/terraform_fmt.rs b/mdsf/src/tools/terraform_fmt.rs index 5df808df..42f0df75 100644 --- a/mdsf/src/tools/terraform_fmt.rs +++ b/mdsf/src/tools/terraform_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_terraform_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_terraform_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("-write=true"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("terraform")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("terraform")]; - crate::execution::run_tools(&commands, file_path, timeout, set_terraform_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_terraform_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/terragrunt_hclfmt.rs b/mdsf/src/tools/terragrunt_hclfmt.rs index 4ef35307..ee464d0c 100644 --- a/mdsf/src/tools/terragrunt_hclfmt.rs +++ b/mdsf/src/tools/terragrunt_hclfmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_terragrunt_hclfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_terragrunt_hclfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("hclfmt"); cmd.arg("--terragrunt-hclfmt-file"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("terragrunt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("terragrunt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_terragrunt_hclfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_terragrunt_hclfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/tex_fmt.rs b/mdsf/src/tools/tex_fmt.rs index 9d907a5d..7a2c6959 100644 --- a/mdsf/src/tools/tex_fmt.rs +++ b/mdsf/src/tools/tex_fmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_tex_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_tex_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("tex-fmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("tex-fmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_tex_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tex_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/tlint_format.rs b/mdsf/src/tools/tlint_format.rs index 3d80658a..e42d510e 100644 --- a/mdsf/src/tools/tlint_format.rs +++ b/mdsf/src/tools/tlint_format.rs @@ -1,25 +1,29 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_tlint_format_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_tlint_format_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::PhpVendor("tlint"), - CommandType::Direct("tlint"), - ]; +const COMMANDS: [CommandType; 2] = [ + CommandType::PhpVendor("tlint"), + CommandType::Direct("tlint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_tlint_format_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tlint_format_args) } #[cfg(test)] diff --git a/mdsf/src/tools/tofu_fmt.rs b/mdsf/src/tools/tofu_fmt.rs index 6e383e7c..145865a0 100644 --- a/mdsf/src/tools/tofu_fmt.rs +++ b/mdsf/src/tools/tofu_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_tofu_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_tofu_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("-write=true"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("tofu")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("tofu")]; - crate::execution::run_tools(&commands, file_path, timeout, set_tofu_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tofu_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/toml_sort.rs b/mdsf/src/tools/toml_sort.rs index 2c6e92a9..f5cf23c5 100644 --- a/mdsf/src/tools/toml_sort.rs +++ b/mdsf/src/tools/toml_sort.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_toml_sort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_toml_sort_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("toml-sort")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("toml-sort")]; - crate::execution::run_tools(&commands, file_path, timeout, set_toml_sort_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_toml_sort_args) } #[cfg(test)] diff --git a/mdsf/src/tools/topiary.rs b/mdsf/src/tools/topiary.rs index 64936f6b..f8efdc44 100644 --- a/mdsf/src/tools/topiary.rs +++ b/mdsf/src/tools/topiary.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_topiary_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_topiary_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("topiary")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("topiary")]; - crate::execution::run_tools(&commands, file_path, timeout, set_topiary_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_topiary_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ts_standard.rs b/mdsf/src/tools/ts_standard.rs index b9c0b513..e2173fae 100644 --- a/mdsf/src/tools/ts_standard.rs +++ b/mdsf/src/tools/ts_standard.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ts_standard_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ts_standard_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("ts-standard"), - CommandType::Direct("ts-standard"), - CommandType::Npm("ts-standard"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("ts-standard"), + CommandType::Direct("ts-standard"), + CommandType::Npm("ts-standard"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_ts_standard_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ts_standard_args) } #[cfg(test)] diff --git a/mdsf/src/tools/tsqllint.rs b/mdsf/src/tools/tsqllint.rs index 1e1d4bfd..be01954b 100644 --- a/mdsf/src/tools/tsqllint.rs +++ b/mdsf/src/tools/tsqllint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_tsqllint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_tsqllint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("tsqllint"), - CommandType::Direct("tsqllint"), - CommandType::Npm("tsqllint"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("tsqllint"), + CommandType::Direct("tsqllint"), + CommandType::Npm("tsqllint"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_tsqllint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tsqllint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/twig_cs_fixer_lint.rs b/mdsf/src/tools/twig_cs_fixer_lint.rs index 2fcfd6d7..79c04d29 100644 --- a/mdsf/src/tools/twig_cs_fixer_lint.rs +++ b/mdsf/src/tools/twig_cs_fixer_lint.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_twig_cs_fixer_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_twig_cs_fixer_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg(file_path); cmd.arg("--fix"); @@ -15,14 +16,17 @@ fn set_twig_cs_fixer_lint_args(mut cmd: Command, file_path: &std::path::Path) -> cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::PhpVendor("twig-cs-fixer"), - CommandType::Direct("twig-cs-fixer"), - ]; +const COMMANDS: [CommandType; 2] = [ + CommandType::PhpVendor("twig-cs-fixer"), + CommandType::Direct("twig-cs-fixer"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_twig_cs_fixer_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_twig_cs_fixer_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/typos.rs b/mdsf/src/tools/typos.rs index 4df91936..aeac8175 100644 --- a/mdsf/src/tools/typos.rs +++ b/mdsf/src/tools/typos.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_typos_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_typos_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg("--no-ignore"); cmd.arg("--hidden"); @@ -14,11 +15,14 @@ fn set_typos_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("typos")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("typos")]; - crate::execution::run_tools(&commands, file_path, timeout, set_typos_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_typos_args) } #[cfg(test)] diff --git a/mdsf/src/tools/typstfmt.rs b/mdsf/src/tools/typstfmt.rs index 1b3af5cc..266c3f29 100644 --- a/mdsf/src/tools/typstfmt.rs +++ b/mdsf/src/tools/typstfmt.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_typstfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_typstfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("typstfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("typstfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_typstfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_typstfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/typstyle.rs b/mdsf/src/tools/typstyle.rs index 363e318f..c0a528f4 100644 --- a/mdsf/src/tools/typstyle.rs +++ b/mdsf/src/tools/typstyle.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_typstyle_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_typstyle_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-i"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("typstyle")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("typstyle")]; - crate::execution::run_tools(&commands, file_path, timeout, set_typstyle_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_typstyle_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ufmt.rs b/mdsf/src/tools/ufmt.rs index f9a5e5d6..c5db8e5f 100644 --- a/mdsf/src/tools/ufmt.rs +++ b/mdsf/src/tools/ufmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ufmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ufmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ufmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ufmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ufmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ufmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/uiua_fmt.rs b/mdsf/src/tools/uiua_fmt.rs index 17ece0f4..31a9d547 100644 --- a/mdsf/src/tools/uiua_fmt.rs +++ b/mdsf/src/tools/uiua_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_uiua_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_uiua_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("uiua")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("uiua")]; - crate::execution::run_tools(&commands, file_path, timeout, set_uiua_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_uiua_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/unimport.rs b/mdsf/src/tools/unimport.rs index 3bb7a9c0..ab15fcef 100644 --- a/mdsf/src/tools/unimport.rs +++ b/mdsf/src/tools/unimport.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_unimport_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_unimport_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-r"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("unimport")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("unimport")]; - crate::execution::run_tools(&commands, file_path, timeout, set_unimport_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_unimport_args) } #[cfg(test)] diff --git a/mdsf/src/tools/usort.rs b/mdsf/src/tools/usort.rs index d9bbce81..9922cd09 100644 --- a/mdsf/src/tools/usort.rs +++ b/mdsf/src/tools/usort.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_usort_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_usort_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("format"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("usort")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("usort")]; - crate::execution::run_tools(&commands, file_path, timeout, set_usort_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_usort_args) } #[cfg(test)] diff --git a/mdsf/src/tools/v_fmt.rs b/mdsf/src/tools/v_fmt.rs index 174bc074..07221e15 100644 --- a/mdsf/src/tools/v_fmt.rs +++ b/mdsf/src/tools/v_fmt.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_v_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_v_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("v")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("v")]; - crate::execution::run_tools(&commands, file_path, timeout, set_v_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_v_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/vacuum_lint.rs b/mdsf/src/tools/vacuum_lint.rs index 498e9a05..c7a197d8 100644 --- a/mdsf/src/tools/vacuum_lint.rs +++ b/mdsf/src/tools/vacuum_lint.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_vacuum_lint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_vacuum_lint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("lint"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("vacuum"), - CommandType::Direct("vacuum"), - CommandType::Npm("@quobix/vacuum"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("vacuum"), + CommandType::Direct("vacuum"), + CommandType::Npm("@quobix/vacuum"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_vacuum_lint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_vacuum_lint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/veryl_fmt.rs b/mdsf/src/tools/veryl_fmt.rs index c81d00e0..f6cc6192 100644 --- a/mdsf/src/tools/veryl_fmt.rs +++ b/mdsf/src/tools/veryl_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_veryl_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_veryl_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("veryl")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("veryl")]; - crate::execution::run_tools(&commands, file_path, timeout, set_veryl_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_veryl_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/vhdl_style_guide.rs b/mdsf/src/tools/vhdl_style_guide.rs index c0e6dd7f..52f64483 100644 --- a/mdsf/src/tools/vhdl_style_guide.rs +++ b/mdsf/src/tools/vhdl_style_guide.rs @@ -1,23 +1,27 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_vhdl_style_guide_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_vhdl_style_guide_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-f"); cmd.arg(file_path); cmd.arg("--fix"); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("vsg")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("vsg")]; - crate::execution::run_tools(&commands, file_path, timeout, set_vhdl_style_guide_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_vhdl_style_guide_args) } #[cfg(test)] diff --git a/mdsf/src/tools/wa_fmt.rs b/mdsf/src/tools/wa_fmt.rs index a04b263b..d12c4bbe 100644 --- a/mdsf/src/tools/wa_fmt.rs +++ b/mdsf/src/tools/wa_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_wa_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_wa_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("wa")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("wa")]; - crate::execution::run_tools(&commands, file_path, timeout, set_wa_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_wa_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/wfindent.rs b/mdsf/src/tools/wfindent.rs index 448572e4..4d5cf030 100644 --- a/mdsf/src/tools/wfindent.rs +++ b/mdsf/src/tools/wfindent.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_wfindent_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_wfindent_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("wfindent")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("wfindent")]; - crate::execution::run_tools(&commands, file_path, timeout, set_wfindent_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_wfindent_args) } #[cfg(test)] diff --git a/mdsf/src/tools/xmlformat.rs b/mdsf/src/tools/xmlformat.rs index 6531738c..7d824699 100644 --- a/mdsf/src/tools/xmlformat.rs +++ b/mdsf/src/tools/xmlformat.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_xmlformat_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_xmlformat_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--overwrite"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("xmlformat")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("xmlformat")]; - crate::execution::run_tools(&commands, file_path, timeout, set_xmlformat_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_xmlformat_args) } #[cfg(test)] diff --git a/mdsf/src/tools/xmllint.rs b/mdsf/src/tools/xmllint.rs index 2bac1783..6c1401b9 100644 --- a/mdsf/src/tools/xmllint.rs +++ b/mdsf/src/tools/xmllint.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_xmllint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_xmllint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--format"); cmd.arg(file_path); cmd.arg("--output"); @@ -14,11 +15,14 @@ fn set_xmllint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("xmllint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("xmllint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_xmllint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_xmllint_args) } #[cfg(test)] diff --git a/mdsf/src/tools/xo.rs b/mdsf/src/tools/xo.rs index c0fcf109..3f5c6678 100644 --- a/mdsf/src/tools/xo.rs +++ b/mdsf/src/tools/xo.rs @@ -1,26 +1,30 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_xo_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_xo_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--fix"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [ - CommandType::NodeModules("xo"), - CommandType::Direct("xo"), - CommandType::Npm("xo"), - ]; +const COMMANDS: [CommandType; 3] = [ + CommandType::NodeModules("xo"), + CommandType::Direct("xo"), + CommandType::Npm("xo"), +]; - crate::execution::run_tools(&commands, file_path, timeout, set_xo_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_xo_args) } #[cfg(test)] diff --git a/mdsf/src/tools/yamlfix.rs b/mdsf/src/tools/yamlfix.rs index 1a95a62f..3d82b313 100644 --- a/mdsf/src/tools/yamlfix.rs +++ b/mdsf/src/tools/yamlfix.rs @@ -1,21 +1,25 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_yamlfix_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_yamlfix_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("yamlfix")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("yamlfix")]; - crate::execution::run_tools(&commands, file_path, timeout, set_yamlfix_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yamlfix_args) } #[cfg(test)] diff --git a/mdsf/src/tools/yamlfmt.rs b/mdsf/src/tools/yamlfmt.rs index 6395abc4..ad246f4a 100644 --- a/mdsf/src/tools/yamlfmt.rs +++ b/mdsf/src/tools/yamlfmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_yamlfmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_yamlfmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-quiet"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("yamlfmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("yamlfmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_yamlfmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yamlfmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/yapf.rs b/mdsf/src/tools/yapf.rs index 71bc67a2..580562c1 100644 --- a/mdsf/src/tools/yapf.rs +++ b/mdsf/src/tools/yapf.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_yapf_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_yapf_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--in-place"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("yapf")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("yapf")]; - crate::execution::run_tools(&commands, file_path, timeout, set_yapf_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yapf_args) } #[cfg(test)] diff --git a/mdsf/src/tools/yew_fmt.rs b/mdsf/src/tools/yew_fmt.rs index 729e37c2..43960b07 100644 --- a/mdsf/src/tools/yew_fmt.rs +++ b/mdsf/src/tools/yew_fmt.rs @@ -1,12 +1,13 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_yew_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_yew_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("--edition"); cmd.arg("2021"); cmd.arg("--quiet"); @@ -14,11 +15,14 @@ fn set_yew_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("yew-fmt")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("yew-fmt")]; - crate::execution::run_tools(&commands, file_path, timeout, set_yew_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yew_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/zig_fmt.rs b/mdsf/src/tools/zig_fmt.rs index bf69eeee..a81b16d1 100644 --- a/mdsf/src/tools/zig_fmt.rs +++ b/mdsf/src/tools/zig_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_zig_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_zig_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("zig")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("zig")]; - crate::execution::run_tools(&commands, file_path, timeout, set_zig_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_zig_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/ziggy_fmt.rs b/mdsf/src/tools/ziggy_fmt.rs index 599c5636..1b485729 100644 --- a/mdsf/src/tools/ziggy_fmt.rs +++ b/mdsf/src/tools/ziggy_fmt.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_ziggy_fmt_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_ziggy_fmt_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("fmt"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("ziggy")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("ziggy")]; - crate::execution::run_tools(&commands, file_path, timeout, set_ziggy_fmt_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ziggy_fmt_args) } #[cfg(test)] diff --git a/mdsf/src/tools/zprint.rs b/mdsf/src/tools/zprint.rs index 2c682803..395357a1 100644 --- a/mdsf/src/tools/zprint.rs +++ b/mdsf/src/tools/zprint.rs @@ -1,22 +1,26 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use std::process::Command; - -use crate::{error::MdsfError, runners::CommandType}; +use crate::runners::CommandType; #[inline] -fn set_zprint_args(mut cmd: Command, file_path: &std::path::Path) -> Command { +fn set_zprint_args( + mut cmd: std::process::Command, + file_path: &std::path::Path, +) -> std::process::Command { cmd.arg("-w"); cmd.arg(file_path); cmd } -#[inline] -pub fn run(file_path: &std::path::Path, timeout: u64) -> Result<(bool, Option), MdsfError> { - let commands = [CommandType::Direct("zprint")]; +const COMMANDS: [CommandType; 1] = [CommandType::Direct("zprint")]; - crate::execution::run_tools(&commands, file_path, timeout, set_zprint_args) +#[inline] +pub fn run( + file_path: &std::path::Path, + timeout: u64, +) -> Result<(bool, Option), crate::error::MdsfError> { + crate::execution::run_tools(&COMMANDS, file_path, timeout, set_zprint_args) } #[cfg(test)] From ba7b26986e8253416063005f3e62ce578f82e84f Mon Sep 17 00:00:00 2001 From: Mads Hougesen Date: Mon, 27 Jan 2025 23:41:39 +0100 Subject: [PATCH 4/5] refactor: call run_tools directly --- codegen/src/tools.rs | 63 +- mdsf/src/config.rs | 2 - mdsf/src/execution/mod.rs | 9 +- mdsf/src/runners/mod.rs | 1 + mdsf/src/tools/actionlint.rs | 36 +- mdsf/src/tools/alejandra.rs | 34 +- mdsf/src/tools/ameba.rs | 12 +- mdsf/src/tools/ansible_lint.rs | 12 +- mdsf/src/tools/asmfmt.rs | 12 +- mdsf/src/tools/astyle.rs | 12 +- mdsf/src/tools/auto_optional.rs | 34 +- mdsf/src/tools/autocorrect.rs | 12 +- mdsf/src/tools/autoflake.rs | 34 +- mdsf/src/tools/autopep_8.rs | 34 +- mdsf/src/tools/beancount_black.rs | 12 +- mdsf/src/tools/beautysh.rs | 56 +- mdsf/src/tools/bibtex_tidy.rs | 12 +- mdsf/src/tools/bicep_format.rs | 12 +- mdsf/src/tools/biome_check.rs | 12 +- mdsf/src/tools/biome_format.rs | 78 +- mdsf/src/tools/biome_lint.rs | 12 +- mdsf/src/tools/black.rs | 34 +- mdsf/src/tools/blade_formatter.rs | 34 +- mdsf/src/tools/blue.rs | 34 +- mdsf/src/tools/bpfmt.rs | 12 +- mdsf/src/tools/brittany.rs | 12 +- mdsf/src/tools/brunette.rs | 34 +- mdsf/src/tools/bsfmt.rs | 12 +- mdsf/src/tools/bslint.rs | 12 +- mdsf/src/tools/buf_format.rs | 34 +- mdsf/src/tools/buildifier.rs | 12 +- mdsf/src/tools/cabal_fmt.rs | 12 +- mdsf/src/tools/cabal_format.rs | 34 +- mdsf/src/tools/cabal_prettify.rs | 12 +- mdsf/src/tools/caddy_fmt.rs | 12 +- mdsf/src/tools/caramel_fmt.rs | 12 +- mdsf/src/tools/clang_format.rs | 187 ++- mdsf/src/tools/clang_tidy.rs | 12 +- mdsf/src/tools/cljfmt_fix.rs | 12 +- mdsf/src/tools/cljstyle.rs | 34 +- mdsf/src/tools/cmake_format.rs | 12 +- mdsf/src/tools/codespell.rs | 12 +- mdsf/src/tools/crlfmt.rs | 12 +- mdsf/src/tools/crystal_format.rs | 34 +- mdsf/src/tools/csharpier.rs | 34 +- mdsf/src/tools/css_beautify.rs | 34 +- mdsf/src/tools/csscomb.rs | 34 +- mdsf/src/tools/csslint.rs | 12 +- mdsf/src/tools/curlylint.rs | 12 +- mdsf/src/tools/d_2_fmt.rs | 12 +- mdsf/src/tools/dart_fix.rs | 12 +- mdsf/src/tools/dart_format.rs | 34 +- mdsf/src/tools/dcm_fix.rs | 12 +- mdsf/src/tools/dcm_format.rs | 12 +- mdsf/src/tools/deadnix.rs | 12 +- mdsf/src/tools/deno_fmt.rs | 78 +- mdsf/src/tools/deno_lint.rs | 12 +- mdsf/src/tools/dfmt.rs | 12 +- mdsf/src/tools/dhall.rs | 12 +- mdsf/src/tools/djade.rs | 12 +- mdsf/src/tools/djlint.rs | 12 +- mdsf/src/tools/docformatter.rs | 12 +- mdsf/src/tools/dockfmt.rs | 12 +- mdsf/src/tools/docstrfmt.rs | 12 +- mdsf/src/tools/doctoc.rs | 12 +- mdsf/src/tools/dotenv_linter_fix.rs | 12 +- mdsf/src/tools/dprint_fmt.rs | 12 +- mdsf/src/tools/easy_coding_standard.rs | 12 +- mdsf/src/tools/efmt.rs | 34 +- mdsf/src/tools/elm_format.rs | 34 +- mdsf/src/tools/erb_formatter.rs | 12 +- mdsf/src/tools/erlfmt.rs | 34 +- mdsf/src/tools/eslint.rs | 12 +- mdsf/src/tools/fantomas.rs | 34 +- mdsf/src/tools/fish_indent.rs | 12 +- mdsf/src/tools/fixjson.rs | 12 +- mdsf/src/tools/floskell.rs | 12 +- mdsf/src/tools/fnlfmt.rs | 12 +- mdsf/src/tools/forge_fmt.rs | 12 +- mdsf/src/tools/fourmolu.rs | 34 +- mdsf/src/tools/fprettify.rs | 34 +- mdsf/src/tools/futhark_fmt.rs | 12 +- mdsf/src/tools/gci.rs | 12 +- mdsf/src/tools/gdformat.rs | 12 +- mdsf/src/tools/gersemi.rs | 12 +- mdsf/src/tools/gleam_format.rs | 34 +- mdsf/src/tools/gluon_fmt.rs | 12 +- mdsf/src/tools/gofmt.rs | 34 +- mdsf/src/tools/gofumpt.rs | 34 +- mdsf/src/tools/goimports.rs | 34 +- mdsf/src/tools/goimports_reviser.rs | 12 +- mdsf/src/tools/golines.rs | 34 +- mdsf/src/tools/google_java_format.rs | 34 +- mdsf/src/tools/grain_format.rs | 34 +- mdsf/src/tools/hadolint.rs | 12 +- mdsf/src/tools/haml_lint.rs | 12 +- mdsf/src/tools/hclfmt.rs | 12 +- mdsf/src/tools/hfmt.rs | 12 +- mdsf/src/tools/hindent.rs | 34 +- mdsf/src/tools/hlint.rs | 12 +- mdsf/src/tools/html_beautify.rs | 34 +- mdsf/src/tools/htmlbeautifier.rs | 34 +- mdsf/src/tools/htmlhint.rs | 12 +- mdsf/src/tools/imba_fmt.rs | 12 +- mdsf/src/tools/inko_fmt.rs | 12 +- mdsf/src/tools/isort.rs | 34 +- mdsf/src/tools/joker.rs | 12 +- mdsf/src/tools/js_beautify.rs | 12 +- mdsf/src/tools/json_5_format.rs | 12 +- mdsf/src/tools/jsona_format.rs | 12 +- mdsf/src/tools/jsona_lint.rs | 12 +- mdsf/src/tools/jsonlint.rs | 12 +- mdsf/src/tools/jsonnet_lint.rs | 12 +- mdsf/src/tools/jsonnetfmt.rs | 12 +- mdsf/src/tools/juliaformatter_jl.rs | 34 +- mdsf/src/tools/just.rs | 34 +- mdsf/src/tools/kcl_fmt.rs | 34 +- mdsf/src/tools/kcl_lint.rs | 12 +- mdsf/src/tools/kdlfmt.rs | 12 +- mdsf/src/tools/kdoc_formatter.rs | 12 +- mdsf/src/tools/ktfmt.rs | 34 +- mdsf/src/tools/ktlint.rs | 34 +- mdsf/src/tools/kulala_fmt.rs | 12 +- mdsf/src/tools/leptosfmt.rs | 12 +- mdsf/src/tools/liquidsoap_prettier.rs | 12 +- mdsf/src/tools/luacheck.rs | 12 +- mdsf/src/tools/luaformatter.rs | 34 +- mdsf/src/tools/mado_check.rs | 34 +- mdsf/src/tools/markdownfmt.rs | 34 +- mdsf/src/tools/markdownlint.rs | 34 +- mdsf/src/tools/markdownlint_cli_2.rs | 34 +- mdsf/src/tools/markuplint.rs | 12 +- mdsf/src/tools/mdformat.rs | 12 +- mdsf/src/tools/mdslw.rs | 12 +- mdsf/src/tools/meson_fmt.rs | 12 +- mdsf/src/tools/misspell.rs | 12 +- mdsf/src/tools/mix_format.rs | 34 +- mdsf/src/tools/mod.rs | 1710 ++++++++++++++++++---- mdsf/src/tools/mojo_format.rs | 12 +- mdsf/src/tools/mypy.rs | 12 +- mdsf/src/tools/nginxbeautifier.rs | 12 +- mdsf/src/tools/nginxfmt.rs | 12 +- mdsf/src/tools/nickel_format.rs | 12 +- mdsf/src/tools/nimpretty.rs | 34 +- mdsf/src/tools/nixfmt.rs | 34 +- mdsf/src/tools/nixpkgs_fmt.rs | 34 +- mdsf/src/tools/nomad_fmt.rs | 12 +- mdsf/src/tools/nph.rs | 12 +- mdsf/src/tools/npm_groovy_lint.rs | 34 +- mdsf/src/tools/nufmt.rs | 12 +- mdsf/src/tools/ocamlformat.rs | 34 +- mdsf/src/tools/ocp_indent.rs | 34 +- mdsf/src/tools/odinfmt.rs | 12 +- mdsf/src/tools/oelint_adv.rs | 12 +- mdsf/src/tools/opa_fmt.rs | 12 +- mdsf/src/tools/ormolu.rs | 34 +- mdsf/src/tools/oxlint.rs | 12 +- mdsf/src/tools/packer_fix.rs | 12 +- mdsf/src/tools/packer_fmt.rs | 12 +- mdsf/src/tools/perltidy.rs | 12 +- mdsf/src/tools/pg_format.rs | 12 +- mdsf/src/tools/php_cs_fixer_fix.rs | 12 +- mdsf/src/tools/phpcbf.rs | 12 +- mdsf/src/tools/phpinsights_fix.rs | 12 +- mdsf/src/tools/pint.rs | 13 +- mdsf/src/tools/prettier.rs | 56 +- mdsf/src/tools/pretty_php.rs | 12 +- mdsf/src/tools/prettypst.rs | 12 +- mdsf/src/tools/prisma_format.rs | 34 +- mdsf/src/tools/protolint.rs | 12 +- mdsf/src/tools/ptop.rs | 12 +- mdsf/src/tools/puppet_lint.rs | 12 +- mdsf/src/tools/purs_tidy.rs | 34 +- mdsf/src/tools/purty.rs | 12 +- mdsf/src/tools/pycln.rs | 29 +- mdsf/src/tools/pycodestyle.rs | 12 +- mdsf/src/tools/pyink.rs | 34 +- mdsf/src/tools/pyment.rs | 12 +- mdsf/src/tools/qmlfmt.rs | 12 +- mdsf/src/tools/quick_lint_js.rs | 12 +- mdsf/src/tools/raco_fmt.rs | 12 +- mdsf/src/tools/refmt.rs | 12 +- mdsf/src/tools/reformat_gherkin.rs | 12 +- mdsf/src/tools/regal_fix.rs | 12 +- mdsf/src/tools/regal_lint.rs | 12 +- mdsf/src/tools/reorder_python_imports.rs | 17 +- mdsf/src/tools/rescript_format.rs | 34 +- mdsf/src/tools/roc_format.rs | 34 +- mdsf/src/tools/rstfmt.rs | 12 +- mdsf/src/tools/rubocop.rs | 34 +- mdsf/src/tools/rubyfmt.rs | 34 +- mdsf/src/tools/ruff_check.rs | 12 +- mdsf/src/tools/ruff_format.rs | 34 +- mdsf/src/tools/rufo.rs | 34 +- mdsf/src/tools/rune_fmt.rs | 12 +- mdsf/src/tools/rustfmt.rs | 34 +- mdsf/src/tools/rustywind.rs | 12 +- mdsf/src/tools/salt_lint.rs | 12 +- mdsf/src/tools/scalafmt.rs | 34 +- mdsf/src/tools/scalariform.rs | 12 +- mdsf/src/tools/selene.rs | 12 +- mdsf/src/tools/shellcheck.rs | 12 +- mdsf/src/tools/shellharden.rs | 12 +- mdsf/src/tools/shfmt.rs | 78 +- mdsf/src/tools/sleek.rs | 12 +- mdsf/src/tools/smlfmt.rs | 12 +- mdsf/src/tools/snakefmt.rs | 12 +- mdsf/src/tools/solhint.rs | 12 +- mdsf/src/tools/sql_formatter.rs | 34 +- mdsf/src/tools/sqlfluff_fix.rs | 12 +- mdsf/src/tools/sqlfluff_format.rs | 34 +- mdsf/src/tools/sqlfmt.rs | 12 +- mdsf/src/tools/sqruff.rs | 12 +- mdsf/src/tools/standardjs.rs | 12 +- mdsf/src/tools/standardrb.rs | 34 +- mdsf/src/tools/statix_check.rs | 12 +- mdsf/src/tools/statix_fix.rs | 12 +- mdsf/src/tools/stylefmt.rs | 56 +- mdsf/src/tools/stylelint.rs | 12 +- mdsf/src/tools/stylish_haskell.rs | 34 +- mdsf/src/tools/stylua.rs | 34 +- mdsf/src/tools/superhtml_fmt.rs | 34 +- mdsf/src/tools/swift_format.rs | 34 +- mdsf/src/tools/swiftformat.rs | 34 +- mdsf/src/tools/taplo.rs | 34 +- mdsf/src/tools/templ_fmt.rs | 12 +- mdsf/src/tools/terraform_fmt.rs | 34 +- mdsf/src/tools/terragrunt_hclfmt.rs | 12 +- mdsf/src/tools/tex_fmt.rs | 12 +- mdsf/src/tools/tlint_format.rs | 12 +- mdsf/src/tools/tofu_fmt.rs | 34 +- mdsf/src/tools/toml_sort.rs | 12 +- mdsf/src/tools/topiary.rs | 34 +- mdsf/src/tools/ts_standard.rs | 12 +- mdsf/src/tools/tsqllint.rs | 12 +- mdsf/src/tools/twig_cs_fixer_lint.rs | 12 +- mdsf/src/tools/typos.rs | 29 +- mdsf/src/tools/typstfmt.rs | 12 +- mdsf/src/tools/typstyle.rs | 12 +- mdsf/src/tools/ufmt.rs | 12 +- mdsf/src/tools/uiua_fmt.rs | 12 +- mdsf/src/tools/unimport.rs | 12 +- mdsf/src/tools/usort.rs | 34 +- mdsf/src/tools/v_fmt.rs | 12 +- mdsf/src/tools/vacuum_lint.rs | 12 +- mdsf/src/tools/veryl_fmt.rs | 34 +- mdsf/src/tools/vhdl_style_guide.rs | 12 +- mdsf/src/tools/wa_fmt.rs | 12 +- mdsf/src/tools/wfindent.rs | 12 +- mdsf/src/tools/xmlformat.rs | 34 +- mdsf/src/tools/xmllint.rs | 34 +- mdsf/src/tools/xo.rs | 12 +- mdsf/src/tools/yamlfix.rs | 34 +- mdsf/src/tools/yamlfmt.rs | 34 +- mdsf/src/tools/yapf.rs | 34 +- mdsf/src/tools/yew_fmt.rs | 34 +- mdsf/src/tools/zig_fmt.rs | 34 +- mdsf/src/tools/ziggy_fmt.rs | 12 +- mdsf/src/tools/zprint.rs | 34 +- tools/actionlint/plugin.json | 2 +- tools/mado/plugin.json | 2 +- tools/tool.schema.json | 4 +- 262 files changed, 3438 insertions(+), 3820 deletions(-) diff --git a/codegen/src/tools.rs b/codegen/src/tools.rs index ed5abf72..b9d4541c 100644 --- a/codegen/src/tools.rs +++ b/codegen/src/tools.rs @@ -15,7 +15,7 @@ pub struct ToolCommandTest { pub test_input: String, - pub test_output: Option, + pub test_output: String, } #[derive(Debug, serde::Deserialize, schemars::JsonSchema, Clone)] @@ -111,8 +111,6 @@ pub struct GeneratedCommand { pub module_name: String, - pub fn_name: String, - pub code: String, pub serde_rename: String, @@ -152,29 +150,26 @@ impl Tool { let test_fn_name = format!("test_{module_name}_{language}_{id}",); - let test_output = test.test_output.as_ref().map_or_else( - || "None".to_owned(), - |output| { - format!( - "Some( -{INDENT}{INDENT}{INDENT}r#\"{output}\"# -{INDENT}{INDENT}{INDENT}.to_owned(), -{INDENT}{INDENT})" - ) - }, - ); + let test_output = &test.test_output; let test_code = format!( "{INDENT}#[test_with::executable({bin})] {INDENT}fn {test_fn_name}() {{ {INDENT}{INDENT}let input = r#\"{input}\"#; -{INDENT}{INDENT}let output = {test_output}; + +{INDENT}{INDENT}let output = r#\"{test_output}\"#; + {INDENT}{INDENT}let file_ext = crate::fttype::get_file_extension(\"{language}\"); + {INDENT}{INDENT}let snippet = {INDENT}{INDENT}{INDENT}crate::execution::setup_snippet(input, &file_ext).expect(\"it to create a snippet file\"); -{INDENT}{INDENT}let result = crate::tools::{module_name}::run(snippet.path(), 0) -{INDENT}{INDENT}{INDENT}.expect(\"it to be successful\") -{INDENT}{INDENT}{INDENT}.1; + +{INDENT}{INDENT}let result = +{INDENT}{INDENT}{INDENT}crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) +{INDENT}{INDENT}{INDENT}{INDENT}.expect(\"it to be successful\") +{INDENT}{INDENT}{INDENT}{INDENT}.1 +{INDENT}{INDENT}{INDENT}{INDENT}.expect(\"it to be some\"); + {INDENT}{INDENT}assert_eq!(result, output); {INDENT}}}", bin = if self.packages.npm.is_some() { @@ -196,10 +191,6 @@ impl Tool { for (cmd, options) in &self.commands { let command_name = self.get_command_name(cmd); - let set_args_fn_name = format!("set_{command_name}_args"); - - let run_fn_name = "run".to_string(); - let mut command_types: Vec = Vec::new(); { if self.packages.npm.is_some() { @@ -281,7 +272,7 @@ impl Tool { use crate::runners::CommandType; #[inline] -fn {set_args_fn_name}( +pub fn set_arguments( {INDENT}mut cmd: std::process::Command, {INDENT}file_path: &std::path::Path, ) -> std::process::Command {{ @@ -289,15 +280,7 @@ fn {set_args_fn_name}( {INDENT}cmd }} -const COMMANDS: [CommandType; {command_type_count}] = [{command_arr}]; - -#[inline] -pub fn {run_fn_name}( -{INDENT}file_path: &std::path::Path, -{INDENT}timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> {{ -{INDENT}crate::execution::run_tools(&COMMANDS, file_path, timeout, {set_args_fn_name}) -}} +pub const COMMANDS: [CommandType; {command_type_count}] = [{command_arr}]; #[cfg(test)] mod test_{module_name} {{{tests}}} @@ -307,7 +290,6 @@ mod test_{module_name} {{{tests}}} all_commands.push(GeneratedCommand { enum_value: command_name.to_case(Case::Pascal), module_name, - fn_name: run_fn_name, code, serde_rename: format!( "{}{}{}", @@ -378,19 +360,22 @@ impl AsRef for Tooling { )?; files.insert(command.module_name.clone()); + + let enum_value = &command.enum_value; + let module_name = &command.module_name; + enum_values.insert(format!( "{INDENT}#[serde(rename = \"{rename}\")] {INDENT}/// `{bin} {args}` -{INDENT}{enum_name},", +{INDENT}{enum_value},", rename = command.serde_rename, - enum_name = command.enum_value, bin = plugin.binary, args = command.args.join(" ") )); + format_snippet_values.insert(format!( - "{INDENT}{INDENT}{INDENT}Self::{} => {}::{}(snippet_path, timeout),", - command.enum_value, command.module_name, command.fn_name - )); + "{INDENT}{INDENT}{INDENT}Self::{enum_value} => run_tools(&{module_name}::COMMANDS, snippet_path, {module_name}::set_arguments, timeout)," + )); as_ref_values.insert(format!( "{INDENT}{INDENT}{INDENT}Self::{} => \"{}\",", @@ -418,6 +403,8 @@ impl AsRef for Tooling { let mod_file_contents = format!( "{GENERATED_FILE_COMMENT} +use crate::execution::run_tools; + {} #[derive(serde::Serialize, serde::Deserialize, Hash, Clone, Copy)] diff --git a/mdsf/src/config.rs b/mdsf/src/config.rs index ac0a2ec4..b6b657fd 100644 --- a/mdsf/src/config.rs +++ b/mdsf/src/config.rs @@ -106,8 +106,6 @@ impl MdsfConfig { // TODO: reduce the amount of cloning if !self.language_aliases.is_empty() { - println!("has alias"); - let mut seen_languages: std::collections::HashMap = std::collections::HashMap::new(); diff --git a/mdsf/src/execution/mod.rs b/mdsf/src/execution/mod.rs index 9479913f..cd8427c0 100644 --- a/mdsf/src/execution/mod.rs +++ b/mdsf/src/execution/mod.rs @@ -130,7 +130,9 @@ pub fn execute_command( } } - handle_post_execution(spawn_command(cmd, timeout), snippet_path) + let output = spawn_command(cmd, timeout); + + handle_post_execution(output, snippet_path) } #[inline] @@ -292,14 +294,13 @@ impl MdsfFormatter { pub fn run_tools( commands: &[CommandType], file_path: &std::path::Path, - timeout: u64, set_args_fn: fn(std::process::Command, &std::path::Path) -> std::process::Command, + timeout: u64, ) -> Result<(bool, Option), MdsfError> { for (index, cmd) in commands.iter().enumerate() { let cmd = set_args_fn(cmd.build(), file_path); - let execution_result = - execute_command(cmd, file_path, timeout).map(|value| (value.0, None)); + let execution_result = execute_command(cmd, file_path, timeout); if index == commands.len() - 1 { return execution_result; diff --git a/mdsf/src/runners/mod.rs b/mdsf/src/runners/mod.rs index 6e39a942..d488fb57 100644 --- a/mdsf/src/runners/mod.rs +++ b/mdsf/src/runners/mod.rs @@ -121,6 +121,7 @@ fn setup_php_vender_bin_command(binary_name: &str) -> std::process::Command { setup_command_from_path("./vendor/bin/", binary_name) } +#[derive(Debug)] pub enum CommandType { BinaryPath(&'static str, &'static str), Direct(&'static str), diff --git a/mdsf/src/tools/actionlint.rs b/mdsf/src/tools/actionlint.rs index 6b986d45..bb13d754 100644 --- a/mdsf/src/tools/actionlint.rs +++ b/mdsf/src/tools/actionlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_actionlint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,20 +12,12 @@ fn set_actionlint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("actionlint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_actionlint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("actionlint")]; #[cfg(test)] mod test_actionlint { #[test_with::executable(actionlint)] - fn test_actionlint_yaml_e8ea2c4c1494f1e5() { + fn test_actionlint_yaml_da8378e9384e0b1f() { let input = r#"name: action on: push jobs: @@ -34,13 +26,27 @@ jobs: steps: - run: mdsf format . "#; - let output = None; + + let output = r#"name: action +on: push +jobs: + format: + runs-on: ubuntu-latest + steps: + - run: mdsf format . +"#; + let file_ext = crate::fttype::get_file_extension("yaml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::actionlint::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/alejandra.rs b/mdsf/src/tools/alejandra.rs index ae9c3c16..7731243c 100644 --- a/mdsf/src/tools/alejandra.rs +++ b/mdsf/src/tools/alejandra.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_alejandra_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_alejandra_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("alejandra")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_alejandra_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("alejandra")]; #[cfg(test)] mod test_alejandra { #[test_with::executable(alejandra)] - fn test_alejandra_nix_cb336d27233de4f0() { + fn test_alejandra_nix_f38bff8f20c2aa02() { let input = r#"{ lib, buildPythonPackage, fetchFromGitHub, redis }: @@ -54,8 +46,8 @@ buildPythonPackage rec { }; } "#; - let output = Some( - r#"{ + + let output = r#"{ lib, buildPythonPackage, fetchFromGitHub, @@ -84,15 +76,19 @@ buildPythonPackage rec { maintainers = [maintainers.globin]; }; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("nix"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::alejandra::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/ameba.rs b/mdsf/src/tools/ameba.rs index b7d40502..f5adcd37 100644 --- a/mdsf/src/tools/ameba.rs +++ b/mdsf/src/tools/ameba.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ameba_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_ameba_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ameba")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ameba_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ameba")]; #[cfg(test)] mod test_ameba {} diff --git a/mdsf/src/tools/ansible_lint.rs b/mdsf/src/tools/ansible_lint.rs index 5c30820f..1018cf2e 100644 --- a/mdsf/src/tools/ansible_lint.rs +++ b/mdsf/src/tools/ansible_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ansible_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_ansible_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ansible-lint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ansible_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ansible-lint")]; #[cfg(test)] mod test_ansible_lint {} diff --git a/mdsf/src/tools/asmfmt.rs b/mdsf/src/tools/asmfmt.rs index 2ebeeef3..149936b1 100644 --- a/mdsf/src/tools/asmfmt.rs +++ b/mdsf/src/tools/asmfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_asmfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_asmfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("asmfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_asmfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("asmfmt")]; #[cfg(test)] mod test_asmfmt {} diff --git a/mdsf/src/tools/astyle.rs b/mdsf/src/tools/astyle.rs index b6563ad9..724db8dc 100644 --- a/mdsf/src/tools/astyle.rs +++ b/mdsf/src/tools/astyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_astyle_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_astyle_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("astyle")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_astyle_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("astyle")]; #[cfg(test)] mod test_astyle {} diff --git a/mdsf/src/tools/auto_optional.rs b/mdsf/src/tools/auto_optional.rs index fa6cdfe9..20af2e16 100644 --- a/mdsf/src/tools/auto_optional.rs +++ b/mdsf/src/tools/auto_optional.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_auto_optional_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,36 +12,32 @@ fn set_auto_optional_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("auto-optional")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_auto_optional_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("auto-optional")]; #[cfg(test)] mod test_auto_optional { #[test_with::executable(auto-optional)] - fn test_auto_optional_python_d5dd242171892fcc() { + fn test_auto_optional_python_c43199b18f48026d() { let input = r#"def foo(bar: str = None): pass "#; - let output = Some( - r#"from typing import Optional + + let output = r#"from typing import Optional def foo(bar: Optional[str] = None): pass -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::auto_optional::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/autocorrect.rs b/mdsf/src/tools/autocorrect.rs index 281fc6d8..b2287561 100644 --- a/mdsf/src/tools/autocorrect.rs +++ b/mdsf/src/tools/autocorrect.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_autocorrect_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_autocorrect_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("autocorrect")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_autocorrect_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("autocorrect")]; #[cfg(test)] mod test_autocorrect {} diff --git a/mdsf/src/tools/autoflake.rs b/mdsf/src/tools/autoflake.rs index 8270bd87..7af31090 100644 --- a/mdsf/src/tools/autoflake.rs +++ b/mdsf/src/tools/autoflake.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_autoflake_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,20 +14,12 @@ fn set_autoflake_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("autoflake")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_autoflake_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("autoflake")]; #[cfg(test)] mod test_autoflake { #[test_with::executable(autoflake)] - fn test_autoflake_python_a676d36968f04ba0() { + fn test_autoflake_python_27cfd9b948e80d7f() { let input = r#"import math import re import os @@ -46,8 +38,8 @@ def foo(): print(sys.version) return math.pi "#; - let output = Some( - r#"import math + + let output = r#"import math import sys @@ -58,15 +50,19 @@ def foo(): except ImportError as exception: print(sys.version) return math.pi -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::autoflake::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/autopep_8.rs b/mdsf/src/tools/autopep_8.rs index 5717d691..7c99a478 100644 --- a/mdsf/src/tools/autopep_8.rs +++ b/mdsf/src/tools/autopep_8.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_autopep_8_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,32 +13,28 @@ fn set_autopep_8_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("autopep8")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_autopep_8_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("autopep8")]; #[cfg(test)] mod test_autopep_8 { #[test_with::executable(autopep8)] - fn test_autopep_8_python_4b452a82df29cac2() { + fn test_autopep_8_python_a868b5ad9905fc3f() { let input = r#"def add( a: int , b:int)->int: return a+b"#; - let output = Some( - r#"def add(a: int, b: int) -> int: return a+b -"# - .to_owned(), - ); + + let output = r#"def add(a: int, b: int) -> int: return a+b +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::autopep_8::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/beancount_black.rs b/mdsf/src/tools/beancount_black.rs index b58bf7cc..56eae756 100644 --- a/mdsf/src/tools/beancount_black.rs +++ b/mdsf/src/tools/beancount_black.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_beancount_black_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_beancount_black_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("bean-black")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_beancount_black_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("bean-black")]; #[cfg(test)] mod test_beancount_black {} diff --git a/mdsf/src/tools/beautysh.rs b/mdsf/src/tools/beautysh.rs index a24fd0cc..7216fbc6 100644 --- a/mdsf/src/tools/beautysh.rs +++ b/mdsf/src/tools/beautysh.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_beautysh_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,67 +12,67 @@ fn set_beautysh_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("beautysh")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_beautysh_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("beautysh")]; #[cfg(test)] mod test_beautysh { #[test_with::executable(beautysh)] - fn test_beautysh_shell_8e9f54ab33ca6912() { + fn test_beautysh_shell_f8c934ee37e2888() { let input = r#"#!/bin/shell add() { echo "$1" + "$2" } "#; - let output = Some( - r#"#!/bin/shell + + let output = r#"#!/bin/shell add() { echo "$1" + "$2" } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("shell"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::beautysh::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(beautysh)] - fn test_beautysh_bash_6cff8bc2ed5fa12f() { + fn test_beautysh_bash_a6831a7ad31bd0a6() { let input = r#"#!/bin/bash add() { echo "$1" + "$2" } "#; - let output = Some( - r#"#!/bin/bash + + let output = r#"#!/bin/bash add() { echo "$1" + "$2" } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("bash"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::beautysh::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/bibtex_tidy.rs b/mdsf/src/tools/bibtex_tidy.rs index cbd6db8c..10f2151d 100644 --- a/mdsf/src/tools/bibtex_tidy.rs +++ b/mdsf/src/tools/bibtex_tidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_bibtex_tidy_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_bibtex_tidy_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("bibtex-tidy"), CommandType::Direct("bibtex-tidy"), CommandType::Npm("bibtex-tidy"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bibtex_tidy_args) -} - #[cfg(test)] mod test_bibtex_tidy {} diff --git a/mdsf/src/tools/bicep_format.rs b/mdsf/src/tools/bicep_format.rs index c315b292..31b45686 100644 --- a/mdsf/src/tools/bicep_format.rs +++ b/mdsf/src/tools/bicep_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_bicep_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_bicep_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("bicep")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bicep_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("bicep")]; #[cfg(test)] mod test_bicep_format {} diff --git a/mdsf/src/tools/biome_check.rs b/mdsf/src/tools/biome_check.rs index f253ac5b..583be173 100644 --- a/mdsf/src/tools/biome_check.rs +++ b/mdsf/src/tools/biome_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_biome_check_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,19 +14,11 @@ fn set_biome_check_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("biome"), CommandType::Direct("biome"), CommandType::Npm("@biomejs/biome"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_biome_check_args) -} - #[cfg(test)] mod test_biome_check {} diff --git a/mdsf/src/tools/biome_format.rs b/mdsf/src/tools/biome_format.rs index 462c8559..52ba13c1 100644 --- a/mdsf/src/tools/biome_format.rs +++ b/mdsf/src/tools/biome_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_biome_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,24 +14,16 @@ fn set_biome_format_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("biome"), CommandType::Direct("biome"), CommandType::Npm("@biomejs/biome"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_biome_format_args) -} - #[cfg(test)] mod test_biome_format { #[test_with::executable(npx)] - fn test_biome_format_json_3bf561a65ea19c27() { + fn test_biome_format_json_90a326e29048e3cd() { let input = r#" { "key": "value", @@ -42,25 +34,29 @@ mod test_biome_format { , null] } "#; - let output = Some( - r#"{ + + let output = r#"{ "key": "value", "key2": ["value2", "value3", 1, null] } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("json"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::biome_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(npx)] - fn test_biome_format_javascript_8b78b3bf4549dcd5() { + fn test_biome_format_javascript_4845e9b01c23667f() { let input = r#" async function asyncAddition( a,b @@ -69,24 +65,28 @@ mod test_biome_format { } "#; - let output = Some( - r#"async function asyncAddition(a, b) { + + let output = r#"async function asyncAddition(a, b) { return a + b; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("javascript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::biome_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(npx)] - fn test_biome_format_typescript_4c7d2a2ce681e640() { + fn test_biome_format_typescript_8154bfdbd3b72275() { let input = r#" async function asyncAddition( a:number,b:number @@ -97,19 +97,23 @@ number> } "#; - let output = Some( - r#"async function asyncAddition(a: number, b: number): Promise { + + let output = r#"async function asyncAddition(a: number, b: number): Promise { return a + b; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("typescript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::biome_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/biome_lint.rs b/mdsf/src/tools/biome_lint.rs index 09e66197..14f7d55d 100644 --- a/mdsf/src/tools/biome_lint.rs +++ b/mdsf/src/tools/biome_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_biome_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,19 +14,11 @@ fn set_biome_lint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("biome"), CommandType::Direct("biome"), CommandType::Npm("@biomejs/biome"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_biome_lint_args) -} - #[cfg(test)] mod test_biome_lint {} diff --git a/mdsf/src/tools/black.rs b/mdsf/src/tools/black.rs index 159dd2e2..7ca79bef 100644 --- a/mdsf/src/tools/black.rs +++ b/mdsf/src/tools/black.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_black_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,33 +13,29 @@ fn set_black_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("black")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_black_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("black")]; #[cfg(test)] mod test_black { #[test_with::executable(black)] - fn test_black_python_fb3e2d124e8bebbb() { + fn test_black_python_229ec2b01c2bfe3c() { let input = r#"def add( a: int , b:int)->int: return a+b"#; - let output = Some( - r#"def add(a: int, b: int) -> int: + + let output = r#"def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::black::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/blade_formatter.rs b/mdsf/src/tools/blade_formatter.rs index 54fdb8af..628104e0 100644 --- a/mdsf/src/tools/blade_formatter.rs +++ b/mdsf/src/tools/blade_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_blade_formatter_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,24 +13,16 @@ fn set_blade_formatter_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("blade-formatter"), CommandType::Direct("blade-formatter"), CommandType::Npm("blade-formatter"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_blade_formatter_args) -} - #[cfg(test)] mod test_blade_formatter { #[test_with::executable(npx)] - fn test_blade_formatter_blade_3c9d381f117ad59b() { + fn test_blade_formatter_blade_9ddeaf972bfb08c1() { let input = r#"@extends('frontend.layouts.app') @section('title') foo @endsection @@ -61,8 +53,8 @@ mod test_blade_formatter { @endsection @section('footer') @stop"#; - let output = Some( - r#"@extends('frontend.layouts.app') + + let output = r#"@extends('frontend.layouts.app') @section('title') foo @endsection @section('content') @@ -92,15 +84,19 @@ mod test_blade_formatter { @endsection @section('footer') @stop -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("blade"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::blade_formatter::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/blue.rs b/mdsf/src/tools/blue.rs index ac08feb5..540154c7 100644 --- a/mdsf/src/tools/blue.rs +++ b/mdsf/src/tools/blue.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_blue_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,33 +13,29 @@ fn set_blue_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("blue")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_blue_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("blue")]; #[cfg(test)] mod test_blue { #[test_with::executable(blue)] - fn test_blue_python_fb3e2d124e8bebbb() { + fn test_blue_python_229ec2b01c2bfe3c() { let input = r#"def add( a: int , b:int)->int: return a+b"#; - let output = Some( - r#"def add(a: int, b: int) -> int: + + let output = r#"def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::blue::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/bpfmt.rs b/mdsf/src/tools/bpfmt.rs index f465a850..99577113 100644 --- a/mdsf/src/tools/bpfmt.rs +++ b/mdsf/src/tools/bpfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_bpfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_bpfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("bpfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bpfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("bpfmt")]; #[cfg(test)] mod test_bpfmt {} diff --git a/mdsf/src/tools/brittany.rs b/mdsf/src/tools/brittany.rs index 9b471ca2..3063e5ba 100644 --- a/mdsf/src/tools/brittany.rs +++ b/mdsf/src/tools/brittany.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_brittany_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_brittany_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("brittany")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_brittany_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("brittany")]; #[cfg(test)] mod test_brittany {} diff --git a/mdsf/src/tools/brunette.rs b/mdsf/src/tools/brunette.rs index 8c8c5bd9..ec20e22f 100644 --- a/mdsf/src/tools/brunette.rs +++ b/mdsf/src/tools/brunette.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_brunette_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,33 +13,29 @@ fn set_brunette_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("brunette")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_brunette_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("brunette")]; #[cfg(test)] mod test_brunette { #[test_with::executable(brunette)] - fn test_brunette_python_fb3e2d124e8bebbb() { + fn test_brunette_python_229ec2b01c2bfe3c() { let input = r#"def add( a: int , b:int)->int: return a+b"#; - let output = Some( - r#"def add(a: int, b: int) -> int: + + let output = r#"def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::brunette::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/bsfmt.rs b/mdsf/src/tools/bsfmt.rs index 96bc57b5..8e1d31b9 100644 --- a/mdsf/src/tools/bsfmt.rs +++ b/mdsf/src/tools/bsfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_bsfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_bsfmt_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("bsfmt"), CommandType::Direct("bsfmt"), CommandType::Npm("brighterscript-formatter"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bsfmt_args) -} - #[cfg(test)] mod test_bsfmt {} diff --git a/mdsf/src/tools/bslint.rs b/mdsf/src/tools/bslint.rs index 042e242e..aa9f725b 100644 --- a/mdsf/src/tools/bslint.rs +++ b/mdsf/src/tools/bslint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_bslint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_bslint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("bslint"), CommandType::Direct("bslint"), CommandType::Npm("bslint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_bslint_args) -} - #[cfg(test)] mod test_bslint {} diff --git a/mdsf/src/tools/buf_format.rs b/mdsf/src/tools/buf_format.rs index 4a34ad46..188ad255 100644 --- a/mdsf/src/tools/buf_format.rs +++ b/mdsf/src/tools/buf_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_buf_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,40 +14,36 @@ fn set_buf_format_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("buf"), CommandType::Direct("buf"), CommandType::Npm("@bufbuild/buf"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_buf_format_args) -} - #[cfg(test)] mod test_buf_format { #[test_with::executable(npx)] - fn test_buf_format_protobuf_bbae42b1d9a7bf36() { + fn test_buf_format_protobuf_10af516c8a015ab5() { let input = r#"service SearchService { rpc Search (SearchRequest) returns (SearchResponse); }"#; - let output = Some( - r#"service SearchService { + + let output = r#"service SearchService { rpc Search(SearchRequest) returns (SearchResponse); } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("protobuf"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::buf_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/buildifier.rs b/mdsf/src/tools/buildifier.rs index a23de043..8acee40c 100644 --- a/mdsf/src/tools/buildifier.rs +++ b/mdsf/src/tools/buildifier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_buildifier_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_buildifier_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("buildifier")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_buildifier_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("buildifier")]; #[cfg(test)] mod test_buildifier {} diff --git a/mdsf/src/tools/cabal_fmt.rs b/mdsf/src/tools/cabal_fmt.rs index 7694ea8e..fd7a8728 100644 --- a/mdsf/src/tools/cabal_fmt.rs +++ b/mdsf/src/tools/cabal_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_cabal_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_cabal_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal-fmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cabal_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal-fmt")]; #[cfg(test)] mod test_cabal_fmt {} diff --git a/mdsf/src/tools/cabal_format.rs b/mdsf/src/tools/cabal_format.rs index 91f46ff3..a0ee768d 100644 --- a/mdsf/src/tools/cabal_format.rs +++ b/mdsf/src/tools/cabal_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_cabal_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_cabal_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cabal_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal")]; #[cfg(test)] mod test_cabal_format { #[test_with::executable(cabal)] - fn test_cabal_format_cabal_8f11b5df65ea57bd() { + fn test_cabal_format_cabal_38e9e2aad5619a6a() { let input = r#"cabal-version: 2.4 name: mdsf version: 0 @@ -39,8 +31,8 @@ executable msdf other-extensions: DeriveFunctor FlexibleContexts ExistentialQuantification OverloadedStrings RankNTypes"#; - let output = Some( - r#"cabal-version: 2.4 + + let output = r#"cabal-version: 2.4 name: mdsf version: 0 @@ -58,15 +50,19 @@ executable msdf bytestring, Cabal ^>=2.5, containers ^>=0.5.11.0 || ^>=0.6.0.1 -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("cabal"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::cabal_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/cabal_prettify.rs b/mdsf/src/tools/cabal_prettify.rs index a144b195..9872f76f 100644 --- a/mdsf/src/tools/cabal_prettify.rs +++ b/mdsf/src/tools/cabal_prettify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_cabal_prettify_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_cabal_prettify_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal-prettify")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cabal_prettify_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("cabal-prettify")]; #[cfg(test)] mod test_cabal_prettify {} diff --git a/mdsf/src/tools/caddy_fmt.rs b/mdsf/src/tools/caddy_fmt.rs index 11aad21a..03c22bd0 100644 --- a/mdsf/src/tools/caddy_fmt.rs +++ b/mdsf/src/tools/caddy_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_caddy_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_caddy_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("caddy")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_caddy_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("caddy")]; #[cfg(test)] mod test_caddy_fmt {} diff --git a/mdsf/src/tools/caramel_fmt.rs b/mdsf/src/tools/caramel_fmt.rs index e4435ac0..88163ba6 100644 --- a/mdsf/src/tools/caramel_fmt.rs +++ b/mdsf/src/tools/caramel_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_caramel_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_caramel_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("caramel")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_caramel_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("caramel")]; #[cfg(test)] mod test_caramel_fmt {} diff --git a/mdsf/src/tools/clang_format.rs b/mdsf/src/tools/clang_format.rs index fe14b89c..3770812a 100644 --- a/mdsf/src/tools/clang_format.rs +++ b/mdsf/src/tools/clang_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_clang_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,130 +13,143 @@ fn set_clang_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("clang-format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_clang_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("clang-format")]; #[cfg(test)] mod test_clang_format { #[test_with::executable(clang-format)] - fn test_clang_format_java_3a8693a8a31c89e1() { + fn test_clang_format_java_c4fcc280a3a8aac0() { let input = r#"class HelloWorld { public static void main(String[] args) { System.out.println("Hello"); System.out.println("World!"); } }"#; - let output = Some( - r#"class HelloWorld { + + let output = r#"class HelloWorld { public static void main(String[] args) { System.out.println("Hello"); System.out.println("World!"); } -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("java"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(clang-format)] - fn test_clang_format_protobuf_230c199e5d2e6168() { + fn test_clang_format_protobuf_7be6def196942f83() { let input = r#"service SearchService { rpc Search (SearchRequest) returns (SearchResponse); }"#; - let output = Some( - r#"service SearchService { rpc Search(SearchRequest) returns (SearchResponse); }"# - .to_owned(), - ); + + let output = + r#"service SearchService { rpc Search(SearchRequest) returns (SearchResponse); }"#; + let file_ext = crate::fttype::get_file_extension("protobuf"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(clang-format)] - fn test_clang_format_objective_c_dee0cca41b3fee5d() { + fn test_clang_format_objective_c_3d56455568c6e83f() { let input = r#"int add(int a,int b){ a - a ; return a + b; }"#; - let output = Some( - r#"int add(int a, int b) { + + let output = r#"int add(int a, int b) { a - a; return a + b; -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("objective-c"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(clang-format)] - fn test_clang_format_c_f77ec2be9551eaf5() { + fn test_clang_format_c_bb10810bd7d8a71() { let input = r#"int add(int a,int b){ a-b; return a + b; }"#; - let output = Some( - r#"int add(int a, int b) { + + let output = r#"int add(int a, int b) { a - b; return a + b; -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("c"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(clang-format)] - fn test_clang_format_cpp_fc6a259c1f521059() { + fn test_clang_format_cpp_8a39c61364dbbe50() { let input = r#"int add(int a,int b){ a-b; return a + b; }"#; - let output = Some( - r#"int add(int a, int b) { + + let output = r#"int add(int a, int b) { a - b; return a + b; -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("cpp"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(clang-format)] - fn test_clang_format_csharp_30d7743cc539319d() { + fn test_clang_format_csharp_8ebf20c1ddcd1aeb() { let input = r#"namespace Mdsf { class Adder { public static int add(int a,int b) { @@ -145,34 +158,38 @@ mod test_clang_format { } } } "#; - let output = Some( - r#"namespace Mdsf { + + let output = r#"namespace Mdsf { class Adder { public static int add(int a, int b) { a - b; return a + b; } } -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("csharp"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(clang-format)] - fn test_clang_format_json_aaecdc564d205c23() { + fn test_clang_format_json_574b008e140f1be6() { let input = r#" { "key": "value", "key2": ["value2", "value3", 1 , null] } "#; - let output = Some( - r#"{ + + let output = r#"{ "key": "value", "key2": [ "value2", @@ -180,37 +197,45 @@ class Adder { 1, null ] -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("json"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(clang-format)] - fn test_clang_format_javascript_96407481e0b6425() { + fn test_clang_format_javascript_d6184d76490772e9() { let input = r#" async function asyncAddition( a,b) { a * b; return a+b } "#; - let output = Some( - r#"async function asyncAddition(a, b) { + + let output = r#"async function asyncAddition(a, b) { a * b; return a + b -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("javascript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::clang_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/clang_tidy.rs b/mdsf/src/tools/clang_tidy.rs index 5b803b8b..c99dc866 100644 --- a/mdsf/src/tools/clang_tidy.rs +++ b/mdsf/src/tools/clang_tidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_clang_tidy_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_clang_tidy_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("clang-tidy")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_clang_tidy_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("clang-tidy")]; #[cfg(test)] mod test_clang_tidy {} diff --git a/mdsf/src/tools/cljfmt_fix.rs b/mdsf/src/tools/cljfmt_fix.rs index 079b4785..f648c182 100644 --- a/mdsf/src/tools/cljfmt_fix.rs +++ b/mdsf/src/tools/cljfmt_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_cljfmt_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_cljfmt_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("cljfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cljfmt_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("cljfmt")]; #[cfg(test)] mod test_cljfmt_fix {} diff --git a/mdsf/src/tools/cljstyle.rs b/mdsf/src/tools/cljstyle.rs index f458d1f9..7fa82870 100644 --- a/mdsf/src/tools/cljstyle.rs +++ b/mdsf/src/tools/cljstyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_cljstyle_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_cljstyle_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("cljstyle")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cljstyle_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("cljstyle")]; #[cfg(test)] mod test_cljstyle { #[test_with::executable(cljstyle)] - fn test_cljstyle_clojure_958a889bbccbb51b() { + fn test_cljstyle_clojure_92fbb2f42ebeeb2e() { let input = r#"( ns foo.bar.baz "some doc" (:require (foo.bar [abc :as abc] @@ -42,8 +34,8 @@ mod test_cljstyle { ) ([name] ( println "Hello," name ) ))"#; - let output = Some( - r#"(ns foo.bar.baz + + let output = r#"(ns foo.bar.baz "some doc" (:require [foo.bar.abc :as abc] @@ -61,15 +53,19 @@ mod test_cljstyle { ([] (hello "world")) ([name] (println "Hello," name))) -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("clojure"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::cljstyle::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/cmake_format.rs b/mdsf/src/tools/cmake_format.rs index 8dd53acd..53db6ba4 100644 --- a/mdsf/src/tools/cmake_format.rs +++ b/mdsf/src/tools/cmake_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_cmake_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_cmake_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("cmake-format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_cmake_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("cmake-format")]; #[cfg(test)] mod test_cmake_format {} diff --git a/mdsf/src/tools/codespell.rs b/mdsf/src/tools/codespell.rs index 365ffe5d..70dfa585 100644 --- a/mdsf/src/tools/codespell.rs +++ b/mdsf/src/tools/codespell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_codespell_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_codespell_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("codespell")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_codespell_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("codespell")]; #[cfg(test)] mod test_codespell {} diff --git a/mdsf/src/tools/crlfmt.rs b/mdsf/src/tools/crlfmt.rs index 7fb6bfaf..d175d8a7 100644 --- a/mdsf/src/tools/crlfmt.rs +++ b/mdsf/src/tools/crlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_crlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_crlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("crlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_crlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("crlfmt")]; #[cfg(test)] mod test_crlfmt {} diff --git a/mdsf/src/tools/crystal_format.rs b/mdsf/src/tools/crystal_format.rs index f7628036..5f19eba8 100644 --- a/mdsf/src/tools/crystal_format.rs +++ b/mdsf/src/tools/crystal_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_crystal_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,34 +14,30 @@ fn set_crystal_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("crystal")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_crystal_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("crystal")]; #[cfg(test)] mod test_crystal_format { #[test_with::executable(crystal)] - fn test_crystal_format_crystal_2cc833585f9c0931() { + fn test_crystal_format_crystal_e0f2d532cd984bee() { let input = r#"def add(a, b) return a + b end"#; - let output = Some( - r#"def add(a, b) + + let output = r#"def add(a, b) return a + b end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("crystal"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::crystal_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/csharpier.rs b/mdsf/src/tools/csharpier.rs index 070d4d4a..3de1db7d 100644 --- a/mdsf/src/tools/csharpier.rs +++ b/mdsf/src/tools/csharpier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_csharpier_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_csharpier_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dotnet")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_csharpier_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dotnet")]; #[cfg(test)] mod test_csharpier { #[test_with::executable(dotnet)] - fn test_csharpier_csharp_4f321bc3873fc142() { + fn test_csharpier_csharp_a79aa94ad2d86b6c() { let input = r#"namespace Mdsf { class Adder { public static int add(int a,int b) { @@ -35,8 +27,8 @@ mod test_csharpier { } } } "#; - let output = Some( - r#"namespace Mdsf + + let output = r#"namespace Mdsf { class Adder { @@ -47,15 +39,19 @@ mod test_csharpier { } } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("csharp"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::csharpier::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/css_beautify.rs b/mdsf/src/tools/css_beautify.rs index 8796e276..9ca7bbf9 100644 --- a/mdsf/src/tools/css_beautify.rs +++ b/mdsf/src/tools/css_beautify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_css_beautify_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -16,41 +16,37 @@ fn set_css_beautify_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("css-beautify"), CommandType::Direct("css-beautify"), CommandType::Npm("js-beautify"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_css_beautify_args) -} - #[cfg(test)] mod test_css_beautify { #[test_with::executable(npx)] - fn test_css_beautify_css_9037e3781d1e74dd() { + fn test_css_beautify_css_5ad41f26f69aea3e() { let input = r#"h1 {color: blue;} p {color: red;}"#; - let output = Some( - r#"h1 { + + let output = r#"h1 { color: blue; } p { color: red; -}"# - .to_owned(), - ); +}"#; + let file_ext = crate::fttype::get_file_extension("css"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::css_beautify::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/csscomb.rs b/mdsf/src/tools/csscomb.rs index 30575ad3..b020957e 100644 --- a/mdsf/src/tools/csscomb.rs +++ b/mdsf/src/tools/csscomb.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_csscomb_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,28 +13,20 @@ fn set_csscomb_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("csscomb"), CommandType::Direct("csscomb"), CommandType::Npm("csscomb"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_csscomb_args) -} - #[cfg(test)] mod test_csscomb { #[test_with::executable(npx)] - fn test_csscomb_css_6d95484404a0a4f3() { + fn test_csscomb_css_bed67a883a4a1aae() { let input = r#"h1 {color: blue;} p {color: red;}"#; - let output = Some( - r#"h1 + + let output = r#"h1 { color: blue; } @@ -42,15 +34,19 @@ p { color: red; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("css"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::csscomb::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/csslint.rs b/mdsf/src/tools/csslint.rs index 67684d54..62dce435 100644 --- a/mdsf/src/tools/csslint.rs +++ b/mdsf/src/tools/csslint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_csslint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_csslint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("csslint"), CommandType::Direct("csslint"), CommandType::Npm("csslint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_csslint_args) -} - #[cfg(test)] mod test_csslint {} diff --git a/mdsf/src/tools/curlylint.rs b/mdsf/src/tools/curlylint.rs index 83cacf4a..5d45def2 100644 --- a/mdsf/src/tools/curlylint.rs +++ b/mdsf/src/tools/curlylint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_curlylint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_curlylint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("curlylint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_curlylint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("curlylint")]; #[cfg(test)] mod test_curlylint {} diff --git a/mdsf/src/tools/d_2_fmt.rs b/mdsf/src/tools/d_2_fmt.rs index 1f481e05..b5d41a54 100644 --- a/mdsf/src/tools/d_2_fmt.rs +++ b/mdsf/src/tools/d_2_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_d_2_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_d_2_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("d2")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_d_2_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("d2")]; #[cfg(test)] mod test_d_2_fmt {} diff --git a/mdsf/src/tools/dart_fix.rs b/mdsf/src/tools/dart_fix.rs index 78a72b76..ba9472ab 100644 --- a/mdsf/src/tools/dart_fix.rs +++ b/mdsf/src/tools/dart_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dart_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_dart_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dart")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dart_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dart")]; #[cfg(test)] mod test_dart_fix {} diff --git a/mdsf/src/tools/dart_format.rs b/mdsf/src/tools/dart_format.rs index 5fc66d75..69d017f8 100644 --- a/mdsf/src/tools/dart_format.rs +++ b/mdsf/src/tools/dart_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dart_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,36 +13,32 @@ fn set_dart_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dart")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dart_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dart")]; #[cfg(test)] mod test_dart_format { #[test_with::executable(dart)] - fn test_dart_format_dart_d00f785063b3cede() { + fn test_dart_format_dart_1e68d7619b4be391() { let input = r#"class Adder { int add(int a, int b) { return a + b; } } "#; - let output = Some( - r#"class Adder { + + let output = r#"class Adder { int add(int a, int b) { return a + b; } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("dart"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::dart_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/dcm_fix.rs b/mdsf/src/tools/dcm_fix.rs index 0cbd7fc3..52bbcee3 100644 --- a/mdsf/src/tools/dcm_fix.rs +++ b/mdsf/src/tools/dcm_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dcm_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_dcm_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dcm")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dcm_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dcm")]; #[cfg(test)] mod test_dcm_fix {} diff --git a/mdsf/src/tools/dcm_format.rs b/mdsf/src/tools/dcm_format.rs index f781ce59..83591ba7 100644 --- a/mdsf/src/tools/dcm_format.rs +++ b/mdsf/src/tools/dcm_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dcm_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_dcm_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dcm")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dcm_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dcm")]; #[cfg(test)] mod test_dcm_format {} diff --git a/mdsf/src/tools/deadnix.rs b/mdsf/src/tools/deadnix.rs index e1c3c6b1..4df9ef91 100644 --- a/mdsf/src/tools/deadnix.rs +++ b/mdsf/src/tools/deadnix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_deadnix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_deadnix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("deadnix")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_deadnix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("deadnix")]; #[cfg(test)] mod test_deadnix {} diff --git a/mdsf/src/tools/deno_fmt.rs b/mdsf/src/tools/deno_fmt.rs index fddccff0..4a966c3f 100644 --- a/mdsf/src/tools/deno_fmt.rs +++ b/mdsf/src/tools/deno_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_deno_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,44 +14,40 @@ fn set_deno_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("deno")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_deno_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("deno")]; #[cfg(test)] mod test_deno_fmt { #[test_with::executable(deno)] - fn test_deno_fmt_javascript_7a64a04e758eecef() { + fn test_deno_fmt_javascript_d7445fa122fcd5cc() { let input = r#" async function asyncAddition(a,b){ return a+b } "#; - let output = Some( - r#"async function asyncAddition(a, b) { + + let output = r#"async function asyncAddition(a, b) { return a + b; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("javascript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::deno_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(deno)] - fn test_deno_fmt_typescript_7f6a42002496954d() { + fn test_deno_fmt_typescript_857476c85438ce71() { let input = r#" async function asyncAddition( a: number,b:number ) :Promise< number> { @@ -59,24 +55,28 @@ mod test_deno_fmt { } "#; - let output = Some( - r#"async function asyncAddition(a: number, b: number): Promise { + + let output = r#"async function asyncAddition(a: number, b: number): Promise { return a + b; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("typescript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::deno_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(deno)] - fn test_deno_fmt_json_9cf77f718b7f7e0c() { + fn test_deno_fmt_json_d426a9ade74002d2() { let input = r#" { "key": "value", @@ -87,8 +87,8 @@ mod test_deno_fmt { , null] } "#; - let output = Some( - r#"{ + + let output = r#"{ "key": "value", "key2": [ "value2", @@ -97,15 +97,19 @@ mod test_deno_fmt { null ] } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("json"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::deno_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/deno_lint.rs b/mdsf/src/tools/deno_lint.rs index f226d1ea..b424c565 100644 --- a/mdsf/src/tools/deno_lint.rs +++ b/mdsf/src/tools/deno_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_deno_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_deno_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("deno")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_deno_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("deno")]; #[cfg(test)] mod test_deno_lint {} diff --git a/mdsf/src/tools/dfmt.rs b/mdsf/src/tools/dfmt.rs index e4e2c414..b35da38e 100644 --- a/mdsf/src/tools/dfmt.rs +++ b/mdsf/src/tools/dfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_dfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dfmt")]; #[cfg(test)] mod test_dfmt {} diff --git a/mdsf/src/tools/dhall.rs b/mdsf/src/tools/dhall.rs index 5785511e..8518738e 100644 --- a/mdsf/src/tools/dhall.rs +++ b/mdsf/src/tools/dhall.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dhall_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_dhall_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dhall")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dhall_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dhall")]; #[cfg(test)] mod test_dhall {} diff --git a/mdsf/src/tools/djade.rs b/mdsf/src/tools/djade.rs index 7bb7a4d3..13ca5c8b 100644 --- a/mdsf/src/tools/djade.rs +++ b/mdsf/src/tools/djade.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_djade_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_djade_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("djade")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_djade_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("djade")]; #[cfg(test)] mod test_djade {} diff --git a/mdsf/src/tools/djlint.rs b/mdsf/src/tools/djlint.rs index 5d6b4a13..1f756723 100644 --- a/mdsf/src/tools/djlint.rs +++ b/mdsf/src/tools/djlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_djlint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_djlint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("djlint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_djlint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("djlint")]; #[cfg(test)] mod test_djlint {} diff --git a/mdsf/src/tools/docformatter.rs b/mdsf/src/tools/docformatter.rs index d57a2951..3edb5a84 100644 --- a/mdsf/src/tools/docformatter.rs +++ b/mdsf/src/tools/docformatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_docformatter_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_docformatter_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("docformatter")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_docformatter_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("docformatter")]; #[cfg(test)] mod test_docformatter {} diff --git a/mdsf/src/tools/dockfmt.rs b/mdsf/src/tools/dockfmt.rs index 48d5191a..890ef164 100644 --- a/mdsf/src/tools/dockfmt.rs +++ b/mdsf/src/tools/dockfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dockfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_dockfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dockfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dockfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dockfmt")]; #[cfg(test)] mod test_dockfmt {} diff --git a/mdsf/src/tools/docstrfmt.rs b/mdsf/src/tools/docstrfmt.rs index 04da6a53..b543c342 100644 --- a/mdsf/src/tools/docstrfmt.rs +++ b/mdsf/src/tools/docstrfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_docstrfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_docstrfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("docstrfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_docstrfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("docstrfmt")]; #[cfg(test)] mod test_docstrfmt {} diff --git a/mdsf/src/tools/doctoc.rs b/mdsf/src/tools/doctoc.rs index 2de77e94..b4375c7c 100644 --- a/mdsf/src/tools/doctoc.rs +++ b/mdsf/src/tools/doctoc.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_doctoc_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,19 +12,11 @@ fn set_doctoc_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("doctoc"), CommandType::Direct("doctoc"), CommandType::Npm("doctoc"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_doctoc_args) -} - #[cfg(test)] mod test_doctoc {} diff --git a/mdsf/src/tools/dotenv_linter_fix.rs b/mdsf/src/tools/dotenv_linter_fix.rs index a6dacc12..ec19f899 100644 --- a/mdsf/src/tools/dotenv_linter_fix.rs +++ b/mdsf/src/tools/dotenv_linter_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dotenv_linter_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_dotenv_linter_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("dotenv-linter")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dotenv_linter_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("dotenv-linter")]; #[cfg(test)] mod test_dotenv_linter_fix {} diff --git a/mdsf/src/tools/dprint_fmt.rs b/mdsf/src/tools/dprint_fmt.rs index 35b1df5a..8f9f3d85 100644 --- a/mdsf/src/tools/dprint_fmt.rs +++ b/mdsf/src/tools/dprint_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_dprint_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_dprint_fmt_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("dprint"), CommandType::Direct("dprint"), CommandType::Npm("dprint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_dprint_fmt_args) -} - #[cfg(test)] mod test_dprint_fmt {} diff --git a/mdsf/src/tools/easy_coding_standard.rs b/mdsf/src/tools/easy_coding_standard.rs index 9b67dc55..0387a7f0 100644 --- a/mdsf/src/tools/easy_coding_standard.rs +++ b/mdsf/src/tools/easy_coding_standard.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_easy_coding_standard_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,15 +15,7 @@ fn set_easy_coding_standard_args( cmd } -const COMMANDS: [CommandType; 2] = [CommandType::PhpVendor("ecs"), CommandType::Direct("ecs")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_easy_coding_standard_args) -} +pub const COMMANDS: [CommandType; 2] = [CommandType::PhpVendor("ecs"), CommandType::Direct("ecs")]; #[cfg(test)] mod test_easy_coding_standard {} diff --git a/mdsf/src/tools/efmt.rs b/mdsf/src/tools/efmt.rs index 6077fa3c..973f743a 100644 --- a/mdsf/src/tools/efmt.rs +++ b/mdsf/src/tools/efmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_efmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,35 +13,31 @@ fn set_efmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("efmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_efmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("efmt")]; #[cfg(test)] mod test_efmt { #[test_with::executable(efmt)] - fn test_efmt_erlang_178ba575237af84d() { + fn test_efmt_erlang_d4d88e49805fdb39() { let input = r#"what_is(Erlang) -> case Erlang of movie->[hello(mike,joe,robert),credits]; language->formatting_arguments end ."#; - let output = Some( - r#"what_is(Erlang) -> + + let output = r#"what_is(Erlang) -> case Erlang of movie -> [hello(mike, joe, robert), credits]; language -> formatting_arguments end. -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("erlang"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::efmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/elm_format.rs b/mdsf/src/tools/elm_format.rs index 0e2cd7ec..b99dc9e8 100644 --- a/mdsf/src/tools/elm_format.rs +++ b/mdsf/src/tools/elm_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_elm_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,24 +14,16 @@ fn set_elm_format_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("elm-format"), CommandType::Direct("elm-format"), CommandType::Npm("elm-format"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_elm_format_args) -} - #[cfg(test)] mod test_elm_format { #[test_with::executable(npx)] - fn test_elm_format_elm_41c70725416bd82a() { + fn test_elm_format_elm_4e120501af0177c4() { let input = r#"import Html exposing (text) @@ -40,23 +32,27 @@ main = "#; - let output = Some( - r#"module Main exposing (main) + + let output = r#"module Main exposing (main) import Html exposing (text) main = text "Hello!" -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("elm"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::elm_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/erb_formatter.rs b/mdsf/src/tools/erb_formatter.rs index 07125351..f49cabcc 100644 --- a/mdsf/src/tools/erb_formatter.rs +++ b/mdsf/src/tools/erb_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_erb_formatter_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_erb_formatter_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("erb-format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_erb_formatter_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("erb-format")]; #[cfg(test)] mod test_erb_formatter {} diff --git a/mdsf/src/tools/erlfmt.rs b/mdsf/src/tools/erlfmt.rs index 60252ca7..47dab6a7 100644 --- a/mdsf/src/tools/erlfmt.rs +++ b/mdsf/src/tools/erlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_erlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,37 +13,33 @@ fn set_erlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("erlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_erlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("erlfmt")]; #[cfg(test)] mod test_erlfmt { #[test_with::executable(erlfmt)] - fn test_erlfmt_erlang_90fa4b828bc9873() { + fn test_erlfmt_erlang_61f4ac26ad7484d2() { let input = r#"what_is(Erlang) -> case Erlang of movie->[hello(mike,joe,robert),credits]; language->formatting_arguments end ."#; - let output = Some( - r#"what_is(Erlang) -> + + let output = r#"what_is(Erlang) -> case Erlang of movie -> [hello(mike, joe, robert), credits]; language -> no_more_formatting_arguments - end."# - .to_owned(), - ); + end."#; + let file_ext = crate::fttype::get_file_extension("erlang"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::erlfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/eslint.rs b/mdsf/src/tools/eslint.rs index 4dab0a15..fdee468d 100644 --- a/mdsf/src/tools/eslint.rs +++ b/mdsf/src/tools/eslint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_eslint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_eslint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("eslint"), CommandType::Direct("eslint"), CommandType::Npm("eslint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_eslint_args) -} - #[cfg(test)] mod test_eslint {} diff --git a/mdsf/src/tools/fantomas.rs b/mdsf/src/tools/fantomas.rs index fcaa90ea..855da681 100644 --- a/mdsf/src/tools/fantomas.rs +++ b/mdsf/src/tools/fantomas.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_fantomas_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,34 +12,30 @@ fn set_fantomas_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("fantomas")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fantomas_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("fantomas")]; #[cfg(test)] mod test_fantomas { #[test_with::executable(fantomas)] - fn test_fantomas_fsharp_ab29154716f5fe8a() { + fn test_fantomas_fsharp_f3cb7f290d0660d3() { let input = r#" let add a b = a + b "#; - let output = Some( - r#"let add a b = a + b -"# - .to_owned(), - ); + + let output = r#"let add a b = a + b +"#; + let file_ext = crate::fttype::get_file_extension("fsharp"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::fantomas::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/fish_indent.rs b/mdsf/src/tools/fish_indent.rs index dcdfcbe6..57092a5d 100644 --- a/mdsf/src/tools/fish_indent.rs +++ b/mdsf/src/tools/fish_indent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_fish_indent_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_fish_indent_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("fish_indent")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fish_indent_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("fish_indent")]; #[cfg(test)] mod test_fish_indent {} diff --git a/mdsf/src/tools/fixjson.rs b/mdsf/src/tools/fixjson.rs index fa5d9921..3fadd6a5 100644 --- a/mdsf/src/tools/fixjson.rs +++ b/mdsf/src/tools/fixjson.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_fixjson_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_fixjson_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("fixjson"), CommandType::Direct("fixjson"), CommandType::Npm("fixjson"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fixjson_args) -} - #[cfg(test)] mod test_fixjson {} diff --git a/mdsf/src/tools/floskell.rs b/mdsf/src/tools/floskell.rs index fab5503e..4c8bce4c 100644 --- a/mdsf/src/tools/floskell.rs +++ b/mdsf/src/tools/floskell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_floskell_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_floskell_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("floskell")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_floskell_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("floskell")]; #[cfg(test)] mod test_floskell {} diff --git a/mdsf/src/tools/fnlfmt.rs b/mdsf/src/tools/fnlfmt.rs index 361b6ee1..d8d9019f 100644 --- a/mdsf/src/tools/fnlfmt.rs +++ b/mdsf/src/tools/fnlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_fnlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_fnlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("fnlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fnlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("fnlfmt")]; #[cfg(test)] mod test_fnlfmt {} diff --git a/mdsf/src/tools/forge_fmt.rs b/mdsf/src/tools/forge_fmt.rs index 971ff229..ba84be6c 100644 --- a/mdsf/src/tools/forge_fmt.rs +++ b/mdsf/src/tools/forge_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_forge_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_forge_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("forge")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_forge_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("forge")]; #[cfg(test)] mod test_forge_fmt {} diff --git a/mdsf/src/tools/fourmolu.rs b/mdsf/src/tools/fourmolu.rs index da3fa369..3b193d79 100644 --- a/mdsf/src/tools/fourmolu.rs +++ b/mdsf/src/tools/fourmolu.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_fourmolu_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,38 +13,34 @@ fn set_fourmolu_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("fourmolu")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fourmolu_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("fourmolu")]; #[cfg(test)] mod test_fourmolu { #[test_with::executable(fourmolu)] - fn test_fourmolu_haskell_53dde041426fce49() { + fn test_fourmolu_haskell_718612a8aa064d19() { let input = r#" addNumbers::Int->Int->Int addNumbers a b = do a + b "#; - let output = Some( - r#"addNumbers :: Int -> Int -> Int + + let output = r#"addNumbers :: Int -> Int -> Int addNumbers a b = do a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("haskell"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::fourmolu::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/fprettify.rs b/mdsf/src/tools/fprettify.rs index 5e0b3436..3d7c89f6 100644 --- a/mdsf/src/tools/fprettify.rs +++ b/mdsf/src/tools/fprettify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_fprettify_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,20 +12,12 @@ fn set_fprettify_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("fprettify")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_fprettify_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("fprettify")]; #[cfg(test)] mod test_fprettify { #[test_with::executable(fprettify)] - fn test_fprettify_fortran_ce930c5694219991() { + fn test_fprettify_fortran_e500b54621ef1a7a() { let input = r#"program demo integer :: endif,if,elseif integer,DIMENSION(2) :: function @@ -39,8 +31,8 @@ function(if)=endif/elseif print*,endif endif end program"#; - let output = Some( - r#"program demo + + let output = r#"program demo integer :: endif, if, elseif integer, DIMENSION(2) :: function endif = 3; if = 2 @@ -53,15 +45,19 @@ end program"#; print *, endif end if end program -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("fortran"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::fprettify::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/futhark_fmt.rs b/mdsf/src/tools/futhark_fmt.rs index 52905549..9b6cdfd0 100644 --- a/mdsf/src/tools/futhark_fmt.rs +++ b/mdsf/src/tools/futhark_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_futhark_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_futhark_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("futhark")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_futhark_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("futhark")]; #[cfg(test)] mod test_futhark_fmt {} diff --git a/mdsf/src/tools/gci.rs b/mdsf/src/tools/gci.rs index 106e615f..a50f7dbb 100644 --- a/mdsf/src/tools/gci.rs +++ b/mdsf/src/tools/gci.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_gci_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,15 +15,7 @@ fn set_gci_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("gci")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gci_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("gci")]; #[cfg(test)] mod test_gci {} diff --git a/mdsf/src/tools/gdformat.rs b/mdsf/src/tools/gdformat.rs index 2c18395c..f9794639 100644 --- a/mdsf/src/tools/gdformat.rs +++ b/mdsf/src/tools/gdformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_gdformat_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_gdformat_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("gdformat")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gdformat_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("gdformat")]; #[cfg(test)] mod test_gdformat {} diff --git a/mdsf/src/tools/gersemi.rs b/mdsf/src/tools/gersemi.rs index 56956725..989c9f26 100644 --- a/mdsf/src/tools/gersemi.rs +++ b/mdsf/src/tools/gersemi.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_gersemi_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_gersemi_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("gersemi")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gersemi_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("gersemi")]; #[cfg(test)] mod test_gersemi {} diff --git a/mdsf/src/tools/gleam_format.rs b/mdsf/src/tools/gleam_format.rs index ea210ff8..057e0919 100644 --- a/mdsf/src/tools/gleam_format.rs +++ b/mdsf/src/tools/gleam_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_gleam_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,34 +13,30 @@ fn set_gleam_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("gleam")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gleam_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("gleam")]; #[cfg(test)] mod test_gleam_format { #[test_with::executable(gleam)] - fn test_gleam_format_gleam_1c8414a45f66b1da() { + fn test_gleam_format_gleam_d23656d11ef3a81d() { let input = r#"pub fn add(a:Int,b:Int)->Int{a+b}"#; - let output = Some( - r#"pub fn add(a: Int, b: Int) -> Int { + + let output = r#"pub fn add(a: Int, b: Int) -> Int { a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("gleam"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::gleam_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/gluon_fmt.rs b/mdsf/src/tools/gluon_fmt.rs index 94f9e40f..c858028c 100644 --- a/mdsf/src/tools/gluon_fmt.rs +++ b/mdsf/src/tools/gluon_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_gluon_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_gluon_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("gluon")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gluon_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("gluon")]; #[cfg(test)] mod test_gluon_fmt {} diff --git a/mdsf/src/tools/gofmt.rs b/mdsf/src/tools/gofmt.rs index bb446d0c..7e5eab7b 100644 --- a/mdsf/src/tools/gofmt.rs +++ b/mdsf/src/tools/gofmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_gofmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_gofmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("gofmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gofmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("gofmt")]; #[cfg(test)] mod test_gofmt { #[test_with::executable(gofmt)] - fn test_gofmt_go_e8804a3fa960a187() { + fn test_gofmt_go_3b56f602fe22977b() { let input = r#"package main func add(a int , b int ) int { @@ -34,21 +26,25 @@ mod test_gofmt { } "#; - let output = Some( - r#"package main + + let output = r#"package main func add(a int, b int) int { return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("go"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::gofmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/gofumpt.rs b/mdsf/src/tools/gofumpt.rs index 4fabfd37..bc6810c0 100644 --- a/mdsf/src/tools/gofumpt.rs +++ b/mdsf/src/tools/gofumpt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_gofumpt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_gofumpt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("gofumpt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_gofumpt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("gofumpt")]; #[cfg(test)] mod test_gofumpt { #[test_with::executable(gofumpt)] - fn test_gofumpt_go_e8804a3fa960a187() { + fn test_gofumpt_go_3b56f602fe22977b() { let input = r#"package main func add(a int , b int ) int { @@ -34,21 +26,25 @@ mod test_gofumpt { } "#; - let output = Some( - r#"package main + + let output = r#"package main func add(a int, b int) int { return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("go"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::gofumpt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/goimports.rs b/mdsf/src/tools/goimports.rs index f82b4d65..9671784c 100644 --- a/mdsf/src/tools/goimports.rs +++ b/mdsf/src/tools/goimports.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_goimports_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_goimports_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("goimports")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_goimports_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("goimports")]; #[cfg(test)] mod test_goimports { #[test_with::executable(goimports)] - fn test_goimports_go_581afd5c8f294d82() { + fn test_goimports_go_4af43f410d7fff15() { let input = r#"package main import ( @@ -40,8 +32,8 @@ func add(a int, b int) int { return a + b } "#; - let output = Some( - r#"package main + + let output = r#"package main import ( "fmt" @@ -52,15 +44,19 @@ func add(a int, b int) int { fmt.Print(b) return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("go"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::goimports::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/goimports_reviser.rs b/mdsf/src/tools/goimports_reviser.rs index 1b22d0a0..71def58f 100644 --- a/mdsf/src/tools/goimports_reviser.rs +++ b/mdsf/src/tools/goimports_reviser.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_goimports_reviser_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_goimports_reviser_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("goimports-reviser")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_goimports_reviser_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("goimports-reviser")]; #[cfg(test)] mod test_goimports_reviser {} diff --git a/mdsf/src/tools/golines.rs b/mdsf/src/tools/golines.rs index 39c61871..b0813b63 100644 --- a/mdsf/src/tools/golines.rs +++ b/mdsf/src/tools/golines.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_golines_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_golines_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("golines")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_golines_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("golines")]; #[cfg(test)] mod test_golines { #[test_with::executable(golines)] - fn test_golines_go_581afd5c8f294d82() { + fn test_golines_go_4af43f410d7fff15() { let input = r#"package main import ( @@ -40,8 +32,8 @@ func add(a int, b int) int { return a + b } "#; - let output = Some( - r#"package main + + let output = r#"package main import ( "fmt" @@ -52,15 +44,19 @@ func add(a int, b int) int { fmt.Print(b) return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("go"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::golines::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/google_java_format.rs b/mdsf/src/tools/google_java_format.rs index a333f8a6..513c9317 100644 --- a/mdsf/src/tools/google_java_format.rs +++ b/mdsf/src/tools/google_java_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_google_java_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,42 +13,38 @@ fn set_google_java_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("google-java-format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_google_java_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("google-java-format")]; #[cfg(test)] mod test_google_java_format { #[test_with::executable(google-java-format)] - fn test_google_java_format_java_4950b011328e8048() { + fn test_google_java_format_java_9d3ffaedafc37e65() { let input = r#"class HelloWorld { public static void main(String[] args) { System.out.println("Hello"); System.out.println("World!"); } }"#; - let output = Some( - r#"class HelloWorld { + + let output = r#"class HelloWorld { public static void main(String[] args) { System.out.println("Hello"); System.out.println("World!"); } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("java"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::google_java_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/grain_format.rs b/mdsf/src/tools/grain_format.rs index d1cd7373..76ef23e9 100644 --- a/mdsf/src/tools/grain_format.rs +++ b/mdsf/src/tools/grain_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_grain_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,37 +15,33 @@ fn set_grain_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("grain")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_grain_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("grain")]; #[cfg(test)] mod test_grain_format { #[test_with::executable(grain)] - fn test_grain_format_grain_58d469af4df1abea() { + fn test_grain_format_grain_68b6e8ad56bbb476() { let input = r#"module Hello print("Hello, world!") "#; - let output = Some( - r#"module Hello + + let output = r#"module Hello print("Hello, world!") -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("grain"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::grain_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/hadolint.rs b/mdsf/src/tools/hadolint.rs index 280bfb8f..391a8da7 100644 --- a/mdsf/src/tools/hadolint.rs +++ b/mdsf/src/tools/hadolint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_hadolint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_hadolint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("hadolint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hadolint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("hadolint")]; #[cfg(test)] mod test_hadolint {} diff --git a/mdsf/src/tools/haml_lint.rs b/mdsf/src/tools/haml_lint.rs index 76c4501f..5494ce50 100644 --- a/mdsf/src/tools/haml_lint.rs +++ b/mdsf/src/tools/haml_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_haml_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_haml_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("haml-lint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_haml_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("haml-lint")]; #[cfg(test)] mod test_haml_lint {} diff --git a/mdsf/src/tools/hclfmt.rs b/mdsf/src/tools/hclfmt.rs index def4f70e..e9476547 100644 --- a/mdsf/src/tools/hclfmt.rs +++ b/mdsf/src/tools/hclfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_hclfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_hclfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("hclfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hclfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("hclfmt")]; #[cfg(test)] mod test_hclfmt {} diff --git a/mdsf/src/tools/hfmt.rs b/mdsf/src/tools/hfmt.rs index 3ff26b4d..1508f416 100644 --- a/mdsf/src/tools/hfmt.rs +++ b/mdsf/src/tools/hfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_hfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_hfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("hfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("hfmt")]; #[cfg(test)] mod test_hfmt {} diff --git a/mdsf/src/tools/hindent.rs b/mdsf/src/tools/hindent.rs index 148d5ecf..73c4d282 100644 --- a/mdsf/src/tools/hindent.rs +++ b/mdsf/src/tools/hindent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_hindent_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,38 +12,34 @@ fn set_hindent_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("hindent")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hindent_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("hindent")]; #[cfg(test)] mod test_hindent { #[test_with::executable(hindent)] - fn test_hindent_haskell_45197b0621b034d0() { + fn test_hindent_haskell_c34a44cf19c5fdd7() { let input = r#" addNumbers::Int->Int->Int addNumbers a b = do a + b "#; - let output = Some( - r#"addNumbers :: Int -> Int -> Int + + let output = r#"addNumbers :: Int -> Int -> Int addNumbers a b = do a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("haskell"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::hindent::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/hlint.rs b/mdsf/src/tools/hlint.rs index 45623ac2..1c28ae68 100644 --- a/mdsf/src/tools/hlint.rs +++ b/mdsf/src/tools/hlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_hlint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_hlint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("hlint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_hlint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("hlint")]; #[cfg(test)] mod test_hlint {} diff --git a/mdsf/src/tools/html_beautify.rs b/mdsf/src/tools/html_beautify.rs index a1b1a28c..e368680b 100644 --- a/mdsf/src/tools/html_beautify.rs +++ b/mdsf/src/tools/html_beautify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_html_beautify_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -16,43 +16,39 @@ fn set_html_beautify_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("html-beautify"), CommandType::Direct("html-beautify"), CommandType::Npm("js-beautify"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_html_beautify_args) -} - #[cfg(test)] mod test_html_beautify { #[test_with::executable(npx)] - fn test_html_beautify_html_11e43869538b61e8() { + fn test_html_beautify_html_63850f31f2ef5caf() { let input = r#"

Mads was here

"#; - let output = Some( - r#"
+ + let output = r#"

Mads was here

-
"# - .to_owned(), - ); +
"#; + let file_ext = crate::fttype::get_file_extension("html"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::html_beautify::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/htmlbeautifier.rs b/mdsf/src/tools/htmlbeautifier.rs index 447f403a..700a0765 100644 --- a/mdsf/src/tools/htmlbeautifier.rs +++ b/mdsf/src/tools/htmlbeautifier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_htmlbeautifier_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,40 +12,36 @@ fn set_htmlbeautifier_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("htmlbeautifier")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_htmlbeautifier_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("htmlbeautifier")]; #[cfg(test)] mod test_htmlbeautifier { #[test_with::executable(htmlbeautifier)] - fn test_htmlbeautifier_html_6fdcd2ce3ffada76() { + fn test_htmlbeautifier_html_7e86d833d3fbf4e3() { let input = r#"

Mads was here

"#; - let output = Some( - r#"
+ + let output = r#"

Mads was here

-"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("html"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::htmlbeautifier::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/htmlhint.rs b/mdsf/src/tools/htmlhint.rs index fdae2f8e..6383726a 100644 --- a/mdsf/src/tools/htmlhint.rs +++ b/mdsf/src/tools/htmlhint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_htmlhint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,19 +12,11 @@ fn set_htmlhint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("htmlhint"), CommandType::Direct("htmlhint"), CommandType::Npm("htmlhint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_htmlhint_args) -} - #[cfg(test)] mod test_htmlhint {} diff --git a/mdsf/src/tools/imba_fmt.rs b/mdsf/src/tools/imba_fmt.rs index 8d9cea35..8a4b0db2 100644 --- a/mdsf/src/tools/imba_fmt.rs +++ b/mdsf/src/tools/imba_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_imba_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,19 +14,11 @@ fn set_imba_fmt_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("imba"), CommandType::Direct("imba"), CommandType::Npm("imba"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_imba_fmt_args) -} - #[cfg(test)] mod test_imba_fmt {} diff --git a/mdsf/src/tools/inko_fmt.rs b/mdsf/src/tools/inko_fmt.rs index 1f529997..1ba8f2db 100644 --- a/mdsf/src/tools/inko_fmt.rs +++ b/mdsf/src/tools/inko_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_inko_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_inko_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("inko")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_inko_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("inko")]; #[cfg(test)] mod test_inko_fmt {} diff --git a/mdsf/src/tools/isort.rs b/mdsf/src/tools/isort.rs index 41774885..d47abf69 100644 --- a/mdsf/src/tools/isort.rs +++ b/mdsf/src/tools/isort.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_isort_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_isort_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("isort")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_isort_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("isort")]; #[cfg(test)] mod test_isort { #[test_with::executable(isort)] - fn test_isort_python_60a4eb49e083b28f() { + fn test_isort_python_e2ac93e0195d9bc1() { let input = r#"from q import d import b import a @@ -36,8 +28,8 @@ import c def add(a: int, b: int) -> int: return a + b "#; - let output = Some( - r#"import a + + let output = r#"import a import b import c from q import d @@ -45,15 +37,19 @@ from q import d def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::isort::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/joker.rs b/mdsf/src/tools/joker.rs index 49e0df5a..5f60224f 100644 --- a/mdsf/src/tools/joker.rs +++ b/mdsf/src/tools/joker.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_joker_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_joker_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("joker")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_joker_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("joker")]; #[cfg(test)] mod test_joker {} diff --git a/mdsf/src/tools/js_beautify.rs b/mdsf/src/tools/js_beautify.rs index 7e5256f6..6bd9caf7 100644 --- a/mdsf/src/tools/js_beautify.rs +++ b/mdsf/src/tools/js_beautify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_js_beautify_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -16,19 +16,11 @@ fn set_js_beautify_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("js-beautify"), CommandType::Direct("js-beautify"), CommandType::Npm("js-beautify"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_js_beautify_args) -} - #[cfg(test)] mod test_js_beautify {} diff --git a/mdsf/src/tools/json_5_format.rs b/mdsf/src/tools/json_5_format.rs index 29467a59..19f5f83a 100644 --- a/mdsf/src/tools/json_5_format.rs +++ b/mdsf/src/tools/json_5_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_json_5_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_json_5_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("json5format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_json_5_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("json5format")]; #[cfg(test)] mod test_json_5_format {} diff --git a/mdsf/src/tools/jsona_format.rs b/mdsf/src/tools/jsona_format.rs index 446cf1e5..4ba7d8cd 100644 --- a/mdsf/src/tools/jsona_format.rs +++ b/mdsf/src/tools/jsona_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_jsona_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_jsona_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsona")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsona_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsona")]; #[cfg(test)] mod test_jsona_format {} diff --git a/mdsf/src/tools/jsona_lint.rs b/mdsf/src/tools/jsona_lint.rs index 9a65109c..e814b6ee 100644 --- a/mdsf/src/tools/jsona_lint.rs +++ b/mdsf/src/tools/jsona_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_jsona_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_jsona_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsona")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsona_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsona")]; #[cfg(test)] mod test_jsona_lint {} diff --git a/mdsf/src/tools/jsonlint.rs b/mdsf/src/tools/jsonlint.rs index 8fcb49fd..f9b4d657 100644 --- a/mdsf/src/tools/jsonlint.rs +++ b/mdsf/src/tools/jsonlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_jsonlint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_jsonlint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("jsonlint"), CommandType::Direct("jsonlint"), CommandType::Npm("jsonlint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsonlint_args) -} - #[cfg(test)] mod test_jsonlint {} diff --git a/mdsf/src/tools/jsonnet_lint.rs b/mdsf/src/tools/jsonnet_lint.rs index 13c26112..2e86a69b 100644 --- a/mdsf/src/tools/jsonnet_lint.rs +++ b/mdsf/src/tools/jsonnet_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_jsonnet_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_jsonnet_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsonnet-lint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsonnet_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsonnet-lint")]; #[cfg(test)] mod test_jsonnet_lint {} diff --git a/mdsf/src/tools/jsonnetfmt.rs b/mdsf/src/tools/jsonnetfmt.rs index 3e5823e6..e059887c 100644 --- a/mdsf/src/tools/jsonnetfmt.rs +++ b/mdsf/src/tools/jsonnetfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_jsonnetfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_jsonnetfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsonnetfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_jsonnetfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("jsonnetfmt")]; #[cfg(test)] mod test_jsonnetfmt {} diff --git a/mdsf/src/tools/juliaformatter_jl.rs b/mdsf/src/tools/juliaformatter_jl.rs index cb7d2b50..a0d72265 100644 --- a/mdsf/src/tools/juliaformatter_jl.rs +++ b/mdsf/src/tools/juliaformatter_jl.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_juliaformatter_jl_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,38 +14,34 @@ fn set_juliaformatter_jl_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("julia")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_juliaformatter_jl_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("julia")]; #[cfg(test)] mod test_juliaformatter_jl { #[test_with::executable(julia)] - fn test_juliaformatter_jl_julia_e931702b0e807c52() { + fn test_juliaformatter_jl_julia_6775294e3dc9244() { let input = r#"function add( a:: Int32, b::Int32 ) c = a+ b return c end "#; - let output = Some( - r#"function add(a::Int32, b::Int32) + + let output = r#"function add(a::Int32, b::Int32) c = a + b return c end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("julia"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::juliaformatter_jl::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/just.rs b/mdsf/src/tools/just.rs index d1e03c38..174d79f4 100644 --- a/mdsf/src/tools/just.rs +++ b/mdsf/src/tools/just.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_just_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,41 +15,37 @@ fn set_just_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("just"), CommandType::Direct("just"), CommandType::Npm("rust-just"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_just_args) -} - #[cfg(test)] mod test_just { #[test_with::executable(npx)] - fn test_just_just_9737c58292992524() { + fn test_just_just_ef70afaf3ede68b9() { let input = r#"build: cargo build cargo build --release "#; - let output = Some( - r#"build: + + let output = r#"build: cargo build cargo build --release -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("just"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::just::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/kcl_fmt.rs b/mdsf/src/tools/kcl_fmt.rs index a1fded88..d5e574f1 100644 --- a/mdsf/src/tools/kcl_fmt.rs +++ b/mdsf/src/tools/kcl_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_kcl_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_kcl_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("kcl")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kcl_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("kcl")]; #[cfg(test)] mod test_kcl_fmt { #[test_with::executable(kcl)] - fn test_kcl_fmt_kcl_9e5edc166801bc78() { + fn test_kcl_fmt_kcl_83078615f65197d1() { let input = r#"apiVersion = "apps/v1" kind = "Deployment" metadata = { @@ -44,8 +36,8 @@ spec = { }] } "#; - let output = Some( - r#"apiVersion = "apps/v1" + + let output = r#"apiVersion = "apps/v1" kind = "Deployment" metadata = { name = "nginx" @@ -61,15 +53,19 @@ spec = { ports = [{containerPort = 80}] }] } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("kcl"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::kcl_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/kcl_lint.rs b/mdsf/src/tools/kcl_lint.rs index d2fa253e..02c094b5 100644 --- a/mdsf/src/tools/kcl_lint.rs +++ b/mdsf/src/tools/kcl_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_kcl_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_kcl_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("kcl")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kcl_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("kcl")]; #[cfg(test)] mod test_kcl_lint {} diff --git a/mdsf/src/tools/kdlfmt.rs b/mdsf/src/tools/kdlfmt.rs index dd9972e7..c6d49cb9 100644 --- a/mdsf/src/tools/kdlfmt.rs +++ b/mdsf/src/tools/kdlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_kdlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_kdlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("kdlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kdlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("kdlfmt")]; #[cfg(test)] mod test_kdlfmt {} diff --git a/mdsf/src/tools/kdoc_formatter.rs b/mdsf/src/tools/kdoc_formatter.rs index 99273089..050e2025 100644 --- a/mdsf/src/tools/kdoc_formatter.rs +++ b/mdsf/src/tools/kdoc_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_kdoc_formatter_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_kdoc_formatter_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("kdoc-formatter")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kdoc_formatter_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("kdoc-formatter")]; #[cfg(test)] mod test_kdoc_formatter {} diff --git a/mdsf/src/tools/ktfmt.rs b/mdsf/src/tools/ktfmt.rs index 4175c743..d8ebd770 100644 --- a/mdsf/src/tools/ktfmt.rs +++ b/mdsf/src/tools/ktfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ktfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,37 +14,33 @@ fn set_ktfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ktfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ktfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ktfmt")]; #[cfg(test)] mod test_ktfmt { #[test_with::executable(ktfmt)] - fn test_ktfmt_kotlin_ad9f04d28e9a08c() { + fn test_ktfmt_kotlin_396c64cb15f3d642() { let input = r#" fun add(a:Int ,b:Int ):Int { return a + b } "#; - let output = Some( - r#"fun add(a: Int, b: Int): Int { + + let output = r#"fun add(a: Int, b: Int): Int { return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("kotlin"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::ktfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/ktlint.rs b/mdsf/src/tools/ktlint.rs index a88f4387..5067242a 100644 --- a/mdsf/src/tools/ktlint.rs +++ b/mdsf/src/tools/ktlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ktlint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,26 +14,18 @@ fn set_ktlint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ktlint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ktlint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ktlint")]; #[cfg(test)] mod test_ktlint { #[test_with::executable(ktlint)] - fn test_ktlint_kotlin_6b60db8bc8c2a271() { + fn test_ktlint_kotlin_65d99b8b0b9bf8e1() { let input = r#" fun add(a:Int ,b:Int ):Int { return a + b } "#; - let output = Some( - r#" + + let output = r#" fun add( a: Int, @@ -41,15 +33,19 @@ fun add( ): Int { return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("kotlin"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::ktlint::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/kulala_fmt.rs b/mdsf/src/tools/kulala_fmt.rs index c745c85b..fb4bec07 100644 --- a/mdsf/src/tools/kulala_fmt.rs +++ b/mdsf/src/tools/kulala_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_kulala_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_kulala_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("kulala-fmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_kulala_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("kulala-fmt")]; #[cfg(test)] mod test_kulala_fmt {} diff --git a/mdsf/src/tools/leptosfmt.rs b/mdsf/src/tools/leptosfmt.rs index 8e0e3d6d..94f26698 100644 --- a/mdsf/src/tools/leptosfmt.rs +++ b/mdsf/src/tools/leptosfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_leptosfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_leptosfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("leptosfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_leptosfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("leptosfmt")]; #[cfg(test)] mod test_leptosfmt {} diff --git a/mdsf/src/tools/liquidsoap_prettier.rs b/mdsf/src/tools/liquidsoap_prettier.rs index 39e0bbe0..48504042 100644 --- a/mdsf/src/tools/liquidsoap_prettier.rs +++ b/mdsf/src/tools/liquidsoap_prettier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_liquidsoap_prettier_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_liquidsoap_prettier_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("liquidsoap-prettier"), CommandType::Direct("liquidsoap-prettier"), CommandType::Npm("liquidsoap-prettier"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_liquidsoap_prettier_args) -} - #[cfg(test)] mod test_liquidsoap_prettier {} diff --git a/mdsf/src/tools/luacheck.rs b/mdsf/src/tools/luacheck.rs index 70ebd064..62c9f3ed 100644 --- a/mdsf/src/tools/luacheck.rs +++ b/mdsf/src/tools/luacheck.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_luacheck_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_luacheck_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("luacheck")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_luacheck_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("luacheck")]; #[cfg(test)] mod test_luacheck {} diff --git a/mdsf/src/tools/luaformatter.rs b/mdsf/src/tools/luaformatter.rs index 81257d41..53d6c35b 100644 --- a/mdsf/src/tools/luaformatter.rs +++ b/mdsf/src/tools/luaformatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_luaformatter_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_luaformatter_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("lua-format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_luaformatter_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("lua-format")]; #[cfg(test)] mod test_luaformatter { #[test_with::executable(lua-format)] - fn test_luaformatter_lua_b025fac1e27e4d1a() { + fn test_luaformatter_lua_df0e81b2c9a1a835() { let input = r#" local function add ( a , b @@ -37,21 +29,25 @@ return c end "#; - let output = Some( - r#"local function add(a, b) + + let output = r#"local function add(a, b) local c = a + b return c end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("lua"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::luaformatter::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/mado_check.rs b/mdsf/src/tools/mado_check.rs index 4096cbee..af8b4754 100644 --- a/mdsf/src/tools/mado_check.rs +++ b/mdsf/src/tools/mado_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_mado_check_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,33 +13,37 @@ fn set_mado_check_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("mado")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mado_check_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("mado")]; #[cfg(test)] mod test_mado_check { #[test_with::executable(mado)] - fn test_mado_check_markdown_dec3c84890502a43() { + fn test_mado_check_markdown_664925a21a5aec00() { let input = r#"# Hello world - Hello - world "#; - let output = None; + + let output = r#"# Hello world + +- Hello +- world + +"#; + let file_ext = crate::fttype::get_file_extension("markdown"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::mado_check::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/markdownfmt.rs b/mdsf/src/tools/markdownfmt.rs index f0ee30f6..b2b055a5 100644 --- a/mdsf/src/tools/markdownfmt.rs +++ b/mdsf/src/tools/markdownfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_markdownfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,43 +13,39 @@ fn set_markdownfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("markdownfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markdownfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("markdownfmt")]; #[cfg(test)] mod test_markdownfmt { #[test_with::executable(markdownfmt)] - fn test_markdownfmt_markdown_d1dd1e80b6688046() { + fn test_markdownfmt_markdown_9b495bc15a7833bc() { let input = r#"# hello w world this text has weird spacing - first * second"#; - let output = Some( - r#"hello w world + + let output = r#"hello w world ============= this text has weird spacing - first - second -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("markdown"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::markdownfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/markdownlint.rs b/mdsf/src/tools/markdownlint.rs index 9df92c6b..d48b75c9 100644 --- a/mdsf/src/tools/markdownlint.rs +++ b/mdsf/src/tools/markdownlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_markdownlint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,43 +13,39 @@ fn set_markdownlint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("markdownlint"), CommandType::Direct("markdownlint"), CommandType::Npm("markdownlint-cli"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markdownlint_args) -} - #[cfg(test)] mod test_markdownlint { #[test_with::executable(npx)] - fn test_markdownlint_markdown_40f9776569512cd() { + fn test_markdownlint_markdown_1f615768d8e575c5() { let input = r#"# Hello world - asd * vasd "#; - let output = Some( - r#"# Hello world + + let output = r#"# Hello world - asd - vasd -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("markdown"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::markdownlint::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/markdownlint_cli_2.rs b/mdsf/src/tools/markdownlint_cli_2.rs index a91ff825..7cf3955e 100644 --- a/mdsf/src/tools/markdownlint_cli_2.rs +++ b/mdsf/src/tools/markdownlint_cli_2.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_markdownlint_cli_2_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,43 +13,39 @@ fn set_markdownlint_cli_2_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("markdownlint-cli2"), CommandType::Direct("markdownlint-cli2"), CommandType::Npm("markdownlint-cli2"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markdownlint_cli_2_args) -} - #[cfg(test)] mod test_markdownlint_cli_2 { #[test_with::executable(npx)] - fn test_markdownlint_cli_2_markdown_40f9776569512cd() { + fn test_markdownlint_cli_2_markdown_1f615768d8e575c5() { let input = r#"# Hello world - asd * vasd "#; - let output = Some( - r#"# Hello world + + let output = r#"# Hello world - asd - vasd -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("markdown"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::markdownlint_cli_2::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/markuplint.rs b/mdsf/src/tools/markuplint.rs index b4e6a7c8..b36584c2 100644 --- a/mdsf/src/tools/markuplint.rs +++ b/mdsf/src/tools/markuplint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_markuplint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_markuplint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("markuplint"), CommandType::Direct("markuplint"), CommandType::Npm("markuplint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_markuplint_args) -} - #[cfg(test)] mod test_markuplint {} diff --git a/mdsf/src/tools/mdformat.rs b/mdsf/src/tools/mdformat.rs index 3414fb92..4ad2e5b5 100644 --- a/mdsf/src/tools/mdformat.rs +++ b/mdsf/src/tools/mdformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_mdformat_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_mdformat_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("mdformat")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mdformat_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("mdformat")]; #[cfg(test)] mod test_mdformat {} diff --git a/mdsf/src/tools/mdslw.rs b/mdsf/src/tools/mdslw.rs index f904f15e..8b2c6389 100644 --- a/mdsf/src/tools/mdslw.rs +++ b/mdsf/src/tools/mdslw.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_mdslw_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_mdslw_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("mdslw")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mdslw_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("mdslw")]; #[cfg(test)] mod test_mdslw {} diff --git a/mdsf/src/tools/meson_fmt.rs b/mdsf/src/tools/meson_fmt.rs index fba8d0bb..5a430fad 100644 --- a/mdsf/src/tools/meson_fmt.rs +++ b/mdsf/src/tools/meson_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_meson_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_meson_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("meson")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_meson_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("meson")]; #[cfg(test)] mod test_meson_fmt {} diff --git a/mdsf/src/tools/misspell.rs b/mdsf/src/tools/misspell.rs index 95bfd430..5d9226f0 100644 --- a/mdsf/src/tools/misspell.rs +++ b/mdsf/src/tools/misspell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_misspell_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_misspell_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("misspell")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_misspell_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("misspell")]; #[cfg(test)] mod test_misspell {} diff --git a/mdsf/src/tools/mix_format.rs b/mdsf/src/tools/mix_format.rs index 4fd0e85c..159711b0 100644 --- a/mdsf/src/tools/mix_format.rs +++ b/mdsf/src/tools/mix_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_mix_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,37 +13,33 @@ fn set_mix_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("mix")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mix_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("mix")]; #[cfg(test)] mod test_mix_format { #[test_with::executable(mix)] - fn test_mix_format_elixir_bd36c92a13ed14e6() { + fn test_mix_format_elixir_ab535c627dfb140() { let input = r#" def add(a , b ) do a + b end "#; - let output = Some( - r#"def add(a, b) do + + let output = r#"def add(a, b) do a + b end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("elixir"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::mix_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/mod.rs b/mdsf/src/tools/mod.rs index b9986d38..24a01eb4 100644 --- a/mdsf/src/tools/mod.rs +++ b/mdsf/src/tools/mod.rs @@ -1,6 +1,8 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// +use crate::execution::run_tools; + pub mod actionlint; pub mod alejandra; pub mod ameba; @@ -1286,260 +1288,1460 @@ impl Tooling { timeout: u64, ) -> Result<(bool, Option), crate::error::MdsfError> { match self { - Self::Actionlint => actionlint::run(snippet_path, timeout), - Self::Alejandra => alejandra::run(snippet_path, timeout), - Self::Ameba => ameba::run(snippet_path, timeout), - Self::AnsibleLint => ansible_lint::run(snippet_path, timeout), - Self::Asmfmt => asmfmt::run(snippet_path, timeout), - Self::Astyle => astyle::run(snippet_path, timeout), - Self::AutoOptional => auto_optional::run(snippet_path, timeout), - Self::Autocorrect => autocorrect::run(snippet_path, timeout), - Self::Autoflake => autoflake::run(snippet_path, timeout), - Self::Autopep8 => autopep_8::run(snippet_path, timeout), - Self::BeancountBlack => beancount_black::run(snippet_path, timeout), - Self::Beautysh => beautysh::run(snippet_path, timeout), - Self::BibtexTidy => bibtex_tidy::run(snippet_path, timeout), - Self::BicepFormat => bicep_format::run(snippet_path, timeout), - Self::BiomeCheck => biome_check::run(snippet_path, timeout), - Self::BiomeFormat => biome_format::run(snippet_path, timeout), - Self::BiomeLint => biome_lint::run(snippet_path, timeout), - Self::Black => black::run(snippet_path, timeout), - Self::BladeFormatter => blade_formatter::run(snippet_path, timeout), - Self::Blue => blue::run(snippet_path, timeout), - Self::Bpfmt => bpfmt::run(snippet_path, timeout), - Self::Brittany => brittany::run(snippet_path, timeout), - Self::Brunette => brunette::run(snippet_path, timeout), - Self::Bsfmt => bsfmt::run(snippet_path, timeout), - Self::Bslint => bslint::run(snippet_path, timeout), - Self::BufFormat => buf_format::run(snippet_path, timeout), - Self::Buildifier => buildifier::run(snippet_path, timeout), - Self::CabalFmt => cabal_fmt::run(snippet_path, timeout), - Self::CabalFormat => cabal_format::run(snippet_path, timeout), - Self::CabalPrettify => cabal_prettify::run(snippet_path, timeout), - Self::CaddyFmt => caddy_fmt::run(snippet_path, timeout), - Self::CaramelFmt => caramel_fmt::run(snippet_path, timeout), - Self::ClangFormat => clang_format::run(snippet_path, timeout), - Self::ClangTidy => clang_tidy::run(snippet_path, timeout), - Self::CljfmtFix => cljfmt_fix::run(snippet_path, timeout), - Self::Cljstyle => cljstyle::run(snippet_path, timeout), - Self::CmakeFormat => cmake_format::run(snippet_path, timeout), - Self::Codespell => codespell::run(snippet_path, timeout), - Self::Crlfmt => crlfmt::run(snippet_path, timeout), - Self::CrystalFormat => crystal_format::run(snippet_path, timeout), - Self::Csharpier => csharpier::run(snippet_path, timeout), - Self::CssBeautify => css_beautify::run(snippet_path, timeout), - Self::Csscomb => csscomb::run(snippet_path, timeout), - Self::Csslint => csslint::run(snippet_path, timeout), - Self::Curlylint => curlylint::run(snippet_path, timeout), - Self::D2Fmt => d_2_fmt::run(snippet_path, timeout), - Self::DartFix => dart_fix::run(snippet_path, timeout), - Self::DartFormat => dart_format::run(snippet_path, timeout), - Self::DcmFix => dcm_fix::run(snippet_path, timeout), - Self::DcmFormat => dcm_format::run(snippet_path, timeout), - Self::Deadnix => deadnix::run(snippet_path, timeout), - Self::DenoFmt => deno_fmt::run(snippet_path, timeout), - Self::DenoLint => deno_lint::run(snippet_path, timeout), - Self::Dfmt => dfmt::run(snippet_path, timeout), - Self::Dhall => dhall::run(snippet_path, timeout), - Self::Djade => djade::run(snippet_path, timeout), - Self::Djlint => djlint::run(snippet_path, timeout), - Self::Docformatter => docformatter::run(snippet_path, timeout), - Self::Dockfmt => dockfmt::run(snippet_path, timeout), - Self::Docstrfmt => docstrfmt::run(snippet_path, timeout), - Self::Doctoc => doctoc::run(snippet_path, timeout), - Self::DotenvLinterFix => dotenv_linter_fix::run(snippet_path, timeout), - Self::DprintFmt => dprint_fmt::run(snippet_path, timeout), - Self::EasyCodingStandard => easy_coding_standard::run(snippet_path, timeout), - Self::Efmt => efmt::run(snippet_path, timeout), - Self::ElmFormat => elm_format::run(snippet_path, timeout), - Self::ErbFormatter => erb_formatter::run(snippet_path, timeout), - Self::Erlfmt => erlfmt::run(snippet_path, timeout), - Self::Eslint => eslint::run(snippet_path, timeout), - Self::Fantomas => fantomas::run(snippet_path, timeout), - Self::FishIndent => fish_indent::run(snippet_path, timeout), - Self::Fixjson => fixjson::run(snippet_path, timeout), - Self::Floskell => floskell::run(snippet_path, timeout), - Self::Fnlfmt => fnlfmt::run(snippet_path, timeout), - Self::ForgeFmt => forge_fmt::run(snippet_path, timeout), - Self::Fourmolu => fourmolu::run(snippet_path, timeout), - Self::Fprettify => fprettify::run(snippet_path, timeout), - Self::FutharkFmt => futhark_fmt::run(snippet_path, timeout), - Self::Gci => gci::run(snippet_path, timeout), - Self::Gdformat => gdformat::run(snippet_path, timeout), - Self::Gersemi => gersemi::run(snippet_path, timeout), - Self::GleamFormat => gleam_format::run(snippet_path, timeout), - Self::GluonFmt => gluon_fmt::run(snippet_path, timeout), - Self::Gofmt => gofmt::run(snippet_path, timeout), - Self::Gofumpt => gofumpt::run(snippet_path, timeout), - Self::Goimports => goimports::run(snippet_path, timeout), - Self::GoimportsReviser => goimports_reviser::run(snippet_path, timeout), - Self::Golines => golines::run(snippet_path, timeout), - Self::GoogleJavaFormat => google_java_format::run(snippet_path, timeout), - Self::GrainFormat => grain_format::run(snippet_path, timeout), - Self::Hadolint => hadolint::run(snippet_path, timeout), - Self::HamlLint => haml_lint::run(snippet_path, timeout), - Self::Hclfmt => hclfmt::run(snippet_path, timeout), - Self::Hfmt => hfmt::run(snippet_path, timeout), - Self::Hindent => hindent::run(snippet_path, timeout), - Self::Hlint => hlint::run(snippet_path, timeout), - Self::HtmlBeautify => html_beautify::run(snippet_path, timeout), - Self::Htmlbeautifier => htmlbeautifier::run(snippet_path, timeout), - Self::Htmlhint => htmlhint::run(snippet_path, timeout), - Self::ImbaFmt => imba_fmt::run(snippet_path, timeout), - Self::InkoFmt => inko_fmt::run(snippet_path, timeout), - Self::Isort => isort::run(snippet_path, timeout), - Self::Joker => joker::run(snippet_path, timeout), - Self::JsBeautify => js_beautify::run(snippet_path, timeout), - Self::Json5Format => json_5_format::run(snippet_path, timeout), - Self::JsonaFormat => jsona_format::run(snippet_path, timeout), - Self::JsonaLint => jsona_lint::run(snippet_path, timeout), - Self::Jsonlint => jsonlint::run(snippet_path, timeout), - Self::JsonnetLint => jsonnet_lint::run(snippet_path, timeout), - Self::Jsonnetfmt => jsonnetfmt::run(snippet_path, timeout), - Self::JuliaformatterJl => juliaformatter_jl::run(snippet_path, timeout), - Self::Just => just::run(snippet_path, timeout), - Self::KclFmt => kcl_fmt::run(snippet_path, timeout), - Self::KclLint => kcl_lint::run(snippet_path, timeout), - Self::Kdlfmt => kdlfmt::run(snippet_path, timeout), - Self::KdocFormatter => kdoc_formatter::run(snippet_path, timeout), - Self::Ktfmt => ktfmt::run(snippet_path, timeout), - Self::Ktlint => ktlint::run(snippet_path, timeout), - Self::KulalaFmt => kulala_fmt::run(snippet_path, timeout), - Self::Leptosfmt => leptosfmt::run(snippet_path, timeout), - Self::LiquidsoapPrettier => liquidsoap_prettier::run(snippet_path, timeout), - Self::Luacheck => luacheck::run(snippet_path, timeout), - Self::Luaformatter => luaformatter::run(snippet_path, timeout), - Self::MadoCheck => mado_check::run(snippet_path, timeout), - Self::Markdownfmt => markdownfmt::run(snippet_path, timeout), - Self::Markdownlint => markdownlint::run(snippet_path, timeout), - Self::MarkdownlintCli2 => markdownlint_cli_2::run(snippet_path, timeout), - Self::Markuplint => markuplint::run(snippet_path, timeout), - Self::Mdformat => mdformat::run(snippet_path, timeout), - Self::Mdslw => mdslw::run(snippet_path, timeout), - Self::MesonFmt => meson_fmt::run(snippet_path, timeout), - Self::Misspell => misspell::run(snippet_path, timeout), - Self::MixFormat => mix_format::run(snippet_path, timeout), - Self::MojoFormat => mojo_format::run(snippet_path, timeout), - Self::Mypy => mypy::run(snippet_path, timeout), - Self::Nginxbeautifier => nginxbeautifier::run(snippet_path, timeout), - Self::Nginxfmt => nginxfmt::run(snippet_path, timeout), - Self::NickelFormat => nickel_format::run(snippet_path, timeout), - Self::Nimpretty => nimpretty::run(snippet_path, timeout), - Self::Nixfmt => nixfmt::run(snippet_path, timeout), - Self::NixpkgsFmt => nixpkgs_fmt::run(snippet_path, timeout), - Self::NomadFmt => nomad_fmt::run(snippet_path, timeout), - Self::Nph => nph::run(snippet_path, timeout), - Self::NpmGroovyLint => npm_groovy_lint::run(snippet_path, timeout), - Self::Nufmt => nufmt::run(snippet_path, timeout), - Self::Ocamlformat => ocamlformat::run(snippet_path, timeout), - Self::OcpIndent => ocp_indent::run(snippet_path, timeout), - Self::Odinfmt => odinfmt::run(snippet_path, timeout), - Self::OelintAdv => oelint_adv::run(snippet_path, timeout), - Self::OpaFmt => opa_fmt::run(snippet_path, timeout), - Self::Ormolu => ormolu::run(snippet_path, timeout), - Self::Oxlint => oxlint::run(snippet_path, timeout), - Self::PackerFix => packer_fix::run(snippet_path, timeout), - Self::PackerFmt => packer_fmt::run(snippet_path, timeout), - Self::Perltidy => perltidy::run(snippet_path, timeout), - Self::PgFormat => pg_format::run(snippet_path, timeout), - Self::PhpCsFixerFix => php_cs_fixer_fix::run(snippet_path, timeout), - Self::Phpcbf => phpcbf::run(snippet_path, timeout), - Self::PhpinsightsFix => phpinsights_fix::run(snippet_path, timeout), - Self::Pint => pint::run(snippet_path, timeout), - Self::Prettier => prettier::run(snippet_path, timeout), - Self::PrettyPhp => pretty_php::run(snippet_path, timeout), - Self::Prettypst => prettypst::run(snippet_path, timeout), - Self::PrismaFormat => prisma_format::run(snippet_path, timeout), - Self::Protolint => protolint::run(snippet_path, timeout), - Self::Ptop => ptop::run(snippet_path, timeout), - Self::PuppetLint => puppet_lint::run(snippet_path, timeout), - Self::PursTidy => purs_tidy::run(snippet_path, timeout), - Self::Purty => purty::run(snippet_path, timeout), - Self::Pycln => pycln::run(snippet_path, timeout), - Self::Pycodestyle => pycodestyle::run(snippet_path, timeout), - Self::Pyink => pyink::run(snippet_path, timeout), - Self::Pyment => pyment::run(snippet_path, timeout), - Self::Qmlfmt => qmlfmt::run(snippet_path, timeout), - Self::QuickLintJs => quick_lint_js::run(snippet_path, timeout), - Self::RacoFmt => raco_fmt::run(snippet_path, timeout), - Self::Refmt => refmt::run(snippet_path, timeout), - Self::ReformatGherkin => reformat_gherkin::run(snippet_path, timeout), - Self::RegalFix => regal_fix::run(snippet_path, timeout), - Self::RegalLint => regal_lint::run(snippet_path, timeout), - Self::ReorderPythonImports => reorder_python_imports::run(snippet_path, timeout), - Self::RescriptFormat => rescript_format::run(snippet_path, timeout), - Self::RocFormat => roc_format::run(snippet_path, timeout), - Self::Rstfmt => rstfmt::run(snippet_path, timeout), - Self::Rubocop => rubocop::run(snippet_path, timeout), - Self::Rubyfmt => rubyfmt::run(snippet_path, timeout), - Self::RuffCheck => ruff_check::run(snippet_path, timeout), - Self::RuffFormat => ruff_format::run(snippet_path, timeout), - Self::Rufo => rufo::run(snippet_path, timeout), - Self::RuneFmt => rune_fmt::run(snippet_path, timeout), - Self::Rustfmt => rustfmt::run(snippet_path, timeout), - Self::Rustywind => rustywind::run(snippet_path, timeout), - Self::SaltLint => salt_lint::run(snippet_path, timeout), - Self::Scalafmt => scalafmt::run(snippet_path, timeout), - Self::Scalariform => scalariform::run(snippet_path, timeout), - Self::Selene => selene::run(snippet_path, timeout), - Self::Shellcheck => shellcheck::run(snippet_path, timeout), - Self::Shellharden => shellharden::run(snippet_path, timeout), - Self::Shfmt => shfmt::run(snippet_path, timeout), - Self::Sleek => sleek::run(snippet_path, timeout), - Self::Smlfmt => smlfmt::run(snippet_path, timeout), - Self::Snakefmt => snakefmt::run(snippet_path, timeout), - Self::Solhint => solhint::run(snippet_path, timeout), - Self::SqlFormatter => sql_formatter::run(snippet_path, timeout), - Self::SqlfluffFix => sqlfluff_fix::run(snippet_path, timeout), - Self::SqlfluffFormat => sqlfluff_format::run(snippet_path, timeout), - Self::Sqlfmt => sqlfmt::run(snippet_path, timeout), - Self::Sqruff => sqruff::run(snippet_path, timeout), - Self::Standardjs => standardjs::run(snippet_path, timeout), - Self::Standardrb => standardrb::run(snippet_path, timeout), - Self::StatixCheck => statix_check::run(snippet_path, timeout), - Self::StatixFix => statix_fix::run(snippet_path, timeout), - Self::Stylefmt => stylefmt::run(snippet_path, timeout), - Self::Stylelint => stylelint::run(snippet_path, timeout), - Self::StylishHaskell => stylish_haskell::run(snippet_path, timeout), - Self::Stylua => stylua::run(snippet_path, timeout), - Self::SuperhtmlFmt => superhtml_fmt::run(snippet_path, timeout), - Self::SwiftFormat => swift_format::run(snippet_path, timeout), - Self::Swiftformat => swiftformat::run(snippet_path, timeout), - Self::Taplo => taplo::run(snippet_path, timeout), - Self::TemplFmt => templ_fmt::run(snippet_path, timeout), - Self::TerraformFmt => terraform_fmt::run(snippet_path, timeout), - Self::TerragruntHclfmt => terragrunt_hclfmt::run(snippet_path, timeout), - Self::TexFmt => tex_fmt::run(snippet_path, timeout), - Self::TlintFormat => tlint_format::run(snippet_path, timeout), - Self::TofuFmt => tofu_fmt::run(snippet_path, timeout), - Self::TomlSort => toml_sort::run(snippet_path, timeout), - Self::Topiary => topiary::run(snippet_path, timeout), - Self::TsStandard => ts_standard::run(snippet_path, timeout), - Self::Tsqllint => tsqllint::run(snippet_path, timeout), - Self::TwigCsFixerLint => twig_cs_fixer_lint::run(snippet_path, timeout), - Self::Typos => typos::run(snippet_path, timeout), - Self::Typstfmt => typstfmt::run(snippet_path, timeout), - Self::Typstyle => typstyle::run(snippet_path, timeout), - Self::Ufmt => ufmt::run(snippet_path, timeout), - Self::UiuaFmt => uiua_fmt::run(snippet_path, timeout), - Self::Unimport => unimport::run(snippet_path, timeout), - Self::Usort => usort::run(snippet_path, timeout), - Self::VFmt => v_fmt::run(snippet_path, timeout), - Self::VacuumLint => vacuum_lint::run(snippet_path, timeout), - Self::VerylFmt => veryl_fmt::run(snippet_path, timeout), - Self::VhdlStyleGuide => vhdl_style_guide::run(snippet_path, timeout), - Self::WaFmt => wa_fmt::run(snippet_path, timeout), - Self::Wfindent => wfindent::run(snippet_path, timeout), - Self::Xmlformat => xmlformat::run(snippet_path, timeout), - Self::Xmllint => xmllint::run(snippet_path, timeout), - Self::Xo => xo::run(snippet_path, timeout), - Self::Yamlfix => yamlfix::run(snippet_path, timeout), - Self::Yamlfmt => yamlfmt::run(snippet_path, timeout), - Self::Yapf => yapf::run(snippet_path, timeout), - Self::YewFmt => yew_fmt::run(snippet_path, timeout), - Self::ZigFmt => zig_fmt::run(snippet_path, timeout), - Self::ZiggyFmt => ziggy_fmt::run(snippet_path, timeout), - Self::Zprint => zprint::run(snippet_path, timeout), + Self::Actionlint => run_tools( + &actionlint::COMMANDS, + snippet_path, + actionlint::set_arguments, + timeout, + ), + Self::Alejandra => run_tools( + &alejandra::COMMANDS, + snippet_path, + alejandra::set_arguments, + timeout, + ), + Self::Ameba => run_tools( + &ameba::COMMANDS, + snippet_path, + ameba::set_arguments, + timeout, + ), + Self::AnsibleLint => run_tools( + &ansible_lint::COMMANDS, + snippet_path, + ansible_lint::set_arguments, + timeout, + ), + Self::Asmfmt => run_tools( + &asmfmt::COMMANDS, + snippet_path, + asmfmt::set_arguments, + timeout, + ), + Self::Astyle => run_tools( + &astyle::COMMANDS, + snippet_path, + astyle::set_arguments, + timeout, + ), + Self::AutoOptional => run_tools( + &auto_optional::COMMANDS, + snippet_path, + auto_optional::set_arguments, + timeout, + ), + Self::Autocorrect => run_tools( + &autocorrect::COMMANDS, + snippet_path, + autocorrect::set_arguments, + timeout, + ), + Self::Autoflake => run_tools( + &autoflake::COMMANDS, + snippet_path, + autoflake::set_arguments, + timeout, + ), + Self::Autopep8 => run_tools( + &autopep_8::COMMANDS, + snippet_path, + autopep_8::set_arguments, + timeout, + ), + Self::BeancountBlack => run_tools( + &beancount_black::COMMANDS, + snippet_path, + beancount_black::set_arguments, + timeout, + ), + Self::Beautysh => run_tools( + &beautysh::COMMANDS, + snippet_path, + beautysh::set_arguments, + timeout, + ), + Self::BibtexTidy => run_tools( + &bibtex_tidy::COMMANDS, + snippet_path, + bibtex_tidy::set_arguments, + timeout, + ), + Self::BicepFormat => run_tools( + &bicep_format::COMMANDS, + snippet_path, + bicep_format::set_arguments, + timeout, + ), + Self::BiomeCheck => run_tools( + &biome_check::COMMANDS, + snippet_path, + biome_check::set_arguments, + timeout, + ), + Self::BiomeFormat => run_tools( + &biome_format::COMMANDS, + snippet_path, + biome_format::set_arguments, + timeout, + ), + Self::BiomeLint => run_tools( + &biome_lint::COMMANDS, + snippet_path, + biome_lint::set_arguments, + timeout, + ), + Self::Black => run_tools( + &black::COMMANDS, + snippet_path, + black::set_arguments, + timeout, + ), + Self::BladeFormatter => run_tools( + &blade_formatter::COMMANDS, + snippet_path, + blade_formatter::set_arguments, + timeout, + ), + Self::Blue => run_tools(&blue::COMMANDS, snippet_path, blue::set_arguments, timeout), + Self::Bpfmt => run_tools( + &bpfmt::COMMANDS, + snippet_path, + bpfmt::set_arguments, + timeout, + ), + Self::Brittany => run_tools( + &brittany::COMMANDS, + snippet_path, + brittany::set_arguments, + timeout, + ), + Self::Brunette => run_tools( + &brunette::COMMANDS, + snippet_path, + brunette::set_arguments, + timeout, + ), + Self::Bsfmt => run_tools( + &bsfmt::COMMANDS, + snippet_path, + bsfmt::set_arguments, + timeout, + ), + Self::Bslint => run_tools( + &bslint::COMMANDS, + snippet_path, + bslint::set_arguments, + timeout, + ), + Self::BufFormat => run_tools( + &buf_format::COMMANDS, + snippet_path, + buf_format::set_arguments, + timeout, + ), + Self::Buildifier => run_tools( + &buildifier::COMMANDS, + snippet_path, + buildifier::set_arguments, + timeout, + ), + Self::CabalFmt => run_tools( + &cabal_fmt::COMMANDS, + snippet_path, + cabal_fmt::set_arguments, + timeout, + ), + Self::CabalFormat => run_tools( + &cabal_format::COMMANDS, + snippet_path, + cabal_format::set_arguments, + timeout, + ), + Self::CabalPrettify => run_tools( + &cabal_prettify::COMMANDS, + snippet_path, + cabal_prettify::set_arguments, + timeout, + ), + Self::CaddyFmt => run_tools( + &caddy_fmt::COMMANDS, + snippet_path, + caddy_fmt::set_arguments, + timeout, + ), + Self::CaramelFmt => run_tools( + &caramel_fmt::COMMANDS, + snippet_path, + caramel_fmt::set_arguments, + timeout, + ), + Self::ClangFormat => run_tools( + &clang_format::COMMANDS, + snippet_path, + clang_format::set_arguments, + timeout, + ), + Self::ClangTidy => run_tools( + &clang_tidy::COMMANDS, + snippet_path, + clang_tidy::set_arguments, + timeout, + ), + Self::CljfmtFix => run_tools( + &cljfmt_fix::COMMANDS, + snippet_path, + cljfmt_fix::set_arguments, + timeout, + ), + Self::Cljstyle => run_tools( + &cljstyle::COMMANDS, + snippet_path, + cljstyle::set_arguments, + timeout, + ), + Self::CmakeFormat => run_tools( + &cmake_format::COMMANDS, + snippet_path, + cmake_format::set_arguments, + timeout, + ), + Self::Codespell => run_tools( + &codespell::COMMANDS, + snippet_path, + codespell::set_arguments, + timeout, + ), + Self::Crlfmt => run_tools( + &crlfmt::COMMANDS, + snippet_path, + crlfmt::set_arguments, + timeout, + ), + Self::CrystalFormat => run_tools( + &crystal_format::COMMANDS, + snippet_path, + crystal_format::set_arguments, + timeout, + ), + Self::Csharpier => run_tools( + &csharpier::COMMANDS, + snippet_path, + csharpier::set_arguments, + timeout, + ), + Self::CssBeautify => run_tools( + &css_beautify::COMMANDS, + snippet_path, + css_beautify::set_arguments, + timeout, + ), + Self::Csscomb => run_tools( + &csscomb::COMMANDS, + snippet_path, + csscomb::set_arguments, + timeout, + ), + Self::Csslint => run_tools( + &csslint::COMMANDS, + snippet_path, + csslint::set_arguments, + timeout, + ), + Self::Curlylint => run_tools( + &curlylint::COMMANDS, + snippet_path, + curlylint::set_arguments, + timeout, + ), + Self::D2Fmt => run_tools( + &d_2_fmt::COMMANDS, + snippet_path, + d_2_fmt::set_arguments, + timeout, + ), + Self::DartFix => run_tools( + &dart_fix::COMMANDS, + snippet_path, + dart_fix::set_arguments, + timeout, + ), + Self::DartFormat => run_tools( + &dart_format::COMMANDS, + snippet_path, + dart_format::set_arguments, + timeout, + ), + Self::DcmFix => run_tools( + &dcm_fix::COMMANDS, + snippet_path, + dcm_fix::set_arguments, + timeout, + ), + Self::DcmFormat => run_tools( + &dcm_format::COMMANDS, + snippet_path, + dcm_format::set_arguments, + timeout, + ), + Self::Deadnix => run_tools( + &deadnix::COMMANDS, + snippet_path, + deadnix::set_arguments, + timeout, + ), + Self::DenoFmt => run_tools( + &deno_fmt::COMMANDS, + snippet_path, + deno_fmt::set_arguments, + timeout, + ), + Self::DenoLint => run_tools( + &deno_lint::COMMANDS, + snippet_path, + deno_lint::set_arguments, + timeout, + ), + Self::Dfmt => run_tools(&dfmt::COMMANDS, snippet_path, dfmt::set_arguments, timeout), + Self::Dhall => run_tools( + &dhall::COMMANDS, + snippet_path, + dhall::set_arguments, + timeout, + ), + Self::Djade => run_tools( + &djade::COMMANDS, + snippet_path, + djade::set_arguments, + timeout, + ), + Self::Djlint => run_tools( + &djlint::COMMANDS, + snippet_path, + djlint::set_arguments, + timeout, + ), + Self::Docformatter => run_tools( + &docformatter::COMMANDS, + snippet_path, + docformatter::set_arguments, + timeout, + ), + Self::Dockfmt => run_tools( + &dockfmt::COMMANDS, + snippet_path, + dockfmt::set_arguments, + timeout, + ), + Self::Docstrfmt => run_tools( + &docstrfmt::COMMANDS, + snippet_path, + docstrfmt::set_arguments, + timeout, + ), + Self::Doctoc => run_tools( + &doctoc::COMMANDS, + snippet_path, + doctoc::set_arguments, + timeout, + ), + Self::DotenvLinterFix => run_tools( + &dotenv_linter_fix::COMMANDS, + snippet_path, + dotenv_linter_fix::set_arguments, + timeout, + ), + Self::DprintFmt => run_tools( + &dprint_fmt::COMMANDS, + snippet_path, + dprint_fmt::set_arguments, + timeout, + ), + Self::EasyCodingStandard => run_tools( + &easy_coding_standard::COMMANDS, + snippet_path, + easy_coding_standard::set_arguments, + timeout, + ), + Self::Efmt => run_tools(&efmt::COMMANDS, snippet_path, efmt::set_arguments, timeout), + Self::ElmFormat => run_tools( + &elm_format::COMMANDS, + snippet_path, + elm_format::set_arguments, + timeout, + ), + Self::ErbFormatter => run_tools( + &erb_formatter::COMMANDS, + snippet_path, + erb_formatter::set_arguments, + timeout, + ), + Self::Erlfmt => run_tools( + &erlfmt::COMMANDS, + snippet_path, + erlfmt::set_arguments, + timeout, + ), + Self::Eslint => run_tools( + &eslint::COMMANDS, + snippet_path, + eslint::set_arguments, + timeout, + ), + Self::Fantomas => run_tools( + &fantomas::COMMANDS, + snippet_path, + fantomas::set_arguments, + timeout, + ), + Self::FishIndent => run_tools( + &fish_indent::COMMANDS, + snippet_path, + fish_indent::set_arguments, + timeout, + ), + Self::Fixjson => run_tools( + &fixjson::COMMANDS, + snippet_path, + fixjson::set_arguments, + timeout, + ), + Self::Floskell => run_tools( + &floskell::COMMANDS, + snippet_path, + floskell::set_arguments, + timeout, + ), + Self::Fnlfmt => run_tools( + &fnlfmt::COMMANDS, + snippet_path, + fnlfmt::set_arguments, + timeout, + ), + Self::ForgeFmt => run_tools( + &forge_fmt::COMMANDS, + snippet_path, + forge_fmt::set_arguments, + timeout, + ), + Self::Fourmolu => run_tools( + &fourmolu::COMMANDS, + snippet_path, + fourmolu::set_arguments, + timeout, + ), + Self::Fprettify => run_tools( + &fprettify::COMMANDS, + snippet_path, + fprettify::set_arguments, + timeout, + ), + Self::FutharkFmt => run_tools( + &futhark_fmt::COMMANDS, + snippet_path, + futhark_fmt::set_arguments, + timeout, + ), + Self::Gci => run_tools(&gci::COMMANDS, snippet_path, gci::set_arguments, timeout), + Self::Gdformat => run_tools( + &gdformat::COMMANDS, + snippet_path, + gdformat::set_arguments, + timeout, + ), + Self::Gersemi => run_tools( + &gersemi::COMMANDS, + snippet_path, + gersemi::set_arguments, + timeout, + ), + Self::GleamFormat => run_tools( + &gleam_format::COMMANDS, + snippet_path, + gleam_format::set_arguments, + timeout, + ), + Self::GluonFmt => run_tools( + &gluon_fmt::COMMANDS, + snippet_path, + gluon_fmt::set_arguments, + timeout, + ), + Self::Gofmt => run_tools( + &gofmt::COMMANDS, + snippet_path, + gofmt::set_arguments, + timeout, + ), + Self::Gofumpt => run_tools( + &gofumpt::COMMANDS, + snippet_path, + gofumpt::set_arguments, + timeout, + ), + Self::Goimports => run_tools( + &goimports::COMMANDS, + snippet_path, + goimports::set_arguments, + timeout, + ), + Self::GoimportsReviser => run_tools( + &goimports_reviser::COMMANDS, + snippet_path, + goimports_reviser::set_arguments, + timeout, + ), + Self::Golines => run_tools( + &golines::COMMANDS, + snippet_path, + golines::set_arguments, + timeout, + ), + Self::GoogleJavaFormat => run_tools( + &google_java_format::COMMANDS, + snippet_path, + google_java_format::set_arguments, + timeout, + ), + Self::GrainFormat => run_tools( + &grain_format::COMMANDS, + snippet_path, + grain_format::set_arguments, + timeout, + ), + Self::Hadolint => run_tools( + &hadolint::COMMANDS, + snippet_path, + hadolint::set_arguments, + timeout, + ), + Self::HamlLint => run_tools( + &haml_lint::COMMANDS, + snippet_path, + haml_lint::set_arguments, + timeout, + ), + Self::Hclfmt => run_tools( + &hclfmt::COMMANDS, + snippet_path, + hclfmt::set_arguments, + timeout, + ), + Self::Hfmt => run_tools(&hfmt::COMMANDS, snippet_path, hfmt::set_arguments, timeout), + Self::Hindent => run_tools( + &hindent::COMMANDS, + snippet_path, + hindent::set_arguments, + timeout, + ), + Self::Hlint => run_tools( + &hlint::COMMANDS, + snippet_path, + hlint::set_arguments, + timeout, + ), + Self::HtmlBeautify => run_tools( + &html_beautify::COMMANDS, + snippet_path, + html_beautify::set_arguments, + timeout, + ), + Self::Htmlbeautifier => run_tools( + &htmlbeautifier::COMMANDS, + snippet_path, + htmlbeautifier::set_arguments, + timeout, + ), + Self::Htmlhint => run_tools( + &htmlhint::COMMANDS, + snippet_path, + htmlhint::set_arguments, + timeout, + ), + Self::ImbaFmt => run_tools( + &imba_fmt::COMMANDS, + snippet_path, + imba_fmt::set_arguments, + timeout, + ), + Self::InkoFmt => run_tools( + &inko_fmt::COMMANDS, + snippet_path, + inko_fmt::set_arguments, + timeout, + ), + Self::Isort => run_tools( + &isort::COMMANDS, + snippet_path, + isort::set_arguments, + timeout, + ), + Self::Joker => run_tools( + &joker::COMMANDS, + snippet_path, + joker::set_arguments, + timeout, + ), + Self::JsBeautify => run_tools( + &js_beautify::COMMANDS, + snippet_path, + js_beautify::set_arguments, + timeout, + ), + Self::Json5Format => run_tools( + &json_5_format::COMMANDS, + snippet_path, + json_5_format::set_arguments, + timeout, + ), + Self::JsonaFormat => run_tools( + &jsona_format::COMMANDS, + snippet_path, + jsona_format::set_arguments, + timeout, + ), + Self::JsonaLint => run_tools( + &jsona_lint::COMMANDS, + snippet_path, + jsona_lint::set_arguments, + timeout, + ), + Self::Jsonlint => run_tools( + &jsonlint::COMMANDS, + snippet_path, + jsonlint::set_arguments, + timeout, + ), + Self::JsonnetLint => run_tools( + &jsonnet_lint::COMMANDS, + snippet_path, + jsonnet_lint::set_arguments, + timeout, + ), + Self::Jsonnetfmt => run_tools( + &jsonnetfmt::COMMANDS, + snippet_path, + jsonnetfmt::set_arguments, + timeout, + ), + Self::JuliaformatterJl => run_tools( + &juliaformatter_jl::COMMANDS, + snippet_path, + juliaformatter_jl::set_arguments, + timeout, + ), + Self::Just => run_tools(&just::COMMANDS, snippet_path, just::set_arguments, timeout), + Self::KclFmt => run_tools( + &kcl_fmt::COMMANDS, + snippet_path, + kcl_fmt::set_arguments, + timeout, + ), + Self::KclLint => run_tools( + &kcl_lint::COMMANDS, + snippet_path, + kcl_lint::set_arguments, + timeout, + ), + Self::Kdlfmt => run_tools( + &kdlfmt::COMMANDS, + snippet_path, + kdlfmt::set_arguments, + timeout, + ), + Self::KdocFormatter => run_tools( + &kdoc_formatter::COMMANDS, + snippet_path, + kdoc_formatter::set_arguments, + timeout, + ), + Self::Ktfmt => run_tools( + &ktfmt::COMMANDS, + snippet_path, + ktfmt::set_arguments, + timeout, + ), + Self::Ktlint => run_tools( + &ktlint::COMMANDS, + snippet_path, + ktlint::set_arguments, + timeout, + ), + Self::KulalaFmt => run_tools( + &kulala_fmt::COMMANDS, + snippet_path, + kulala_fmt::set_arguments, + timeout, + ), + Self::Leptosfmt => run_tools( + &leptosfmt::COMMANDS, + snippet_path, + leptosfmt::set_arguments, + timeout, + ), + Self::LiquidsoapPrettier => run_tools( + &liquidsoap_prettier::COMMANDS, + snippet_path, + liquidsoap_prettier::set_arguments, + timeout, + ), + Self::Luacheck => run_tools( + &luacheck::COMMANDS, + snippet_path, + luacheck::set_arguments, + timeout, + ), + Self::Luaformatter => run_tools( + &luaformatter::COMMANDS, + snippet_path, + luaformatter::set_arguments, + timeout, + ), + Self::MadoCheck => run_tools( + &mado_check::COMMANDS, + snippet_path, + mado_check::set_arguments, + timeout, + ), + Self::Markdownfmt => run_tools( + &markdownfmt::COMMANDS, + snippet_path, + markdownfmt::set_arguments, + timeout, + ), + Self::Markdownlint => run_tools( + &markdownlint::COMMANDS, + snippet_path, + markdownlint::set_arguments, + timeout, + ), + Self::MarkdownlintCli2 => run_tools( + &markdownlint_cli_2::COMMANDS, + snippet_path, + markdownlint_cli_2::set_arguments, + timeout, + ), + Self::Markuplint => run_tools( + &markuplint::COMMANDS, + snippet_path, + markuplint::set_arguments, + timeout, + ), + Self::Mdformat => run_tools( + &mdformat::COMMANDS, + snippet_path, + mdformat::set_arguments, + timeout, + ), + Self::Mdslw => run_tools( + &mdslw::COMMANDS, + snippet_path, + mdslw::set_arguments, + timeout, + ), + Self::MesonFmt => run_tools( + &meson_fmt::COMMANDS, + snippet_path, + meson_fmt::set_arguments, + timeout, + ), + Self::Misspell => run_tools( + &misspell::COMMANDS, + snippet_path, + misspell::set_arguments, + timeout, + ), + Self::MixFormat => run_tools( + &mix_format::COMMANDS, + snippet_path, + mix_format::set_arguments, + timeout, + ), + Self::MojoFormat => run_tools( + &mojo_format::COMMANDS, + snippet_path, + mojo_format::set_arguments, + timeout, + ), + Self::Mypy => run_tools(&mypy::COMMANDS, snippet_path, mypy::set_arguments, timeout), + Self::Nginxbeautifier => run_tools( + &nginxbeautifier::COMMANDS, + snippet_path, + nginxbeautifier::set_arguments, + timeout, + ), + Self::Nginxfmt => run_tools( + &nginxfmt::COMMANDS, + snippet_path, + nginxfmt::set_arguments, + timeout, + ), + Self::NickelFormat => run_tools( + &nickel_format::COMMANDS, + snippet_path, + nickel_format::set_arguments, + timeout, + ), + Self::Nimpretty => run_tools( + &nimpretty::COMMANDS, + snippet_path, + nimpretty::set_arguments, + timeout, + ), + Self::Nixfmt => run_tools( + &nixfmt::COMMANDS, + snippet_path, + nixfmt::set_arguments, + timeout, + ), + Self::NixpkgsFmt => run_tools( + &nixpkgs_fmt::COMMANDS, + snippet_path, + nixpkgs_fmt::set_arguments, + timeout, + ), + Self::NomadFmt => run_tools( + &nomad_fmt::COMMANDS, + snippet_path, + nomad_fmt::set_arguments, + timeout, + ), + Self::Nph => run_tools(&nph::COMMANDS, snippet_path, nph::set_arguments, timeout), + Self::NpmGroovyLint => run_tools( + &npm_groovy_lint::COMMANDS, + snippet_path, + npm_groovy_lint::set_arguments, + timeout, + ), + Self::Nufmt => run_tools( + &nufmt::COMMANDS, + snippet_path, + nufmt::set_arguments, + timeout, + ), + Self::Ocamlformat => run_tools( + &ocamlformat::COMMANDS, + snippet_path, + ocamlformat::set_arguments, + timeout, + ), + Self::OcpIndent => run_tools( + &ocp_indent::COMMANDS, + snippet_path, + ocp_indent::set_arguments, + timeout, + ), + Self::Odinfmt => run_tools( + &odinfmt::COMMANDS, + snippet_path, + odinfmt::set_arguments, + timeout, + ), + Self::OelintAdv => run_tools( + &oelint_adv::COMMANDS, + snippet_path, + oelint_adv::set_arguments, + timeout, + ), + Self::OpaFmt => run_tools( + &opa_fmt::COMMANDS, + snippet_path, + opa_fmt::set_arguments, + timeout, + ), + Self::Ormolu => run_tools( + &ormolu::COMMANDS, + snippet_path, + ormolu::set_arguments, + timeout, + ), + Self::Oxlint => run_tools( + &oxlint::COMMANDS, + snippet_path, + oxlint::set_arguments, + timeout, + ), + Self::PackerFix => run_tools( + &packer_fix::COMMANDS, + snippet_path, + packer_fix::set_arguments, + timeout, + ), + Self::PackerFmt => run_tools( + &packer_fmt::COMMANDS, + snippet_path, + packer_fmt::set_arguments, + timeout, + ), + Self::Perltidy => run_tools( + &perltidy::COMMANDS, + snippet_path, + perltidy::set_arguments, + timeout, + ), + Self::PgFormat => run_tools( + &pg_format::COMMANDS, + snippet_path, + pg_format::set_arguments, + timeout, + ), + Self::PhpCsFixerFix => run_tools( + &php_cs_fixer_fix::COMMANDS, + snippet_path, + php_cs_fixer_fix::set_arguments, + timeout, + ), + Self::Phpcbf => run_tools( + &phpcbf::COMMANDS, + snippet_path, + phpcbf::set_arguments, + timeout, + ), + Self::PhpinsightsFix => run_tools( + &phpinsights_fix::COMMANDS, + snippet_path, + phpinsights_fix::set_arguments, + timeout, + ), + Self::Pint => run_tools(&pint::COMMANDS, snippet_path, pint::set_arguments, timeout), + Self::Prettier => run_tools( + &prettier::COMMANDS, + snippet_path, + prettier::set_arguments, + timeout, + ), + Self::PrettyPhp => run_tools( + &pretty_php::COMMANDS, + snippet_path, + pretty_php::set_arguments, + timeout, + ), + Self::Prettypst => run_tools( + &prettypst::COMMANDS, + snippet_path, + prettypst::set_arguments, + timeout, + ), + Self::PrismaFormat => run_tools( + &prisma_format::COMMANDS, + snippet_path, + prisma_format::set_arguments, + timeout, + ), + Self::Protolint => run_tools( + &protolint::COMMANDS, + snippet_path, + protolint::set_arguments, + timeout, + ), + Self::Ptop => run_tools(&ptop::COMMANDS, snippet_path, ptop::set_arguments, timeout), + Self::PuppetLint => run_tools( + &puppet_lint::COMMANDS, + snippet_path, + puppet_lint::set_arguments, + timeout, + ), + Self::PursTidy => run_tools( + &purs_tidy::COMMANDS, + snippet_path, + purs_tidy::set_arguments, + timeout, + ), + Self::Purty => run_tools( + &purty::COMMANDS, + snippet_path, + purty::set_arguments, + timeout, + ), + Self::Pycln => run_tools( + &pycln::COMMANDS, + snippet_path, + pycln::set_arguments, + timeout, + ), + Self::Pycodestyle => run_tools( + &pycodestyle::COMMANDS, + snippet_path, + pycodestyle::set_arguments, + timeout, + ), + Self::Pyink => run_tools( + &pyink::COMMANDS, + snippet_path, + pyink::set_arguments, + timeout, + ), + Self::Pyment => run_tools( + &pyment::COMMANDS, + snippet_path, + pyment::set_arguments, + timeout, + ), + Self::Qmlfmt => run_tools( + &qmlfmt::COMMANDS, + snippet_path, + qmlfmt::set_arguments, + timeout, + ), + Self::QuickLintJs => run_tools( + &quick_lint_js::COMMANDS, + snippet_path, + quick_lint_js::set_arguments, + timeout, + ), + Self::RacoFmt => run_tools( + &raco_fmt::COMMANDS, + snippet_path, + raco_fmt::set_arguments, + timeout, + ), + Self::Refmt => run_tools( + &refmt::COMMANDS, + snippet_path, + refmt::set_arguments, + timeout, + ), + Self::ReformatGherkin => run_tools( + &reformat_gherkin::COMMANDS, + snippet_path, + reformat_gherkin::set_arguments, + timeout, + ), + Self::RegalFix => run_tools( + ®al_fix::COMMANDS, + snippet_path, + regal_fix::set_arguments, + timeout, + ), + Self::RegalLint => run_tools( + ®al_lint::COMMANDS, + snippet_path, + regal_lint::set_arguments, + timeout, + ), + Self::ReorderPythonImports => run_tools( + &reorder_python_imports::COMMANDS, + snippet_path, + reorder_python_imports::set_arguments, + timeout, + ), + Self::RescriptFormat => run_tools( + &rescript_format::COMMANDS, + snippet_path, + rescript_format::set_arguments, + timeout, + ), + Self::RocFormat => run_tools( + &roc_format::COMMANDS, + snippet_path, + roc_format::set_arguments, + timeout, + ), + Self::Rstfmt => run_tools( + &rstfmt::COMMANDS, + snippet_path, + rstfmt::set_arguments, + timeout, + ), + Self::Rubocop => run_tools( + &rubocop::COMMANDS, + snippet_path, + rubocop::set_arguments, + timeout, + ), + Self::Rubyfmt => run_tools( + &rubyfmt::COMMANDS, + snippet_path, + rubyfmt::set_arguments, + timeout, + ), + Self::RuffCheck => run_tools( + &ruff_check::COMMANDS, + snippet_path, + ruff_check::set_arguments, + timeout, + ), + Self::RuffFormat => run_tools( + &ruff_format::COMMANDS, + snippet_path, + ruff_format::set_arguments, + timeout, + ), + Self::Rufo => run_tools(&rufo::COMMANDS, snippet_path, rufo::set_arguments, timeout), + Self::RuneFmt => run_tools( + &rune_fmt::COMMANDS, + snippet_path, + rune_fmt::set_arguments, + timeout, + ), + Self::Rustfmt => run_tools( + &rustfmt::COMMANDS, + snippet_path, + rustfmt::set_arguments, + timeout, + ), + Self::Rustywind => run_tools( + &rustywind::COMMANDS, + snippet_path, + rustywind::set_arguments, + timeout, + ), + Self::SaltLint => run_tools( + &salt_lint::COMMANDS, + snippet_path, + salt_lint::set_arguments, + timeout, + ), + Self::Scalafmt => run_tools( + &scalafmt::COMMANDS, + snippet_path, + scalafmt::set_arguments, + timeout, + ), + Self::Scalariform => run_tools( + &scalariform::COMMANDS, + snippet_path, + scalariform::set_arguments, + timeout, + ), + Self::Selene => run_tools( + &selene::COMMANDS, + snippet_path, + selene::set_arguments, + timeout, + ), + Self::Shellcheck => run_tools( + &shellcheck::COMMANDS, + snippet_path, + shellcheck::set_arguments, + timeout, + ), + Self::Shellharden => run_tools( + &shellharden::COMMANDS, + snippet_path, + shellharden::set_arguments, + timeout, + ), + Self::Shfmt => run_tools( + &shfmt::COMMANDS, + snippet_path, + shfmt::set_arguments, + timeout, + ), + Self::Sleek => run_tools( + &sleek::COMMANDS, + snippet_path, + sleek::set_arguments, + timeout, + ), + Self::Smlfmt => run_tools( + &smlfmt::COMMANDS, + snippet_path, + smlfmt::set_arguments, + timeout, + ), + Self::Snakefmt => run_tools( + &snakefmt::COMMANDS, + snippet_path, + snakefmt::set_arguments, + timeout, + ), + Self::Solhint => run_tools( + &solhint::COMMANDS, + snippet_path, + solhint::set_arguments, + timeout, + ), + Self::SqlFormatter => run_tools( + &sql_formatter::COMMANDS, + snippet_path, + sql_formatter::set_arguments, + timeout, + ), + Self::SqlfluffFix => run_tools( + &sqlfluff_fix::COMMANDS, + snippet_path, + sqlfluff_fix::set_arguments, + timeout, + ), + Self::SqlfluffFormat => run_tools( + &sqlfluff_format::COMMANDS, + snippet_path, + sqlfluff_format::set_arguments, + timeout, + ), + Self::Sqlfmt => run_tools( + &sqlfmt::COMMANDS, + snippet_path, + sqlfmt::set_arguments, + timeout, + ), + Self::Sqruff => run_tools( + &sqruff::COMMANDS, + snippet_path, + sqruff::set_arguments, + timeout, + ), + Self::Standardjs => run_tools( + &standardjs::COMMANDS, + snippet_path, + standardjs::set_arguments, + timeout, + ), + Self::Standardrb => run_tools( + &standardrb::COMMANDS, + snippet_path, + standardrb::set_arguments, + timeout, + ), + Self::StatixCheck => run_tools( + &statix_check::COMMANDS, + snippet_path, + statix_check::set_arguments, + timeout, + ), + Self::StatixFix => run_tools( + &statix_fix::COMMANDS, + snippet_path, + statix_fix::set_arguments, + timeout, + ), + Self::Stylefmt => run_tools( + &stylefmt::COMMANDS, + snippet_path, + stylefmt::set_arguments, + timeout, + ), + Self::Stylelint => run_tools( + &stylelint::COMMANDS, + snippet_path, + stylelint::set_arguments, + timeout, + ), + Self::StylishHaskell => run_tools( + &stylish_haskell::COMMANDS, + snippet_path, + stylish_haskell::set_arguments, + timeout, + ), + Self::Stylua => run_tools( + &stylua::COMMANDS, + snippet_path, + stylua::set_arguments, + timeout, + ), + Self::SuperhtmlFmt => run_tools( + &superhtml_fmt::COMMANDS, + snippet_path, + superhtml_fmt::set_arguments, + timeout, + ), + Self::SwiftFormat => run_tools( + &swift_format::COMMANDS, + snippet_path, + swift_format::set_arguments, + timeout, + ), + Self::Swiftformat => run_tools( + &swiftformat::COMMANDS, + snippet_path, + swiftformat::set_arguments, + timeout, + ), + Self::Taplo => run_tools( + &taplo::COMMANDS, + snippet_path, + taplo::set_arguments, + timeout, + ), + Self::TemplFmt => run_tools( + &templ_fmt::COMMANDS, + snippet_path, + templ_fmt::set_arguments, + timeout, + ), + Self::TerraformFmt => run_tools( + &terraform_fmt::COMMANDS, + snippet_path, + terraform_fmt::set_arguments, + timeout, + ), + Self::TerragruntHclfmt => run_tools( + &terragrunt_hclfmt::COMMANDS, + snippet_path, + terragrunt_hclfmt::set_arguments, + timeout, + ), + Self::TexFmt => run_tools( + &tex_fmt::COMMANDS, + snippet_path, + tex_fmt::set_arguments, + timeout, + ), + Self::TlintFormat => run_tools( + &tlint_format::COMMANDS, + snippet_path, + tlint_format::set_arguments, + timeout, + ), + Self::TofuFmt => run_tools( + &tofu_fmt::COMMANDS, + snippet_path, + tofu_fmt::set_arguments, + timeout, + ), + Self::TomlSort => run_tools( + &toml_sort::COMMANDS, + snippet_path, + toml_sort::set_arguments, + timeout, + ), + Self::Topiary => run_tools( + &topiary::COMMANDS, + snippet_path, + topiary::set_arguments, + timeout, + ), + Self::TsStandard => run_tools( + &ts_standard::COMMANDS, + snippet_path, + ts_standard::set_arguments, + timeout, + ), + Self::Tsqllint => run_tools( + &tsqllint::COMMANDS, + snippet_path, + tsqllint::set_arguments, + timeout, + ), + Self::TwigCsFixerLint => run_tools( + &twig_cs_fixer_lint::COMMANDS, + snippet_path, + twig_cs_fixer_lint::set_arguments, + timeout, + ), + Self::Typos => run_tools( + &typos::COMMANDS, + snippet_path, + typos::set_arguments, + timeout, + ), + Self::Typstfmt => run_tools( + &typstfmt::COMMANDS, + snippet_path, + typstfmt::set_arguments, + timeout, + ), + Self::Typstyle => run_tools( + &typstyle::COMMANDS, + snippet_path, + typstyle::set_arguments, + timeout, + ), + Self::Ufmt => run_tools(&ufmt::COMMANDS, snippet_path, ufmt::set_arguments, timeout), + Self::UiuaFmt => run_tools( + &uiua_fmt::COMMANDS, + snippet_path, + uiua_fmt::set_arguments, + timeout, + ), + Self::Unimport => run_tools( + &unimport::COMMANDS, + snippet_path, + unimport::set_arguments, + timeout, + ), + Self::Usort => run_tools( + &usort::COMMANDS, + snippet_path, + usort::set_arguments, + timeout, + ), + Self::VFmt => run_tools( + &v_fmt::COMMANDS, + snippet_path, + v_fmt::set_arguments, + timeout, + ), + Self::VacuumLint => run_tools( + &vacuum_lint::COMMANDS, + snippet_path, + vacuum_lint::set_arguments, + timeout, + ), + Self::VerylFmt => run_tools( + &veryl_fmt::COMMANDS, + snippet_path, + veryl_fmt::set_arguments, + timeout, + ), + Self::VhdlStyleGuide => run_tools( + &vhdl_style_guide::COMMANDS, + snippet_path, + vhdl_style_guide::set_arguments, + timeout, + ), + Self::WaFmt => run_tools( + &wa_fmt::COMMANDS, + snippet_path, + wa_fmt::set_arguments, + timeout, + ), + Self::Wfindent => run_tools( + &wfindent::COMMANDS, + snippet_path, + wfindent::set_arguments, + timeout, + ), + Self::Xmlformat => run_tools( + &xmlformat::COMMANDS, + snippet_path, + xmlformat::set_arguments, + timeout, + ), + Self::Xmllint => run_tools( + &xmllint::COMMANDS, + snippet_path, + xmllint::set_arguments, + timeout, + ), + Self::Xo => run_tools(&xo::COMMANDS, snippet_path, xo::set_arguments, timeout), + Self::Yamlfix => run_tools( + &yamlfix::COMMANDS, + snippet_path, + yamlfix::set_arguments, + timeout, + ), + Self::Yamlfmt => run_tools( + &yamlfmt::COMMANDS, + snippet_path, + yamlfmt::set_arguments, + timeout, + ), + Self::Yapf => run_tools(&yapf::COMMANDS, snippet_path, yapf::set_arguments, timeout), + Self::YewFmt => run_tools( + &yew_fmt::COMMANDS, + snippet_path, + yew_fmt::set_arguments, + timeout, + ), + Self::ZigFmt => run_tools( + &zig_fmt::COMMANDS, + snippet_path, + zig_fmt::set_arguments, + timeout, + ), + Self::ZiggyFmt => run_tools( + &ziggy_fmt::COMMANDS, + snippet_path, + ziggy_fmt::set_arguments, + timeout, + ), + Self::Zprint => run_tools( + &zprint::COMMANDS, + snippet_path, + zprint::set_arguments, + timeout, + ), } } } diff --git a/mdsf/src/tools/mojo_format.rs b/mdsf/src/tools/mojo_format.rs index d147f2e6..1ae4bfef 100644 --- a/mdsf/src/tools/mojo_format.rs +++ b/mdsf/src/tools/mojo_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_mojo_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_mojo_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("mojo")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mojo_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("mojo")]; #[cfg(test)] mod test_mojo_format {} diff --git a/mdsf/src/tools/mypy.rs b/mdsf/src/tools/mypy.rs index 6788809e..8435b120 100644 --- a/mdsf/src/tools/mypy.rs +++ b/mdsf/src/tools/mypy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_mypy_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_mypy_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("mypy")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_mypy_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("mypy")]; #[cfg(test)] mod test_mypy {} diff --git a/mdsf/src/tools/nginxbeautifier.rs b/mdsf/src/tools/nginxbeautifier.rs index 146811df..7aca5940 100644 --- a/mdsf/src/tools/nginxbeautifier.rs +++ b/mdsf/src/tools/nginxbeautifier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nginxbeautifier_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,19 +12,11 @@ fn set_nginxbeautifier_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("nginxbeautifier"), CommandType::Direct("nginxbeautifier"), CommandType::Npm("nginxbeautifier"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nginxbeautifier_args) -} - #[cfg(test)] mod test_nginxbeautifier {} diff --git a/mdsf/src/tools/nginxfmt.rs b/mdsf/src/tools/nginxfmt.rs index 4c051a4e..822f56b8 100644 --- a/mdsf/src/tools/nginxfmt.rs +++ b/mdsf/src/tools/nginxfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nginxfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_nginxfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nginxfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nginxfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nginxfmt")]; #[cfg(test)] mod test_nginxfmt {} diff --git a/mdsf/src/tools/nickel_format.rs b/mdsf/src/tools/nickel_format.rs index 7dd9487a..3edae735 100644 --- a/mdsf/src/tools/nickel_format.rs +++ b/mdsf/src/tools/nickel_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nickel_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_nickel_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nickel")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nickel_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nickel")]; #[cfg(test)] mod test_nickel_format {} diff --git a/mdsf/src/tools/nimpretty.rs b/mdsf/src/tools/nimpretty.rs index bedfc6d4..dfa70d0b 100644 --- a/mdsf/src/tools/nimpretty.rs +++ b/mdsf/src/tools/nimpretty.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nimpretty_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,34 +12,30 @@ fn set_nimpretty_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nimpretty")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nimpretty_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nimpretty")]; #[cfg(test)] mod test_nimpretty { #[test_with::executable(nimpretty)] - fn test_nimpretty_nim_904d741f6111f585() { + fn test_nimpretty_nim_2c41c79e1d74972a() { let input = r#"proc add( a :int , b:int ) : int = return a + b "#; - let output = Some( - r#"proc add(a: int, b: int): int = + + let output = r#"proc add(a: int, b: int): int = return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("nim"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::nimpretty::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/nixfmt.rs b/mdsf/src/tools/nixfmt.rs index 674ecedb..89f7aeb4 100644 --- a/mdsf/src/tools/nixfmt.rs +++ b/mdsf/src/tools/nixfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nixfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,20 +12,12 @@ fn set_nixfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nixfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nixfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nixfmt")]; #[cfg(test)] mod test_nixfmt { #[test_with::executable(nixfmt)] - fn test_nixfmt_nix_dd53cfbdc3725201() { + fn test_nixfmt_nix_c01c4e4dcc81ab28() { let input = r#"{ lib, buildPythonPackage, fetchFromGitHub, redis }: buildPythonPackage rec { @@ -52,8 +44,8 @@ buildPythonPackage rec { }; } "#; - let output = Some( - r#"{ lib, buildPythonPackage, fetchFromGitHub, redis }: + + let output = r#"{ lib, buildPythonPackage, fetchFromGitHub, redis }: buildPythonPackage rec { pname = "huey"; @@ -78,15 +70,19 @@ buildPythonPackage rec { maintainers = [ maintainers.globin ]; }; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("nix"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::nixfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/nixpkgs_fmt.rs b/mdsf/src/tools/nixpkgs_fmt.rs index 54946160..e39e8f03 100644 --- a/mdsf/src/tools/nixpkgs_fmt.rs +++ b/mdsf/src/tools/nixpkgs_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nixpkgs_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,20 +12,12 @@ fn set_nixpkgs_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nixpkgs-fmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nixpkgs_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nixpkgs-fmt")]; #[cfg(test)] mod test_nixpkgs_fmt { #[test_with::executable(nixpkgs-fmt)] - fn test_nixpkgs_fmt_nix_80c626451e90fe4a() { + fn test_nixpkgs_fmt_nix_36a22e30dae799c5() { let input = r#"{ lib, buildPythonPackage, fetchFromGitHub, redis }: @@ -53,8 +45,8 @@ buildPythonPackage rec { }; } "#; - let output = Some( - r#"{ lib + + let output = r#"{ lib , buildPythonPackage , fetchFromGitHub , redis @@ -83,15 +75,19 @@ buildPythonPackage rec { maintainers = [ maintainers.globin ]; }; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("nix"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::nixpkgs_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/nomad_fmt.rs b/mdsf/src/tools/nomad_fmt.rs index 1993e9e1..292f5546 100644 --- a/mdsf/src/tools/nomad_fmt.rs +++ b/mdsf/src/tools/nomad_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nomad_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_nomad_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nomad")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nomad_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nomad")]; #[cfg(test)] mod test_nomad_fmt {} diff --git a/mdsf/src/tools/nph.rs b/mdsf/src/tools/nph.rs index 60253829..6a86953c 100644 --- a/mdsf/src/tools/nph.rs +++ b/mdsf/src/tools/nph.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nph_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_nph_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nph")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nph_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nph")]; #[cfg(test)] mod test_nph {} diff --git a/mdsf/src/tools/npm_groovy_lint.rs b/mdsf/src/tools/npm_groovy_lint.rs index 5ab2adc8..e7e03550 100644 --- a/mdsf/src/tools/npm_groovy_lint.rs +++ b/mdsf/src/tools/npm_groovy_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_npm_groovy_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,44 +13,40 @@ fn set_npm_groovy_lint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("npm-groovy-lint"), CommandType::Direct("npm-groovy-lint"), CommandType::Npm("npm-groovy-lint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_npm_groovy_lint_args) -} - #[cfg(test)] mod test_npm_groovy_lint { #[test_with::executable(npx)] - fn test_npm_groovy_lint_groovy_242f36b0354c3fe() { + fn test_npm_groovy_lint_groovy_2dc2be09d8013576() { let input = r#" def add(a, b) { return a + b } assert add(1,2) == 3 "#; - let output = Some( - r#"def add(a, b) { + + let output = r#"def add(a, b) { return a + b } assert add(1, 2) == 3 -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("groovy"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::npm_groovy_lint::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/nufmt.rs b/mdsf/src/tools/nufmt.rs index c0b0fd33..450a75c7 100644 --- a/mdsf/src/tools/nufmt.rs +++ b/mdsf/src/tools/nufmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_nufmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_nufmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("nufmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_nufmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("nufmt")]; #[cfg(test)] mod test_nufmt {} diff --git a/mdsf/src/tools/ocamlformat.rs b/mdsf/src/tools/ocamlformat.rs index 7cc48d38..bf30e98e 100644 --- a/mdsf/src/tools/ocamlformat.rs +++ b/mdsf/src/tools/ocamlformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ocamlformat_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,34 +15,30 @@ fn set_ocamlformat_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ocamlformat")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ocamlformat_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ocamlformat")]; #[cfg(test)] mod test_ocamlformat { #[test_with::executable(ocamlformat)] - fn test_ocamlformat_ocaml_d081ce8512af3a72() { + fn test_ocamlformat_ocaml_5f599d285848218() { let input = r#" let add a b = a + b "#; - let output = Some( - r#"let add a b = a + b -"# - .to_owned(), - ); + + let output = r#"let add a b = a + b +"#; + let file_ext = crate::fttype::get_file_extension("ocaml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::ocamlformat::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/ocp_indent.rs b/mdsf/src/tools/ocp_indent.rs index 98a3bce1..3904573a 100644 --- a/mdsf/src/tools/ocp_indent.rs +++ b/mdsf/src/tools/ocp_indent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ocp_indent_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,37 +13,33 @@ fn set_ocp_indent_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ocp-indent")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ocp_indent_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ocp-indent")]; #[cfg(test)] mod test_ocp_indent { #[test_with::executable(ocp-indent)] - fn test_ocp_indent_ocaml_10b8e4c4674bf81c() { + fn test_ocp_indent_ocaml_87a2cd7557f7a90b() { let input = r#" let add a b = a + b "#; - let output = Some( - r#" + + let output = r#" let add a b = a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("ocaml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::ocp_indent::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/odinfmt.rs b/mdsf/src/tools/odinfmt.rs index a484063f..8fb582eb 100644 --- a/mdsf/src/tools/odinfmt.rs +++ b/mdsf/src/tools/odinfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_odinfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_odinfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("odinfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_odinfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("odinfmt")]; #[cfg(test)] mod test_odinfmt {} diff --git a/mdsf/src/tools/oelint_adv.rs b/mdsf/src/tools/oelint_adv.rs index 859e76b0..2343d353 100644 --- a/mdsf/src/tools/oelint_adv.rs +++ b/mdsf/src/tools/oelint_adv.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_oelint_adv_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,15 +15,7 @@ fn set_oelint_adv_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("oelint-adv")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_oelint_adv_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("oelint-adv")]; #[cfg(test)] mod test_oelint_adv {} diff --git a/mdsf/src/tools/opa_fmt.rs b/mdsf/src/tools/opa_fmt.rs index 6f4f10fc..e025b25d 100644 --- a/mdsf/src/tools/opa_fmt.rs +++ b/mdsf/src/tools/opa_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_opa_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_opa_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("opa")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_opa_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("opa")]; #[cfg(test)] mod test_opa_fmt {} diff --git a/mdsf/src/tools/ormolu.rs b/mdsf/src/tools/ormolu.rs index 3393d7f6..121ca795 100644 --- a/mdsf/src/tools/ormolu.rs +++ b/mdsf/src/tools/ormolu.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ormolu_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,38 +14,34 @@ fn set_ormolu_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ormolu")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ormolu_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ormolu")]; #[cfg(test)] mod test_ormolu { #[test_with::executable(ormolu)] - fn test_ormolu_haskell_45197b0621b034d0() { + fn test_ormolu_haskell_c34a44cf19c5fdd7() { let input = r#" addNumbers::Int->Int->Int addNumbers a b = do a + b "#; - let output = Some( - r#"addNumbers :: Int -> Int -> Int + + let output = r#"addNumbers :: Int -> Int -> Int addNumbers a b = do a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("haskell"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::ormolu::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/oxlint.rs b/mdsf/src/tools/oxlint.rs index fd4b6b53..accd6536 100644 --- a/mdsf/src/tools/oxlint.rs +++ b/mdsf/src/tools/oxlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_oxlint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_oxlint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("oxlint"), CommandType::Direct("oxlint"), CommandType::Npm("oxlint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_oxlint_args) -} - #[cfg(test)] mod test_oxlint {} diff --git a/mdsf/src/tools/packer_fix.rs b/mdsf/src/tools/packer_fix.rs index 457152c6..c840ae88 100644 --- a/mdsf/src/tools/packer_fix.rs +++ b/mdsf/src/tools/packer_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_packer_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_packer_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("packer")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_packer_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("packer")]; #[cfg(test)] mod test_packer_fix {} diff --git a/mdsf/src/tools/packer_fmt.rs b/mdsf/src/tools/packer_fmt.rs index d6020e0c..3860ebb6 100644 --- a/mdsf/src/tools/packer_fmt.rs +++ b/mdsf/src/tools/packer_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_packer_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_packer_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("packer")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_packer_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("packer")]; #[cfg(test)] mod test_packer_fmt {} diff --git a/mdsf/src/tools/perltidy.rs b/mdsf/src/tools/perltidy.rs index 83a57827..7ac8d500 100644 --- a/mdsf/src/tools/perltidy.rs +++ b/mdsf/src/tools/perltidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_perltidy_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_perltidy_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("perltidy")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_perltidy_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("perltidy")]; #[cfg(test)] mod test_perltidy {} diff --git a/mdsf/src/tools/pg_format.rs b/mdsf/src/tools/pg_format.rs index a0c32c5e..acd35b7d 100644 --- a/mdsf/src/tools/pg_format.rs +++ b/mdsf/src/tools/pg_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_pg_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_pg_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("pg_format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pg_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("pg_format")]; #[cfg(test)] mod test_pg_format {} diff --git a/mdsf/src/tools/php_cs_fixer_fix.rs b/mdsf/src/tools/php_cs_fixer_fix.rs index e952fc5b..cbba515e 100644 --- a/mdsf/src/tools/php_cs_fixer_fix.rs +++ b/mdsf/src/tools/php_cs_fixer_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_php_cs_fixer_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,18 +13,10 @@ fn set_php_cs_fixer_fix_args( cmd } -const COMMANDS: [CommandType; 2] = [ +pub const COMMANDS: [CommandType; 2] = [ CommandType::PhpVendor("php-cs-fixer"), CommandType::Direct("php-cs-fixer"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_php_cs_fixer_fix_args) -} - #[cfg(test)] mod test_php_cs_fixer_fix {} diff --git a/mdsf/src/tools/phpcbf.rs b/mdsf/src/tools/phpcbf.rs index 3c7ac822..eb5b6e6a 100644 --- a/mdsf/src/tools/phpcbf.rs +++ b/mdsf/src/tools/phpcbf.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_phpcbf_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,18 +12,10 @@ fn set_phpcbf_args( cmd } -const COMMANDS: [CommandType; 2] = [ +pub const COMMANDS: [CommandType; 2] = [ CommandType::PhpVendor("phpcbf"), CommandType::Direct("phpcbf"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_phpcbf_args) -} - #[cfg(test)] mod test_phpcbf {} diff --git a/mdsf/src/tools/phpinsights_fix.rs b/mdsf/src/tools/phpinsights_fix.rs index 76e7c4bf..bf0b3749 100644 --- a/mdsf/src/tools/phpinsights_fix.rs +++ b/mdsf/src/tools/phpinsights_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_phpinsights_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,18 +15,10 @@ fn set_phpinsights_fix_args( cmd } -const COMMANDS: [CommandType; 2] = [ +pub const COMMANDS: [CommandType; 2] = [ CommandType::PhpVendor("phpinsights"), CommandType::Direct("phpinsights"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_phpinsights_fix_args) -} - #[cfg(test)] mod test_phpinsights_fix {} diff --git a/mdsf/src/tools/pint.rs b/mdsf/src/tools/pint.rs index 92a4f40d..aa8cb796 100644 --- a/mdsf/src/tools/pint.rs +++ b/mdsf/src/tools/pint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_pint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,8 @@ fn set_pint_args( cmd } -const COMMANDS: [CommandType; 2] = [CommandType::PhpVendor("pint"), CommandType::Direct("pint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pint_args) -} +pub const COMMANDS: [CommandType; 2] = + [CommandType::PhpVendor("pint"), CommandType::Direct("pint")]; #[cfg(test)] mod test_pint {} diff --git a/mdsf/src/tools/prettier.rs b/mdsf/src/tools/prettier.rs index d12ef6d4..0efb4747 100644 --- a/mdsf/src/tools/prettier.rs +++ b/mdsf/src/tools/prettier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_prettier_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -17,24 +17,16 @@ fn set_prettier_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("prettier"), CommandType::Direct("prettier"), CommandType::Npm("prettier"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_prettier_args) -} - #[cfg(test)] mod test_prettier { #[test_with::executable(npx)] - fn test_prettier_json_3694f4bf312c36fa() { + fn test_prettier_json_8e1e8ed2224fd439() { let input = r#" { "key": "value", @@ -45,25 +37,29 @@ mod test_prettier { , null] } "#; - let output = Some( - r#"{ + + let output = r#"{ "key": "value", "key2": ["value2", "value3", 1, null] } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("json"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::prettier::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(npx)] - fn test_prettier_javascript_e4047d8692b0d84a() { + fn test_prettier_javascript_f38217e7df306e3e() { let input = r#" async function asyncAddition( a,b @@ -72,19 +68,23 @@ mod test_prettier { } "#; - let output = Some( - r#"async function asyncAddition(a, b) { + + let output = r#"async function asyncAddition(a, b) { return a + b; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("javascript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::prettier::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/pretty_php.rs b/mdsf/src/tools/pretty_php.rs index ca82c540..a097b569 100644 --- a/mdsf/src/tools/pretty_php.rs +++ b/mdsf/src/tools/pretty_php.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_pretty_php_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,18 +12,10 @@ fn set_pretty_php_args( cmd } -const COMMANDS: [CommandType; 2] = [ +pub const COMMANDS: [CommandType; 2] = [ CommandType::PhpVendor("pretty-php"), CommandType::Direct("pretty-php"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pretty_php_args) -} - #[cfg(test)] mod test_pretty_php {} diff --git a/mdsf/src/tools/prettypst.rs b/mdsf/src/tools/prettypst.rs index 9e9f6499..fc229255 100644 --- a/mdsf/src/tools/prettypst.rs +++ b/mdsf/src/tools/prettypst.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_prettypst_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_prettypst_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("prettypst")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_prettypst_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("prettypst")]; #[cfg(test)] mod test_prettypst {} diff --git a/mdsf/src/tools/prisma_format.rs b/mdsf/src/tools/prisma_format.rs index c04852d2..b37fbe5b 100644 --- a/mdsf/src/tools/prisma_format.rs +++ b/mdsf/src/tools/prisma_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_prisma_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,24 +14,16 @@ fn set_prisma_format_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("prisma"), CommandType::Direct("prisma"), CommandType::Npm("prisma"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_prisma_format_args) -} - #[cfg(test)] mod test_prisma_format { #[test_with::executable(npx)] - fn test_prisma_format_schema_9e1c2cd6551f36db() { + fn test_prisma_format_schema_b6e70b1b6bb7472e() { let input = r#"datasource db { provider = "postgresql" url = env("DATABASE_URL") @@ -40,21 +32,25 @@ mod test_prisma_format { "#; - let output = Some( - r#"datasource db { + + let output = r#"datasource db { provider = "postgresql" url = env("DATABASE_URL") directUrl = env("DIRECT_DATABASE_URL") } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("schema"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::prisma_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/protolint.rs b/mdsf/src/tools/protolint.rs index 1b794909..6e5fd22f 100644 --- a/mdsf/src/tools/protolint.rs +++ b/mdsf/src/tools/protolint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_protolint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_protolint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("protolint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_protolint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("protolint")]; #[cfg(test)] mod test_protolint {} diff --git a/mdsf/src/tools/ptop.rs b/mdsf/src/tools/ptop.rs index 9720520f..156fc941 100644 --- a/mdsf/src/tools/ptop.rs +++ b/mdsf/src/tools/ptop.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ptop_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_ptop_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ptop")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ptop_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ptop")]; #[cfg(test)] mod test_ptop {} diff --git a/mdsf/src/tools/puppet_lint.rs b/mdsf/src/tools/puppet_lint.rs index 306c0322..e9ec5e67 100644 --- a/mdsf/src/tools/puppet_lint.rs +++ b/mdsf/src/tools/puppet_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_puppet_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_puppet_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("puppet-lint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_puppet_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("puppet-lint")]; #[cfg(test)] mod test_puppet_lint {} diff --git a/mdsf/src/tools/purs_tidy.rs b/mdsf/src/tools/purs_tidy.rs index ff720006..e7f8cf6e 100644 --- a/mdsf/src/tools/purs_tidy.rs +++ b/mdsf/src/tools/purs_tidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_purs_tidy_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,24 +13,16 @@ fn set_purs_tidy_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("purs-tidy"), CommandType::Direct("purs-tidy"), CommandType::Npm("purs-tidy"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_purs_tidy_args) -} - #[cfg(test)] mod test_purs_tidy { #[test_with::executable(npx)] - fn test_purs_tidy_purescript_9d25e0f9177f47be() { + fn test_purs_tidy_purescript_c9e6831b630f7f08() { let input = r#"module Test.Main where import Prelude @@ -41,8 +33,8 @@ import Effect.Class.Console (log) main :: Effect Unit main = do log "You should add some tests.""#; - let output = Some( - r#"module Test.Main where + + let output = r#"module Test.Main where import Prelude @@ -51,15 +43,19 @@ import Effect.Class.Console (log) main :: Effect Unit main = do - log "You should add some tests.""# - .to_owned(), - ); + log "You should add some tests.""#; + let file_ext = crate::fttype::get_file_extension("purescript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::purs_tidy::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/purty.rs b/mdsf/src/tools/purty.rs index 175cf360..66d6ec99 100644 --- a/mdsf/src/tools/purty.rs +++ b/mdsf/src/tools/purty.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_purty_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_purty_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("purty"), CommandType::Direct("purty"), CommandType::Npm("purty"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_purty_args) -} - #[cfg(test)] mod test_purty {} diff --git a/mdsf/src/tools/pycln.rs b/mdsf/src/tools/pycln.rs index d9ed7170..3395b14b 100644 --- a/mdsf/src/tools/pycln.rs +++ b/mdsf/src/tools/pycln.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_pycln_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,28 +14,27 @@ fn set_pycln_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("pycln")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pycln_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("pycln")]; #[cfg(test)] mod test_pycln { #[test_with::executable(pycln)] - fn test_pycln_python_303d0fea3e20b822() { + fn test_pycln_python_21e4539a9b183542() { let input = r#"import math"#; - let output = Some(r#""#.to_owned()); + + let output = r#""#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::pycln::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/pycodestyle.rs b/mdsf/src/tools/pycodestyle.rs index 15a9c4f4..34a3e70c 100644 --- a/mdsf/src/tools/pycodestyle.rs +++ b/mdsf/src/tools/pycodestyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_pycodestyle_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_pycodestyle_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("pycodestyle")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pycodestyle_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("pycodestyle")]; #[cfg(test)] mod test_pycodestyle {} diff --git a/mdsf/src/tools/pyink.rs b/mdsf/src/tools/pyink.rs index 22a03126..164c4191 100644 --- a/mdsf/src/tools/pyink.rs +++ b/mdsf/src/tools/pyink.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_pyink_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,33 +13,29 @@ fn set_pyink_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("pyink")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pyink_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("pyink")]; #[cfg(test)] mod test_pyink { #[test_with::executable(pyink)] - fn test_pyink_python_fb3e2d124e8bebbb() { + fn test_pyink_python_229ec2b01c2bfe3c() { let input = r#"def add( a: int , b:int)->int: return a+b"#; - let output = Some( - r#"def add(a: int, b: int) -> int: + + let output = r#"def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::pyink::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/pyment.rs b/mdsf/src/tools/pyment.rs index 1a27c89d..916a6acc 100644 --- a/mdsf/src/tools/pyment.rs +++ b/mdsf/src/tools/pyment.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_pyment_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_pyment_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("pyment")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_pyment_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("pyment")]; #[cfg(test)] mod test_pyment {} diff --git a/mdsf/src/tools/qmlfmt.rs b/mdsf/src/tools/qmlfmt.rs index 26b8db58..13df1a7f 100644 --- a/mdsf/src/tools/qmlfmt.rs +++ b/mdsf/src/tools/qmlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_qmlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_qmlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("qmlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_qmlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("qmlfmt")]; #[cfg(test)] mod test_qmlfmt {} diff --git a/mdsf/src/tools/quick_lint_js.rs b/mdsf/src/tools/quick_lint_js.rs index 3aee8090..7688edd2 100644 --- a/mdsf/src/tools/quick_lint_js.rs +++ b/mdsf/src/tools/quick_lint_js.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_quick_lint_js_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,19 +12,11 @@ fn set_quick_lint_js_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("quick-lint-js"), CommandType::Direct("quick-lint-js"), CommandType::Npm("quick-lint-js"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_quick_lint_js_args) -} - #[cfg(test)] mod test_quick_lint_js {} diff --git a/mdsf/src/tools/raco_fmt.rs b/mdsf/src/tools/raco_fmt.rs index d1f95d87..f077af72 100644 --- a/mdsf/src/tools/raco_fmt.rs +++ b/mdsf/src/tools/raco_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_raco_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_raco_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("raco")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_raco_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("raco")]; #[cfg(test)] mod test_raco_fmt {} diff --git a/mdsf/src/tools/refmt.rs b/mdsf/src/tools/refmt.rs index 6608ab14..911f03fc 100644 --- a/mdsf/src/tools/refmt.rs +++ b/mdsf/src/tools/refmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_refmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_refmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("refmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_refmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("refmt")]; #[cfg(test)] mod test_refmt {} diff --git a/mdsf/src/tools/reformat_gherkin.rs b/mdsf/src/tools/reformat_gherkin.rs index 37b9b670..fba73208 100644 --- a/mdsf/src/tools/reformat_gherkin.rs +++ b/mdsf/src/tools/reformat_gherkin.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_reformat_gherkin_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_reformat_gherkin_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("reformat-gherkin")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_reformat_gherkin_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("reformat-gherkin")]; #[cfg(test)] mod test_reformat_gherkin {} diff --git a/mdsf/src/tools/regal_fix.rs b/mdsf/src/tools/regal_fix.rs index 4e8dd50e..6115af57 100644 --- a/mdsf/src/tools/regal_fix.rs +++ b/mdsf/src/tools/regal_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_regal_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_regal_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("regal")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_regal_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("regal")]; #[cfg(test)] mod test_regal_fix {} diff --git a/mdsf/src/tools/regal_lint.rs b/mdsf/src/tools/regal_lint.rs index 044cce09..48b03a77 100644 --- a/mdsf/src/tools/regal_lint.rs +++ b/mdsf/src/tools/regal_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_regal_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_regal_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("regal")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_regal_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("regal")]; #[cfg(test)] mod test_regal_lint {} diff --git a/mdsf/src/tools/reorder_python_imports.rs b/mdsf/src/tools/reorder_python_imports.rs index 7e61bd1a..1541fb8c 100644 --- a/mdsf/src/tools/reorder_python_imports.rs +++ b/mdsf/src/tools/reorder_python_imports.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_reorder_python_imports_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,20 +12,7 @@ fn set_reorder_python_imports_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("reorder-python-imports")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools( - &COMMANDS, - file_path, - timeout, - set_reorder_python_imports_args, - ) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("reorder-python-imports")]; #[cfg(test)] mod test_reorder_python_imports {} diff --git a/mdsf/src/tools/rescript_format.rs b/mdsf/src/tools/rescript_format.rs index b2271dc7..3dc19d70 100644 --- a/mdsf/src/tools/rescript_format.rs +++ b/mdsf/src/tools/rescript_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rescript_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,24 +13,16 @@ fn set_rescript_format_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("rescript"), CommandType::Direct("rescript"), CommandType::Npm("rescript"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rescript_format_args) -} - #[cfg(test)] mod test_rescript_format { #[test_with::executable(npx)] - fn test_rescript_format_rescript_30add3bd800dbeaa() { + fn test_rescript_format_rescript_59c7490e2a041de3() { let input = r#"module Button = { @react.component let make = (~count) => { @@ -44,8 +36,8 @@ mod test_rescript_format { } }"#; - let output = Some( - r#"module Button = { + + let output = r#"module Button = { @react.component let make = (~count) => { let times = switch count { @@ -58,15 +50,19 @@ mod test_rescript_format { } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("rescript"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::rescript_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/roc_format.rs b/mdsf/src/tools/roc_format.rs index 0050a965..3c017888 100644 --- a/mdsf/src/tools/roc_format.rs +++ b/mdsf/src/tools/roc_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_roc_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_roc_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("roc")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_roc_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("roc")]; #[cfg(test)] mod test_roc_format { #[test_with::executable(roc)] - fn test_roc_format_roc_8201b2f4943b5b12() { + fn test_roc_format_roc_1204aa2d8186919d() { let input = r#"app "helloWorld" packages { pf: "https://github.com/roc-lang/" } imports [pf.Stdout] @@ -42,23 +34,27 @@ main = "#; - let output = Some( - r#"app [main] { pf: platform "https://github.com/roc-lang/" } + + let output = r#"app [main] { pf: platform "https://github.com/roc-lang/" } import pf.Stdout main = Stdout.line "Hello, World!" -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("roc"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::roc_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/rstfmt.rs b/mdsf/src/tools/rstfmt.rs index db30c277..14baa476 100644 --- a/mdsf/src/tools/rstfmt.rs +++ b/mdsf/src/tools/rstfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rstfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_rstfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("rstfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rstfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("rstfmt")]; #[cfg(test)] mod test_rstfmt {} diff --git a/mdsf/src/tools/rubocop.rs b/mdsf/src/tools/rubocop.rs index d56cd07b..3b5be60f 100644 --- a/mdsf/src/tools/rubocop.rs +++ b/mdsf/src/tools/rubocop.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rubocop_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -16,36 +16,32 @@ fn set_rubocop_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("rubocop")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rubocop_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("rubocop")]; #[cfg(test)] mod test_rubocop { #[test_with::executable(rubocop)] - fn test_rubocop_ruby_abe6af1ec08931cd() { + fn test_rubocop_ruby_d2b8a6db3c8eee1c() { let input = r#"def add( a , b ) return a + b end"#; - let output = Some( - r#"def add(a, b) + + let output = r#"def add(a, b) return a + b end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("ruby"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::rubocop::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/rubyfmt.rs b/mdsf/src/tools/rubyfmt.rs index 0437962c..ce9fa09b 100644 --- a/mdsf/src/tools/rubyfmt.rs +++ b/mdsf/src/tools/rubyfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rubyfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,36 +13,32 @@ fn set_rubyfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("rubyfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rubyfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("rubyfmt")]; #[cfg(test)] mod test_rubyfmt { #[test_with::executable(rubyfmt)] - fn test_rubyfmt_ruby_abe6af1ec08931cd() { + fn test_rubyfmt_ruby_d2b8a6db3c8eee1c() { let input = r#"def add( a , b ) return a + b end"#; - let output = Some( - r#"def add(a, b) + + let output = r#"def add(a, b) return a + b end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("ruby"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::rubyfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/ruff_check.rs b/mdsf/src/tools/ruff_check.rs index 34adde30..1ff547fa 100644 --- a/mdsf/src/tools/ruff_check.rs +++ b/mdsf/src/tools/ruff_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ruff_check_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,15 +15,7 @@ fn set_ruff_check_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ruff")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ruff_check_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ruff")]; #[cfg(test)] mod test_ruff_check {} diff --git a/mdsf/src/tools/ruff_format.rs b/mdsf/src/tools/ruff_format.rs index 958183d7..4bea2b4a 100644 --- a/mdsf/src/tools/ruff_format.rs +++ b/mdsf/src/tools/ruff_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ruff_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,33 +14,29 @@ fn set_ruff_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ruff")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ruff_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ruff")]; #[cfg(test)] mod test_ruff_format { #[test_with::executable(ruff)] - fn test_ruff_format_python_fb3e2d124e8bebbb() { + fn test_ruff_format_python_229ec2b01c2bfe3c() { let input = r#"def add( a: int , b:int)->int: return a+b"#; - let output = Some( - r#"def add(a: int, b: int) -> int: + + let output = r#"def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::ruff_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/rufo.rs b/mdsf/src/tools/rufo.rs index b8e08401..920df107 100644 --- a/mdsf/src/tools/rufo.rs +++ b/mdsf/src/tools/rufo.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rufo_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,36 +13,32 @@ fn set_rufo_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("rufo")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rufo_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("rufo")]; #[cfg(test)] mod test_rufo { #[test_with::executable(rufo)] - fn test_rufo_ruby_abe6af1ec08931cd() { + fn test_rufo_ruby_d2b8a6db3c8eee1c() { let input = r#"def add( a , b ) return a + b end"#; - let output = Some( - r#"def add(a, b) + + let output = r#"def add(a, b) return a + b end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("ruby"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::rufo::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/rune_fmt.rs b/mdsf/src/tools/rune_fmt.rs index e6cc06fa..a65e165f 100644 --- a/mdsf/src/tools/rune_fmt.rs +++ b/mdsf/src/tools/rune_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rune_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_rune_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("rune")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rune_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("rune")]; #[cfg(test)] mod test_rune_fmt {} diff --git a/mdsf/src/tools/rustfmt.rs b/mdsf/src/tools/rustfmt.rs index 45ca4b23..417142d4 100644 --- a/mdsf/src/tools/rustfmt.rs +++ b/mdsf/src/tools/rustfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rustfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,38 +15,34 @@ fn set_rustfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("rustfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rustfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("rustfmt")]; #[cfg(test)] mod test_rustfmt { #[test_with::executable(rustfmt)] - fn test_rustfmt_rust_760026fac349dc23() { + fn test_rustfmt_rust_70ad564760e773e9() { let input = r#"pub async fn add( a: i32, b:i32 )-> i32 {a+b} "#; - let output = Some( - r#"pub async fn add(a: i32, b: i32) -> i32 { + + let output = r#"pub async fn add(a: i32, b: i32) -> i32 { a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("rust"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::rustfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/rustywind.rs b/mdsf/src/tools/rustywind.rs index 57e2ed1e..d9a61a82 100644 --- a/mdsf/src/tools/rustywind.rs +++ b/mdsf/src/tools/rustywind.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_rustywind_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_rustywind_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("rustywind")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_rustywind_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("rustywind")]; #[cfg(test)] mod test_rustywind {} diff --git a/mdsf/src/tools/salt_lint.rs b/mdsf/src/tools/salt_lint.rs index 4dc626da..ce739d70 100644 --- a/mdsf/src/tools/salt_lint.rs +++ b/mdsf/src/tools/salt_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_salt_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_salt_lint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("salt-lint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_salt_lint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("salt-lint")]; #[cfg(test)] mod test_salt_lint {} diff --git a/mdsf/src/tools/scalafmt.rs b/mdsf/src/tools/scalafmt.rs index 4a1fc45e..89d6436b 100644 --- a/mdsf/src/tools/scalafmt.rs +++ b/mdsf/src/tools/scalafmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_scalafmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,40 +15,36 @@ fn set_scalafmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("scalafmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_scalafmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("scalafmt")]; #[cfg(test)] mod test_scalafmt { #[test_with::executable(scalafmt)] - fn test_scalafmt_scala_3a9ebb0c3854e5cc() { + fn test_scalafmt_scala_cbd61c065383c05b() { let input = r#"object Addition { def main() = { println(1 + 3) } }"#; - let output = Some( - r#"object Addition { + + let output = r#"object Addition { def main() = { println(1 + 3) } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("scala"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::scalafmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/scalariform.rs b/mdsf/src/tools/scalariform.rs index b514f497..62c3b26d 100644 --- a/mdsf/src/tools/scalariform.rs +++ b/mdsf/src/tools/scalariform.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_scalariform_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_scalariform_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("scalariform")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_scalariform_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("scalariform")]; #[cfg(test)] mod test_scalariform {} diff --git a/mdsf/src/tools/selene.rs b/mdsf/src/tools/selene.rs index d6d79179..1f4b84f2 100644 --- a/mdsf/src/tools/selene.rs +++ b/mdsf/src/tools/selene.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_selene_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_selene_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("selene")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_selene_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("selene")]; #[cfg(test)] mod test_selene {} diff --git a/mdsf/src/tools/shellcheck.rs b/mdsf/src/tools/shellcheck.rs index 436e0645..916a8859 100644 --- a/mdsf/src/tools/shellcheck.rs +++ b/mdsf/src/tools/shellcheck.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_shellcheck_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_shellcheck_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("shellcheck")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_shellcheck_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("shellcheck")]; #[cfg(test)] mod test_shellcheck {} diff --git a/mdsf/src/tools/shellharden.rs b/mdsf/src/tools/shellharden.rs index 077ded2b..6fcc383d 100644 --- a/mdsf/src/tools/shellharden.rs +++ b/mdsf/src/tools/shellharden.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_shellharden_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_shellharden_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("shellharden")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_shellharden_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("shellharden")]; #[cfg(test)] mod test_shellharden {} diff --git a/mdsf/src/tools/shfmt.rs b/mdsf/src/tools/shfmt.rs index 92b570d5..59d30f20 100644 --- a/mdsf/src/tools/shfmt.rs +++ b/mdsf/src/tools/shfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_shfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_shfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("shfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_shfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("shfmt")]; #[cfg(test)] mod test_shfmt { #[test_with::executable(shfmt)] - fn test_shfmt_shell_a87ae97aff7e2d98() { + fn test_shfmt_shell_9c24a79abf093e10() { let input = r#" #!/bin/sh @@ -43,26 +35,30 @@ mod test_shfmt { "#; - let output = Some( - r#"#!/bin/sh + + let output = r#"#!/bin/sh add() { echo "$1" + "$2" } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("shell"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::shfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(shfmt)] - fn test_shfmt_bash_7888f1bdfe0dcaba() { + fn test_shfmt_bash_9334f16dadf8ef68() { let input = r#" #!/bin/bash @@ -79,26 +75,30 @@ add() { "#; - let output = Some( - r#"#!/bin/bash + + let output = r#"#!/bin/bash add() { echo "$1" + "$2" } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("bash"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::shfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(shfmt)] - fn test_shfmt_zsh_a4d44f81b7f0ec51() { + fn test_shfmt_zsh_63d80ef78ac08ee0() { let input = r#" #!/bin/zsh @@ -115,21 +115,25 @@ add() { "#; - let output = Some( - r#"#!/bin/zsh + + let output = r#"#!/bin/zsh add() { echo "$1" + "$2" } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("zsh"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::shfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/sleek.rs b/mdsf/src/tools/sleek.rs index 98c15a00..8593a5c7 100644 --- a/mdsf/src/tools/sleek.rs +++ b/mdsf/src/tools/sleek.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_sleek_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_sleek_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("sleek")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sleek_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("sleek")]; #[cfg(test)] mod test_sleek {} diff --git a/mdsf/src/tools/smlfmt.rs b/mdsf/src/tools/smlfmt.rs index 6458ef3b..b90e64c3 100644 --- a/mdsf/src/tools/smlfmt.rs +++ b/mdsf/src/tools/smlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_smlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_smlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("smlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_smlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("smlfmt")]; #[cfg(test)] mod test_smlfmt {} diff --git a/mdsf/src/tools/snakefmt.rs b/mdsf/src/tools/snakefmt.rs index 5d571bc1..5c27f203 100644 --- a/mdsf/src/tools/snakefmt.rs +++ b/mdsf/src/tools/snakefmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_snakefmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_snakefmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("snakefmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_snakefmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("snakefmt")]; #[cfg(test)] mod test_snakefmt {} diff --git a/mdsf/src/tools/solhint.rs b/mdsf/src/tools/solhint.rs index f2dab03f..61e8c3b3 100644 --- a/mdsf/src/tools/solhint.rs +++ b/mdsf/src/tools/solhint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_solhint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,19 +15,11 @@ fn set_solhint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("solhint"), CommandType::Direct("solhint"), CommandType::Npm("solhint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_solhint_args) -} - #[cfg(test)] mod test_solhint {} diff --git a/mdsf/src/tools/sql_formatter.rs b/mdsf/src/tools/sql_formatter.rs index 7c02c141..319734a8 100644 --- a/mdsf/src/tools/sql_formatter.rs +++ b/mdsf/src/tools/sql_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_sql_formatter_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,41 +13,37 @@ fn set_sql_formatter_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("sql-formatter"), CommandType::Direct("sql-formatter"), CommandType::Npm("sql-formatter"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sql_formatter_args) -} - #[cfg(test)] mod test_sql_formatter { #[test_with::executable(npx)] - fn test_sql_formatter_sql_3d92b902cf65ff90() { + fn test_sql_formatter_sql_85ac36a4bf14f957() { let input = r#"SELECT * FROM tbl WHERE foo = 'bar';"#; - let output = Some( - r#"SELECT + + let output = r#"SELECT * FROM tbl WHERE foo = 'bar'; -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("sql"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::sql_formatter::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/sqlfluff_fix.rs b/mdsf/src/tools/sqlfluff_fix.rs index ff0cc21e..0bc28438 100644 --- a/mdsf/src/tools/sqlfluff_fix.rs +++ b/mdsf/src/tools/sqlfluff_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_sqlfluff_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,15 +15,7 @@ fn set_sqlfluff_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfluff")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqlfluff_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfluff")]; #[cfg(test)] mod test_sqlfluff_fix {} diff --git a/mdsf/src/tools/sqlfluff_format.rs b/mdsf/src/tools/sqlfluff_format.rs index a10a4d7c..6b38e893 100644 --- a/mdsf/src/tools/sqlfluff_format.rs +++ b/mdsf/src/tools/sqlfluff_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_sqlfluff_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,34 +15,30 @@ fn set_sqlfluff_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfluff")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqlfluff_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfluff")]; #[cfg(test)] mod test_sqlfluff_format { #[test_with::executable(sqlfluff)] - fn test_sqlfluff_format_sql_16c512917bb843b9() { + fn test_sqlfluff_format_sql_55c68b000536eccf() { let input = r#"SELECT * FROM tbl WHERE foo = 'bar'; "#; - let output = Some( - r#"SELECT * FROM tbl + + let output = r#"SELECT * FROM tbl WHERE foo = 'bar'; -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("sql"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::sqlfluff_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/sqlfmt.rs b/mdsf/src/tools/sqlfmt.rs index 8f13a7c6..b95e3fc4 100644 --- a/mdsf/src/tools/sqlfmt.rs +++ b/mdsf/src/tools/sqlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_sqlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_sqlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqlfmt")]; #[cfg(test)] mod test_sqlfmt {} diff --git a/mdsf/src/tools/sqruff.rs b/mdsf/src/tools/sqruff.rs index cb101a38..d3dc176a 100644 --- a/mdsf/src/tools/sqruff.rs +++ b/mdsf/src/tools/sqruff.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_sqruff_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_sqruff_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqruff")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_sqruff_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("sqruff")]; #[cfg(test)] mod test_sqruff {} diff --git a/mdsf/src/tools/standardjs.rs b/mdsf/src/tools/standardjs.rs index 07d6ce7b..993dd8af 100644 --- a/mdsf/src/tools/standardjs.rs +++ b/mdsf/src/tools/standardjs.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_standardjs_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_standardjs_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("standard"), CommandType::Direct("standard"), CommandType::Npm("standard"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_standardjs_args) -} - #[cfg(test)] mod test_standardjs {} diff --git a/mdsf/src/tools/standardrb.rs b/mdsf/src/tools/standardrb.rs index 1abd5780..fe089d99 100644 --- a/mdsf/src/tools/standardrb.rs +++ b/mdsf/src/tools/standardrb.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_standardrb_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,36 +13,32 @@ fn set_standardrb_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("standardrb")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_standardrb_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("standardrb")]; #[cfg(test)] mod test_standardrb { #[test_with::executable(standardrb)] - fn test_standardrb_ruby_fa74023fdfeb57a9() { + fn test_standardrb_ruby_bec6c50c1664b6ed() { let input = r#"def add( a , b ) return a + b end"#; - let output = Some( - r#"def add(a, b) + + let output = r#"def add(a, b) a + b end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("ruby"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::standardrb::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/statix_check.rs b/mdsf/src/tools/statix_check.rs index 8003da17..02eb45e6 100644 --- a/mdsf/src/tools/statix_check.rs +++ b/mdsf/src/tools/statix_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_statix_check_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_statix_check_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("statix")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_statix_check_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("statix")]; #[cfg(test)] mod test_statix_check {} diff --git a/mdsf/src/tools/statix_fix.rs b/mdsf/src/tools/statix_fix.rs index 2096be47..9e617a0c 100644 --- a/mdsf/src/tools/statix_fix.rs +++ b/mdsf/src/tools/statix_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_statix_fix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_statix_fix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("statix")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_statix_fix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("statix")]; #[cfg(test)] mod test_statix_fix {} diff --git a/mdsf/src/tools/stylefmt.rs b/mdsf/src/tools/stylefmt.rs index 7729da29..731c29a7 100644 --- a/mdsf/src/tools/stylefmt.rs +++ b/mdsf/src/tools/stylefmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_stylefmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,24 +12,16 @@ fn set_stylefmt_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("stylefmt"), CommandType::Direct("stylefmt"), CommandType::Npm("stylefmt"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylefmt_args) -} - #[cfg(test)] mod test_stylefmt { #[test_with::executable(npx)] - fn test_stylefmt_scss_d2c143e65006b912() { + fn test_stylefmt_scss_d3c6918bf17af7f3() { let input = r#"// mixin for clearfix @@ -60,8 +52,8 @@ padding: 12px } "#; - let output = Some( - r#"// mixin for clearfix + + let output = r#"// mixin for clearfix @mixin clearfix() { @@ -97,20 +89,24 @@ padding: 12px .bar { @extend %base; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("scss"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::stylefmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } #[test_with::executable(npx)] - fn test_stylefmt_css_d98446828f359199() { + fn test_stylefmt_css_ed4f8407afa6d974() { let input = r#"/* custom properties */ :root{--fontSize: 1rem; --mainColor :#12345678; @@ -155,8 +151,8 @@ h2 {font-variant-caps:small-caps; .blur{filter:blur(4px)}.sepia{ filter: sepia(.8);} "#; - let output = Some( - r#"/* custom properties */ + + let output = r#"/* custom properties */ :root { --fontSize: 1rem; --mainColor: #12345678; @@ -223,15 +219,19 @@ table { .sepia { filter: sepia(.8); } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("css"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::stylefmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/stylelint.rs b/mdsf/src/tools/stylelint.rs index a943467a..3f566459 100644 --- a/mdsf/src/tools/stylelint.rs +++ b/mdsf/src/tools/stylelint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_stylelint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_stylelint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("stylelint"), CommandType::Direct("stylelint"), CommandType::Npm("stylelint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylelint_args) -} - #[cfg(test)] mod test_stylelint {} diff --git a/mdsf/src/tools/stylish_haskell.rs b/mdsf/src/tools/stylish_haskell.rs index 556d8fd3..c455b57d 100644 --- a/mdsf/src/tools/stylish_haskell.rs +++ b/mdsf/src/tools/stylish_haskell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_stylish_haskell_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,38 +13,34 @@ fn set_stylish_haskell_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("stylish-haskell")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylish_haskell_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("stylish-haskell")]; #[cfg(test)] mod test_stylish_haskell { #[test_with::executable(stylish-haskell)] - fn test_stylish_haskell_haskell_72c790bb97bd7a26() { + fn test_stylish_haskell_haskell_9589647c4239e2dd() { let input = r#"addNumbers::Int->Int->Int addNumbers a b = do a + b "#; - let output = Some( - r#"addNumbers::Int->Int->Int + + let output = r#"addNumbers::Int->Int->Int addNumbers a b = do a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("haskell"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::stylish_haskell::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/stylua.rs b/mdsf/src/tools/stylua.rs index 8f42dca3..3fff8083 100644 --- a/mdsf/src/tools/stylua.rs +++ b/mdsf/src/tools/stylua.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_stylua_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,24 +13,16 @@ fn set_stylua_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("stylua"), CommandType::Direct("stylua"), CommandType::Npm("@johnnymorganz/stylua-bin"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_stylua_args) -} - #[cfg(test)] mod test_stylua { #[test_with::executable(npx)] - fn test_stylua_lua_aaecbc44cc18ece0() { + fn test_stylua_lua_ab45775f0dc2fcca() { let input = r#" local function add ( a , b @@ -42,19 +34,23 @@ return a +b end "#; - let output = Some( - r#"local function add(a, b) + + let output = r#"local function add(a, b) return a + b end -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("lua"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::stylua::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/superhtml_fmt.rs b/mdsf/src/tools/superhtml_fmt.rs index 8f19b54a..725e4707 100644 --- a/mdsf/src/tools/superhtml_fmt.rs +++ b/mdsf/src/tools/superhtml_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_superhtml_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,39 +13,35 @@ fn set_superhtml_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("superhtml")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_superhtml_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("superhtml")]; #[cfg(test)] mod test_superhtml_fmt { #[test_with::executable(superhtml)] - fn test_superhtml_fmt_html_5c8e18802f77154a() { + fn test_superhtml_fmt_html_8183dae6d1f190e1() { let input = r#"

Mads was here

"#; - let output = Some( - r#"
+ + let output = r#"

Mads was here

-
"# - .to_owned(), - ); +
"#; + let file_ext = crate::fttype::get_file_extension("html"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::superhtml_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/swift_format.rs b/mdsf/src/tools/swift_format.rs index 87b540e1..9fc1afa6 100644 --- a/mdsf/src/tools/swift_format.rs +++ b/mdsf/src/tools/swift_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_swift_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,36 +13,32 @@ fn set_swift_format_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("swift-format")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_swift_format_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("swift-format")]; #[cfg(test)] mod test_swift_format { #[test_with::executable(swift-format)] - fn test_swift_format_swift_b40925120220f7cd() { + fn test_swift_format_swift_5717762df3975151() { let input = r#" func add(a:Int ,b:Int)->Int { return a + b }"#; - let output = Some( - r#"func add(a: Int, b: Int) -> Int { + + let output = r#"func add(a: Int, b: Int) -> Int { return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("swift"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::swift_format::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/swiftformat.rs b/mdsf/src/tools/swiftformat.rs index 8afc1b49..dd147979 100644 --- a/mdsf/src/tools/swiftformat.rs +++ b/mdsf/src/tools/swiftformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_swiftformat_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,36 +13,32 @@ fn set_swiftformat_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("swiftformat")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_swiftformat_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("swiftformat")]; #[cfg(test)] mod test_swiftformat { #[test_with::executable(swiftformat)] - fn test_swiftformat_swift_b40925120220f7cd() { + fn test_swiftformat_swift_5717762df3975151() { let input = r#" func add(a:Int ,b:Int)->Int { return a + b }"#; - let output = Some( - r#"func add(a: Int, b: Int) -> Int { + + let output = r#"func add(a: Int, b: Int) -> Int { return a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("swift"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::swiftformat::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/taplo.rs b/mdsf/src/tools/taplo.rs index 6ccf4c81..7d7ce7ca 100644 --- a/mdsf/src/tools/taplo.rs +++ b/mdsf/src/tools/taplo.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_taplo_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,39 +13,35 @@ fn set_taplo_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("taplo"), CommandType::Direct("taplo"), CommandType::Npm("@taplo/cli"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_taplo_args) -} - #[cfg(test)] mod test_taplo { #[test_with::executable(npx)] - fn test_taplo_toml_34e29a1117e8cb79() { + fn test_taplo_toml_f9c7870e88d1963c() { let input = r#" package = "mdsf" author = "Mads Hougesen" "#; - let output = Some( - r#"package = "mdsf" + + let output = r#"package = "mdsf" author = "Mads Hougesen" -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("toml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::taplo::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/templ_fmt.rs b/mdsf/src/tools/templ_fmt.rs index 3d38c347..211c7e4d 100644 --- a/mdsf/src/tools/templ_fmt.rs +++ b/mdsf/src/tools/templ_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_templ_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_templ_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("templ")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_templ_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("templ")]; #[cfg(test)] mod test_templ_fmt {} diff --git a/mdsf/src/tools/terraform_fmt.rs b/mdsf/src/tools/terraform_fmt.rs index 42f0df75..07f2e475 100644 --- a/mdsf/src/tools/terraform_fmt.rs +++ b/mdsf/src/tools/terraform_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_terraform_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,20 +14,12 @@ fn set_terraform_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("terraform")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_terraform_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("terraform")]; #[cfg(test)] mod test_terraform_fmt { #[test_with::executable(terraform)] - fn test_terraform_fmt_tf_c8abf8bba550fe29() { + fn test_terraform_fmt_tf_2c1d9f26008080c1() { let input = r#"resource "aws_instance" "example" { ami = "abc123" @@ -35,22 +27,26 @@ mod test_terraform_fmt { } } "#; - let output = Some( - r#"resource "aws_instance" "example" { + + let output = r#"resource "aws_instance" "example" { ami = "abc123" network_interface { } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("tf"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::terraform_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/terragrunt_hclfmt.rs b/mdsf/src/tools/terragrunt_hclfmt.rs index ee464d0c..f13f28b1 100644 --- a/mdsf/src/tools/terragrunt_hclfmt.rs +++ b/mdsf/src/tools/terragrunt_hclfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_terragrunt_hclfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_terragrunt_hclfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("terragrunt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_terragrunt_hclfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("terragrunt")]; #[cfg(test)] mod test_terragrunt_hclfmt {} diff --git a/mdsf/src/tools/tex_fmt.rs b/mdsf/src/tools/tex_fmt.rs index 7a2c6959..3972e036 100644 --- a/mdsf/src/tools/tex_fmt.rs +++ b/mdsf/src/tools/tex_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_tex_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_tex_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("tex-fmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tex_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("tex-fmt")]; #[cfg(test)] mod test_tex_fmt {} diff --git a/mdsf/src/tools/tlint_format.rs b/mdsf/src/tools/tlint_format.rs index e42d510e..e0589cca 100644 --- a/mdsf/src/tools/tlint_format.rs +++ b/mdsf/src/tools/tlint_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_tlint_format_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,18 +13,10 @@ fn set_tlint_format_args( cmd } -const COMMANDS: [CommandType; 2] = [ +pub const COMMANDS: [CommandType; 2] = [ CommandType::PhpVendor("tlint"), CommandType::Direct("tlint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tlint_format_args) -} - #[cfg(test)] mod test_tlint_format {} diff --git a/mdsf/src/tools/tofu_fmt.rs b/mdsf/src/tools/tofu_fmt.rs index 145865a0..9c725496 100644 --- a/mdsf/src/tools/tofu_fmt.rs +++ b/mdsf/src/tools/tofu_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_tofu_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,20 +14,12 @@ fn set_tofu_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("tofu")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tofu_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("tofu")]; #[cfg(test)] mod test_tofu_fmt { #[test_with::executable(tofu)] - fn test_tofu_fmt_terraform_d0328fd989abae6d() { + fn test_tofu_fmt_terraform_ad45c247a9c563a1() { let input = r#"resource "aws_instance" "example" { ami = "abc123" @@ -35,22 +27,26 @@ mod test_tofu_fmt { } } "#; - let output = Some( - r#"resource "aws_instance" "example" { + + let output = r#"resource "aws_instance" "example" { ami = "abc123" network_interface { } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("terraform"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::tofu_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/toml_sort.rs b/mdsf/src/tools/toml_sort.rs index f5cf23c5..300c409b 100644 --- a/mdsf/src/tools/toml_sort.rs +++ b/mdsf/src/tools/toml_sort.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_toml_sort_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_toml_sort_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("toml-sort")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_toml_sort_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("toml-sort")]; #[cfg(test)] mod test_toml_sort {} diff --git a/mdsf/src/tools/topiary.rs b/mdsf/src/tools/topiary.rs index f8efdc44..c23e5dec 100644 --- a/mdsf/src/tools/topiary.rs +++ b/mdsf/src/tools/topiary.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_topiary_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_topiary_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("topiary")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_topiary_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("topiary")]; #[cfg(test)] mod test_topiary { #[test_with::executable(topiary)] - fn test_topiary_json_9cf77f718b7f7e0c() { + fn test_topiary_json_d426a9ade74002d2() { let input = r#" { "key": "value", @@ -37,8 +29,8 @@ mod test_topiary { , null] } "#; - let output = Some( - r#"{ + + let output = r#"{ "key": "value", "key2": [ "value2", @@ -47,15 +39,19 @@ mod test_topiary { null ] } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("json"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::topiary::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/ts_standard.rs b/mdsf/src/tools/ts_standard.rs index e2173fae..022eda36 100644 --- a/mdsf/src/tools/ts_standard.rs +++ b/mdsf/src/tools/ts_standard.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ts_standard_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_ts_standard_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("ts-standard"), CommandType::Direct("ts-standard"), CommandType::Npm("ts-standard"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ts_standard_args) -} - #[cfg(test)] mod test_ts_standard {} diff --git a/mdsf/src/tools/tsqllint.rs b/mdsf/src/tools/tsqllint.rs index be01954b..0901c3e5 100644 --- a/mdsf/src/tools/tsqllint.rs +++ b/mdsf/src/tools/tsqllint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_tsqllint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_tsqllint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("tsqllint"), CommandType::Direct("tsqllint"), CommandType::Npm("tsqllint"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_tsqllint_args) -} - #[cfg(test)] mod test_tsqllint {} diff --git a/mdsf/src/tools/twig_cs_fixer_lint.rs b/mdsf/src/tools/twig_cs_fixer_lint.rs index 79c04d29..07260aa6 100644 --- a/mdsf/src/tools/twig_cs_fixer_lint.rs +++ b/mdsf/src/tools/twig_cs_fixer_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_twig_cs_fixer_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -16,18 +16,10 @@ fn set_twig_cs_fixer_lint_args( cmd } -const COMMANDS: [CommandType; 2] = [ +pub const COMMANDS: [CommandType; 2] = [ CommandType::PhpVendor("twig-cs-fixer"), CommandType::Direct("twig-cs-fixer"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_twig_cs_fixer_lint_args) -} - #[cfg(test)] mod test_twig_cs_fixer_lint {} diff --git a/mdsf/src/tools/typos.rs b/mdsf/src/tools/typos.rs index aeac8175..18f66df0 100644 --- a/mdsf/src/tools/typos.rs +++ b/mdsf/src/tools/typos.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_typos_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,28 +15,27 @@ fn set_typos_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("typos")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_typos_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("typos")]; #[cfg(test)] mod test_typos { #[test_with::executable(typos)] - fn test_typos_python_45f392211f741c27() { + fn test_typos_python_cba663e4f5e54b7f() { let input = r#"anouncement"#; - let output = Some(r#"announcement"#.to_owned()); + + let output = r#"announcement"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::typos::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/typstfmt.rs b/mdsf/src/tools/typstfmt.rs index 266c3f29..65ed4368 100644 --- a/mdsf/src/tools/typstfmt.rs +++ b/mdsf/src/tools/typstfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_typstfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_typstfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("typstfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_typstfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("typstfmt")]; #[cfg(test)] mod test_typstfmt {} diff --git a/mdsf/src/tools/typstyle.rs b/mdsf/src/tools/typstyle.rs index c0a528f4..2ea76a12 100644 --- a/mdsf/src/tools/typstyle.rs +++ b/mdsf/src/tools/typstyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_typstyle_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_typstyle_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("typstyle")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_typstyle_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("typstyle")]; #[cfg(test)] mod test_typstyle {} diff --git a/mdsf/src/tools/ufmt.rs b/mdsf/src/tools/ufmt.rs index c5db8e5f..42b0ffd3 100644 --- a/mdsf/src/tools/ufmt.rs +++ b/mdsf/src/tools/ufmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ufmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_ufmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ufmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ufmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ufmt")]; #[cfg(test)] mod test_ufmt {} diff --git a/mdsf/src/tools/uiua_fmt.rs b/mdsf/src/tools/uiua_fmt.rs index 31a9d547..5b63c30a 100644 --- a/mdsf/src/tools/uiua_fmt.rs +++ b/mdsf/src/tools/uiua_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_uiua_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_uiua_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("uiua")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_uiua_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("uiua")]; #[cfg(test)] mod test_uiua_fmt {} diff --git a/mdsf/src/tools/unimport.rs b/mdsf/src/tools/unimport.rs index ab15fcef..159b72dd 100644 --- a/mdsf/src/tools/unimport.rs +++ b/mdsf/src/tools/unimport.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_unimport_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_unimport_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("unimport")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_unimport_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("unimport")]; #[cfg(test)] mod test_unimport {} diff --git a/mdsf/src/tools/usort.rs b/mdsf/src/tools/usort.rs index 9922cd09..8e6d9487 100644 --- a/mdsf/src/tools/usort.rs +++ b/mdsf/src/tools/usort.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_usort_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_usort_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("usort")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_usort_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("usort")]; #[cfg(test)] mod test_usort { #[test_with::executable(usort)] - fn test_usort_python_60a4eb49e083b28f() { + fn test_usort_python_e2ac93e0195d9bc1() { let input = r#"from q import d import b import a @@ -36,8 +28,8 @@ import c def add(a: int, b: int) -> int: return a + b "#; - let output = Some( - r#"import a + + let output = r#"import a import b import c from q import d @@ -45,15 +37,19 @@ from q import d def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::usort::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/v_fmt.rs b/mdsf/src/tools/v_fmt.rs index 07221e15..9b07ca14 100644 --- a/mdsf/src/tools/v_fmt.rs +++ b/mdsf/src/tools/v_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_v_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_v_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("v")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_v_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("v")]; #[cfg(test)] mod test_v_fmt {} diff --git a/mdsf/src/tools/vacuum_lint.rs b/mdsf/src/tools/vacuum_lint.rs index c7a197d8..eb96491c 100644 --- a/mdsf/src/tools/vacuum_lint.rs +++ b/mdsf/src/tools/vacuum_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_vacuum_lint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_vacuum_lint_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("vacuum"), CommandType::Direct("vacuum"), CommandType::Npm("@quobix/vacuum"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_vacuum_lint_args) -} - #[cfg(test)] mod test_vacuum_lint {} diff --git a/mdsf/src/tools/veryl_fmt.rs b/mdsf/src/tools/veryl_fmt.rs index f6cc6192..f5129b6b 100644 --- a/mdsf/src/tools/veryl_fmt.rs +++ b/mdsf/src/tools/veryl_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_veryl_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_veryl_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("veryl")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_veryl_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("veryl")]; #[cfg(test)] mod test_veryl_fmt { #[test_with::executable(veryl)] - fn test_veryl_fmt_veryl_f906da5df20d5b35() { + fn test_veryl_fmt_veryl_529de9cf882c5a00() { let input = r#"/// documentation comment by markdown format /// * list item1 /// * list item2 @@ -53,8 +45,8 @@ pub module Delay #( // visibility control by `pub` keyword } } "#; - let output = Some( - r#"/// documentation comment by markdown format + + let output = r#"/// documentation comment by markdown format /// * list item1 /// * list item2 pub module Delay #( // visibility control by `pub` keyword @@ -79,15 +71,19 @@ pub module Delay #( // visibility control by `pub` keyword } } } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("veryl"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::veryl_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/vhdl_style_guide.rs b/mdsf/src/tools/vhdl_style_guide.rs index 52f64483..b697b38f 100644 --- a/mdsf/src/tools/vhdl_style_guide.rs +++ b/mdsf/src/tools/vhdl_style_guide.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_vhdl_style_guide_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -14,15 +14,7 @@ fn set_vhdl_style_guide_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("vsg")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_vhdl_style_guide_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("vsg")]; #[cfg(test)] mod test_vhdl_style_guide {} diff --git a/mdsf/src/tools/wa_fmt.rs b/mdsf/src/tools/wa_fmt.rs index d12c4bbe..cbd2e706 100644 --- a/mdsf/src/tools/wa_fmt.rs +++ b/mdsf/src/tools/wa_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_wa_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_wa_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("wa")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_wa_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("wa")]; #[cfg(test)] mod test_wa_fmt {} diff --git a/mdsf/src/tools/wfindent.rs b/mdsf/src/tools/wfindent.rs index 4d5cf030..42224afe 100644 --- a/mdsf/src/tools/wfindent.rs +++ b/mdsf/src/tools/wfindent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_wfindent_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,15 +12,7 @@ fn set_wfindent_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("wfindent")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_wfindent_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("wfindent")]; #[cfg(test)] mod test_wfindent {} diff --git a/mdsf/src/tools/xmlformat.rs b/mdsf/src/tools/xmlformat.rs index 7d824699..8b684720 100644 --- a/mdsf/src/tools/xmlformat.rs +++ b/mdsf/src/tools/xmlformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_xmlformat_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_xmlformat_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("xmlformat")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_xmlformat_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("xmlformat")]; #[cfg(test)] mod test_xmlformat { #[test_with::executable(xmlformat)] - fn test_xmlformat_xml_34659067ca1d8b7c() { + fn test_xmlformat_xml_5e39abb678e63c0b() { let input = r#" Tove @@ -34,21 +26,25 @@ mod test_xmlformat { Reminder Don't forget me this weekend! "#; - let output = Some( - r#" + + let output = r#" Tove Jani Reminder Don't forget me this weekend! -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("xml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::xmlformat::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/xmllint.rs b/mdsf/src/tools/xmllint.rs index 6c1401b9..343a6515 100644 --- a/mdsf/src/tools/xmllint.rs +++ b/mdsf/src/tools/xmllint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_xmllint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,20 +15,12 @@ fn set_xmllint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("xmllint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_xmllint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("xmllint")]; #[cfg(test)] mod test_xmllint { #[test_with::executable(xmllint)] - fn test_xmllint_xml_8a39bd2662133a88() { + fn test_xmllint_xml_29dedc18db9d2e97() { let input = r#" Tove @@ -36,23 +28,27 @@ mod test_xmllint { Reminder Don't forget me this weekend! "#; - let output = Some( - r#" + + let output = r#" Tove Jani Reminder Don't forget me this weekend! -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("xml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::xmllint::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/xo.rs b/mdsf/src/tools/xo.rs index 3f5c6678..158d6568 100644 --- a/mdsf/src/tools/xo.rs +++ b/mdsf/src/tools/xo.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_xo_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,19 +13,11 @@ fn set_xo_args( cmd } -const COMMANDS: [CommandType; 3] = [ +pub const COMMANDS: [CommandType; 3] = [ CommandType::NodeModules("xo"), CommandType::Direct("xo"), CommandType::Npm("xo"), ]; -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_xo_args) -} - #[cfg(test)] mod test_xo {} diff --git a/mdsf/src/tools/yamlfix.rs b/mdsf/src/tools/yamlfix.rs index 3d82b313..6562103e 100644 --- a/mdsf/src/tools/yamlfix.rs +++ b/mdsf/src/tools/yamlfix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_yamlfix_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -12,20 +12,12 @@ fn set_yamlfix_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("yamlfix")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yamlfix_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("yamlfix")]; #[cfg(test)] mod test_yamlfix { #[test_with::executable(yamlfix)] - fn test_yamlfix_yaml_61bdc66d3f74b746() { + fn test_yamlfix_yaml_9fcbc943bcaf9d7f() { let input = r#" @@ -49,8 +41,8 @@ updates: "#; - let output = Some( - r#"--- + + let output = r#"--- version: 2 updates: - package-ecosystem: cargo @@ -65,15 +57,19 @@ updates: interval: monthly assignees: [hougesen] open-pull-requests-limit: 25 -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("yaml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::yamlfix::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/yamlfmt.rs b/mdsf/src/tools/yamlfmt.rs index ad246f4a..df03727b 100644 --- a/mdsf/src/tools/yamlfmt.rs +++ b/mdsf/src/tools/yamlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_yamlfmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_yamlfmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("yamlfmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yamlfmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("yamlfmt")]; #[cfg(test)] mod test_yamlfmt { #[test_with::executable(yamlfmt)] - fn test_yamlfmt_yaml_f383efd52f3fcc71() { + fn test_yamlfmt_yaml_5f37046bfdc59220() { let input = r#" @@ -50,8 +42,8 @@ updates: "#; - let output = Some( - r#"version: 2 + + let output = r#"version: 2 updates: - package-ecosystem: "cargo" directory: "/" @@ -67,15 +59,19 @@ updates: assignees: - "hougesen" open-pull-requests-limit: 25 -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("yaml"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::yamlfmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/yapf.rs b/mdsf/src/tools/yapf.rs index 580562c1..725f5643 100644 --- a/mdsf/src/tools/yapf.rs +++ b/mdsf/src/tools/yapf.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_yapf_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,33 +13,29 @@ fn set_yapf_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("yapf")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yapf_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("yapf")]; #[cfg(test)] mod test_yapf { #[test_with::executable(yapf)] - fn test_yapf_python_fb3e2d124e8bebbb() { + fn test_yapf_python_229ec2b01c2bfe3c() { let input = r#"def add( a: int , b:int)->int: return a+b"#; - let output = Some( - r#"def add(a: int, b: int) -> int: + + let output = r#"def add(a: int, b: int) -> int: return a + b -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("python"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::yapf::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/yew_fmt.rs b/mdsf/src/tools/yew_fmt.rs index 43960b07..b83af6fe 100644 --- a/mdsf/src/tools/yew_fmt.rs +++ b/mdsf/src/tools/yew_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_yew_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -15,38 +15,34 @@ fn set_yew_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("yew-fmt")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_yew_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("yew-fmt")]; #[cfg(test)] mod test_yew_fmt { #[test_with::executable(yew-fmt)] - fn test_yew_fmt_rust_760026fac349dc23() { + fn test_yew_fmt_rust_70ad564760e773e9() { let input = r#"pub async fn add( a: i32, b:i32 )-> i32 {a+b} "#; - let output = Some( - r#"pub async fn add(a: i32, b: i32) -> i32 { + + let output = r#"pub async fn add(a: i32, b: i32) -> i32 { a + b } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("rust"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::yew_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/zig_fmt.rs b/mdsf/src/tools/zig_fmt.rs index a81b16d1..357d41af 100644 --- a/mdsf/src/tools/zig_fmt.rs +++ b/mdsf/src/tools/zig_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_zig_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,39 +13,35 @@ fn set_zig_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("zig")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_zig_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("zig")]; #[cfg(test)] mod test_zig_fmt { #[test_with::executable(zig)] - fn test_zig_fmt_zig_4e17c63c72d89acb() { + fn test_zig_fmt_zig_8151c333113cef41() { let input = r#" fn add (a : i32 , b : i32 ) i32 { return a + b ; } "#; - let output = Some( - r#"fn add(a: i32, b: i32) i32 { + + let output = r#"fn add(a: i32, b: i32) i32 { return a + b; } -"# - .to_owned(), - ); +"#; + let file_ext = crate::fttype::get_file_extension("zig"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::zig_fmt::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/mdsf/src/tools/ziggy_fmt.rs b/mdsf/src/tools/ziggy_fmt.rs index 1b485729..471301a9 100644 --- a/mdsf/src/tools/ziggy_fmt.rs +++ b/mdsf/src/tools/ziggy_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_ziggy_fmt_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,15 +13,7 @@ fn set_ziggy_fmt_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("ziggy")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_ziggy_fmt_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("ziggy")]; #[cfg(test)] mod test_ziggy_fmt {} diff --git a/mdsf/src/tools/zprint.rs b/mdsf/src/tools/zprint.rs index 395357a1..4dd6a6f4 100644 --- a/mdsf/src/tools/zprint.rs +++ b/mdsf/src/tools/zprint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -fn set_zprint_args( +pub fn set_arguments( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -13,20 +13,12 @@ fn set_zprint_args( cmd } -const COMMANDS: [CommandType; 1] = [CommandType::Direct("zprint")]; - -#[inline] -pub fn run( - file_path: &std::path::Path, - timeout: u64, -) -> Result<(bool, Option), crate::error::MdsfError> { - crate::execution::run_tools(&COMMANDS, file_path, timeout, set_zprint_args) -} +pub const COMMANDS: [CommandType; 1] = [CommandType::Direct("zprint")]; #[cfg(test)] mod test_zprint { #[test_with::executable(zprint)] - fn test_zprint_clojure_c7eb78c2d8154947() { + fn test_zprint_clojure_81eb4a785de214e8() { let input = r#"(defn change-start-column [new-start-column style-vec [inline-comment-index start-column spaces-before :as comment-vec]] (if (zero? inline-comment-index) style-vec (let [delta-spaces (- new-start-column start-column) new-spaces @@ -37,8 +29,8 @@ mod test_zprint { (blanks new-spaces)) c e] (= e :whitespace) [(str (blanks new-spaces)) c e 26] :else nil)] (assoc style-vec previous-element-index new-previous-element))))"#; - let output = Some( - r#"(defn change-start-column + + let output = r#"(defn change-start-column [new-start-column style-vec [inline-comment-index start-column spaces-before :as comment-vec]] (if (zero? inline-comment-index) @@ -52,15 +44,19 @@ mod test_zprint { " (blanks new-spaces)) c e] (= e :whitespace) [(str (blanks new-spaces)) c e 26] :else nil)] - (assoc style-vec previous-element-index new-previous-element))))"# - .to_owned(), - ); + (assoc style-vec previous-element-index new-previous-element))))"#; + let file_ext = crate::fttype::get_file_extension("clojure"); + let snippet = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); - let result = crate::tools::zprint::run(snippet.path(), 0) - .expect("it to be successful") - .1; + + let result = + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + .expect("it to be successful") + .1 + .expect("it to be some"); + assert_eq!(result, output); } } diff --git a/tools/actionlint/plugin.json b/tools/actionlint/plugin.json index 35f48be2..dd54013f 100644 --- a/tools/actionlint/plugin.json +++ b/tools/actionlint/plugin.json @@ -9,7 +9,7 @@ { "language": "yaml", "test_input": "name: action\non: push\njobs:\n format:\n runs-on: ubuntu-latest\n steps:\n - run: mdsf format .\n", - "test_output": null + "test_output": "name: action\non: push\njobs:\n format:\n runs-on: ubuntu-latest\n steps:\n - run: mdsf format .\n" } ] } diff --git a/tools/mado/plugin.json b/tools/mado/plugin.json index 0fb7a834..51762317 100644 --- a/tools/mado/plugin.json +++ b/tools/mado/plugin.json @@ -9,7 +9,7 @@ { "language": "markdown", "test_input": "# Hello world\n\n- Hello\n- world\n\n", - "test_output": null + "test_output": "# Hello world\n\n- Hello\n- world\n\n" } ] } diff --git a/tools/tool.schema.json b/tools/tool.schema.json index dbe5c9d6..2761451f 100644 --- a/tools/tool.schema.json +++ b/tools/tool.schema.json @@ -87,7 +87,7 @@ }, "ToolCommandTest": { "type": "object", - "required": ["language", "test_input"], + "required": ["language", "test_input", "test_output"], "properties": { "language": { "description": "Codeblock language used when generating tests", @@ -97,7 +97,7 @@ "type": "string" }, "test_output": { - "type": ["string", "null"] + "type": "string" } }, "additionalProperties": false From 6e40447f63d8aad9469f44d69d466a955a6efc7a Mon Sep 17 00:00:00 2001 From: Mads Hougesen Date: Mon, 27 Jan 2025 23:54:54 +0100 Subject: [PATCH 5/5] refactor: only 1 run_tools call --- codegen/src/tools.rs | 17 +- mdsf/src/tools/actionlint.rs | 4 +- mdsf/src/tools/alejandra.rs | 4 +- mdsf/src/tools/ameba.rs | 2 +- mdsf/src/tools/ansible_lint.rs | 2 +- mdsf/src/tools/asmfmt.rs | 2 +- mdsf/src/tools/astyle.rs | 2 +- mdsf/src/tools/auto_optional.rs | 4 +- mdsf/src/tools/autocorrect.rs | 2 +- mdsf/src/tools/autoflake.rs | 4 +- mdsf/src/tools/autopep_8.rs | 4 +- mdsf/src/tools/beancount_black.rs | 2 +- mdsf/src/tools/beautysh.rs | 6 +- mdsf/src/tools/bibtex_tidy.rs | 2 +- mdsf/src/tools/bicep_format.rs | 2 +- mdsf/src/tools/biome_check.rs | 2 +- mdsf/src/tools/biome_format.rs | 8 +- mdsf/src/tools/biome_lint.rs | 2 +- mdsf/src/tools/black.rs | 4 +- mdsf/src/tools/blade_formatter.rs | 4 +- mdsf/src/tools/blue.rs | 4 +- mdsf/src/tools/bpfmt.rs | 2 +- mdsf/src/tools/brittany.rs | 2 +- mdsf/src/tools/brunette.rs | 4 +- mdsf/src/tools/bsfmt.rs | 2 +- mdsf/src/tools/bslint.rs | 2 +- mdsf/src/tools/buf_format.rs | 4 +- mdsf/src/tools/buildifier.rs | 2 +- mdsf/src/tools/cabal_fmt.rs | 2 +- mdsf/src/tools/cabal_format.rs | 4 +- mdsf/src/tools/cabal_prettify.rs | 2 +- mdsf/src/tools/caddy_fmt.rs | 2 +- mdsf/src/tools/caramel_fmt.rs | 2 +- mdsf/src/tools/clang_format.rs | 18 +- mdsf/src/tools/clang_tidy.rs | 2 +- mdsf/src/tools/cljfmt_fix.rs | 2 +- mdsf/src/tools/cljstyle.rs | 4 +- mdsf/src/tools/cmake_format.rs | 2 +- mdsf/src/tools/codespell.rs | 2 +- mdsf/src/tools/crlfmt.rs | 2 +- mdsf/src/tools/crystal_format.rs | 4 +- mdsf/src/tools/csharpier.rs | 4 +- mdsf/src/tools/css_beautify.rs | 4 +- mdsf/src/tools/csscomb.rs | 4 +- mdsf/src/tools/csslint.rs | 2 +- mdsf/src/tools/curlylint.rs | 2 +- mdsf/src/tools/d_2_fmt.rs | 2 +- mdsf/src/tools/dart_fix.rs | 2 +- mdsf/src/tools/dart_format.rs | 4 +- mdsf/src/tools/dcm_fix.rs | 2 +- mdsf/src/tools/dcm_format.rs | 2 +- mdsf/src/tools/deadnix.rs | 2 +- mdsf/src/tools/deno_fmt.rs | 8 +- mdsf/src/tools/deno_lint.rs | 2 +- mdsf/src/tools/dfmt.rs | 2 +- mdsf/src/tools/dhall.rs | 2 +- mdsf/src/tools/djade.rs | 2 +- mdsf/src/tools/djlint.rs | 2 +- mdsf/src/tools/docformatter.rs | 2 +- mdsf/src/tools/dockfmt.rs | 2 +- mdsf/src/tools/docstrfmt.rs | 2 +- mdsf/src/tools/doctoc.rs | 2 +- mdsf/src/tools/dotenv_linter_fix.rs | 2 +- mdsf/src/tools/dprint_fmt.rs | 2 +- mdsf/src/tools/easy_coding_standard.rs | 2 +- mdsf/src/tools/efmt.rs | 4 +- mdsf/src/tools/elm_format.rs | 4 +- mdsf/src/tools/erb_formatter.rs | 2 +- mdsf/src/tools/erlfmt.rs | 4 +- mdsf/src/tools/eslint.rs | 2 +- mdsf/src/tools/fantomas.rs | 4 +- mdsf/src/tools/fish_indent.rs | 2 +- mdsf/src/tools/fixjson.rs | 2 +- mdsf/src/tools/floskell.rs | 2 +- mdsf/src/tools/fnlfmt.rs | 2 +- mdsf/src/tools/forge_fmt.rs | 2 +- mdsf/src/tools/fourmolu.rs | 4 +- mdsf/src/tools/fprettify.rs | 4 +- mdsf/src/tools/futhark_fmt.rs | 2 +- mdsf/src/tools/gci.rs | 2 +- mdsf/src/tools/gdformat.rs | 2 +- mdsf/src/tools/gersemi.rs | 2 +- mdsf/src/tools/gleam_format.rs | 4 +- mdsf/src/tools/gluon_fmt.rs | 2 +- mdsf/src/tools/gofmt.rs | 4 +- mdsf/src/tools/gofumpt.rs | 4 +- mdsf/src/tools/goimports.rs | 4 +- mdsf/src/tools/goimports_reviser.rs | 2 +- mdsf/src/tools/golines.rs | 4 +- mdsf/src/tools/google_java_format.rs | 4 +- mdsf/src/tools/grain_format.rs | 4 +- mdsf/src/tools/hadolint.rs | 2 +- mdsf/src/tools/haml_lint.rs | 2 +- mdsf/src/tools/hclfmt.rs | 2 +- mdsf/src/tools/hfmt.rs | 2 +- mdsf/src/tools/hindent.rs | 4 +- mdsf/src/tools/hlint.rs | 2 +- mdsf/src/tools/html_beautify.rs | 4 +- mdsf/src/tools/htmlbeautifier.rs | 4 +- mdsf/src/tools/htmlhint.rs | 2 +- mdsf/src/tools/imba_fmt.rs | 2 +- mdsf/src/tools/inko_fmt.rs | 2 +- mdsf/src/tools/isort.rs | 4 +- mdsf/src/tools/joker.rs | 2 +- mdsf/src/tools/js_beautify.rs | 2 +- mdsf/src/tools/json_5_format.rs | 2 +- mdsf/src/tools/jsona_format.rs | 2 +- mdsf/src/tools/jsona_lint.rs | 2 +- mdsf/src/tools/jsonlint.rs | 2 +- mdsf/src/tools/jsonnet_lint.rs | 2 +- mdsf/src/tools/jsonnetfmt.rs | 2 +- mdsf/src/tools/juliaformatter_jl.rs | 4 +- mdsf/src/tools/just.rs | 4 +- mdsf/src/tools/kcl_fmt.rs | 4 +- mdsf/src/tools/kcl_lint.rs | 2 +- mdsf/src/tools/kdlfmt.rs | 2 +- mdsf/src/tools/kdoc_formatter.rs | 2 +- mdsf/src/tools/ktfmt.rs | 4 +- mdsf/src/tools/ktlint.rs | 4 +- mdsf/src/tools/kulala_fmt.rs | 2 +- mdsf/src/tools/leptosfmt.rs | 2 +- mdsf/src/tools/liquidsoap_prettier.rs | 2 +- mdsf/src/tools/luacheck.rs | 2 +- mdsf/src/tools/luaformatter.rs | 4 +- mdsf/src/tools/mado_check.rs | 4 +- mdsf/src/tools/markdownfmt.rs | 4 +- mdsf/src/tools/markdownlint.rs | 4 +- mdsf/src/tools/markdownlint_cli_2.rs | 4 +- mdsf/src/tools/markuplint.rs | 2 +- mdsf/src/tools/mdformat.rs | 2 +- mdsf/src/tools/mdslw.rs | 2 +- mdsf/src/tools/meson_fmt.rs | 2 +- mdsf/src/tools/misspell.rs | 2 +- mdsf/src/tools/mix_format.rs | 4 +- mdsf/src/tools/mod.rs | 1722 ++++------------------ mdsf/src/tools/mojo_format.rs | 2 +- mdsf/src/tools/mypy.rs | 2 +- mdsf/src/tools/nginxbeautifier.rs | 2 +- mdsf/src/tools/nginxfmt.rs | 2 +- mdsf/src/tools/nickel_format.rs | 2 +- mdsf/src/tools/nimpretty.rs | 4 +- mdsf/src/tools/nixfmt.rs | 4 +- mdsf/src/tools/nixpkgs_fmt.rs | 4 +- mdsf/src/tools/nomad_fmt.rs | 2 +- mdsf/src/tools/nph.rs | 2 +- mdsf/src/tools/npm_groovy_lint.rs | 4 +- mdsf/src/tools/nufmt.rs | 2 +- mdsf/src/tools/ocamlformat.rs | 4 +- mdsf/src/tools/ocp_indent.rs | 4 +- mdsf/src/tools/odinfmt.rs | 2 +- mdsf/src/tools/oelint_adv.rs | 2 +- mdsf/src/tools/opa_fmt.rs | 2 +- mdsf/src/tools/ormolu.rs | 4 +- mdsf/src/tools/oxlint.rs | 2 +- mdsf/src/tools/packer_fix.rs | 2 +- mdsf/src/tools/packer_fmt.rs | 2 +- mdsf/src/tools/perltidy.rs | 2 +- mdsf/src/tools/pg_format.rs | 2 +- mdsf/src/tools/php_cs_fixer_fix.rs | 2 +- mdsf/src/tools/phpcbf.rs | 2 +- mdsf/src/tools/phpinsights_fix.rs | 2 +- mdsf/src/tools/pint.rs | 2 +- mdsf/src/tools/prettier.rs | 6 +- mdsf/src/tools/pretty_php.rs | 2 +- mdsf/src/tools/prettypst.rs | 2 +- mdsf/src/tools/prisma_format.rs | 4 +- mdsf/src/tools/protolint.rs | 2 +- mdsf/src/tools/ptop.rs | 2 +- mdsf/src/tools/puppet_lint.rs | 2 +- mdsf/src/tools/purs_tidy.rs | 4 +- mdsf/src/tools/purty.rs | 2 +- mdsf/src/tools/pycln.rs | 4 +- mdsf/src/tools/pycodestyle.rs | 2 +- mdsf/src/tools/pyink.rs | 4 +- mdsf/src/tools/pyment.rs | 2 +- mdsf/src/tools/qmlfmt.rs | 2 +- mdsf/src/tools/quick_lint_js.rs | 2 +- mdsf/src/tools/raco_fmt.rs | 2 +- mdsf/src/tools/refmt.rs | 2 +- mdsf/src/tools/reformat_gherkin.rs | 2 +- mdsf/src/tools/regal_fix.rs | 2 +- mdsf/src/tools/regal_lint.rs | 2 +- mdsf/src/tools/reorder_python_imports.rs | 2 +- mdsf/src/tools/rescript_format.rs | 4 +- mdsf/src/tools/roc_format.rs | 4 +- mdsf/src/tools/rstfmt.rs | 2 +- mdsf/src/tools/rubocop.rs | 4 +- mdsf/src/tools/rubyfmt.rs | 4 +- mdsf/src/tools/ruff_check.rs | 2 +- mdsf/src/tools/ruff_format.rs | 4 +- mdsf/src/tools/rufo.rs | 4 +- mdsf/src/tools/rune_fmt.rs | 2 +- mdsf/src/tools/rustfmt.rs | 4 +- mdsf/src/tools/rustywind.rs | 2 +- mdsf/src/tools/salt_lint.rs | 2 +- mdsf/src/tools/scalafmt.rs | 4 +- mdsf/src/tools/scalariform.rs | 2 +- mdsf/src/tools/selene.rs | 2 +- mdsf/src/tools/shellcheck.rs | 2 +- mdsf/src/tools/shellharden.rs | 2 +- mdsf/src/tools/shfmt.rs | 8 +- mdsf/src/tools/sleek.rs | 2 +- mdsf/src/tools/smlfmt.rs | 2 +- mdsf/src/tools/snakefmt.rs | 2 +- mdsf/src/tools/solhint.rs | 2 +- mdsf/src/tools/sql_formatter.rs | 4 +- mdsf/src/tools/sqlfluff_fix.rs | 2 +- mdsf/src/tools/sqlfluff_format.rs | 4 +- mdsf/src/tools/sqlfmt.rs | 2 +- mdsf/src/tools/sqruff.rs | 2 +- mdsf/src/tools/standardjs.rs | 2 +- mdsf/src/tools/standardrb.rs | 4 +- mdsf/src/tools/statix_check.rs | 2 +- mdsf/src/tools/statix_fix.rs | 2 +- mdsf/src/tools/stylefmt.rs | 6 +- mdsf/src/tools/stylelint.rs | 2 +- mdsf/src/tools/stylish_haskell.rs | 4 +- mdsf/src/tools/stylua.rs | 4 +- mdsf/src/tools/superhtml_fmt.rs | 4 +- mdsf/src/tools/swift_format.rs | 4 +- mdsf/src/tools/swiftformat.rs | 4 +- mdsf/src/tools/taplo.rs | 4 +- mdsf/src/tools/templ_fmt.rs | 2 +- mdsf/src/tools/terraform_fmt.rs | 4 +- mdsf/src/tools/terragrunt_hclfmt.rs | 2 +- mdsf/src/tools/tex_fmt.rs | 2 +- mdsf/src/tools/tlint_format.rs | 2 +- mdsf/src/tools/tofu_fmt.rs | 4 +- mdsf/src/tools/toml_sort.rs | 2 +- mdsf/src/tools/topiary.rs | 4 +- mdsf/src/tools/ts_standard.rs | 2 +- mdsf/src/tools/tsqllint.rs | 2 +- mdsf/src/tools/twig_cs_fixer_lint.rs | 2 +- mdsf/src/tools/typos.rs | 4 +- mdsf/src/tools/typstfmt.rs | 2 +- mdsf/src/tools/typstyle.rs | 2 +- mdsf/src/tools/ufmt.rs | 2 +- mdsf/src/tools/uiua_fmt.rs | 2 +- mdsf/src/tools/unimport.rs | 2 +- mdsf/src/tools/usort.rs | 4 +- mdsf/src/tools/v_fmt.rs | 2 +- mdsf/src/tools/vacuum_lint.rs | 2 +- mdsf/src/tools/veryl_fmt.rs | 4 +- mdsf/src/tools/vhdl_style_guide.rs | 2 +- mdsf/src/tools/wa_fmt.rs | 2 +- mdsf/src/tools/wfindent.rs | 2 +- mdsf/src/tools/xmlformat.rs | 4 +- mdsf/src/tools/xmllint.rs | 4 +- mdsf/src/tools/xo.rs | 2 +- mdsf/src/tools/yamlfix.rs | 4 +- mdsf/src/tools/yamlfmt.rs | 4 +- mdsf/src/tools/yapf.rs | 4 +- mdsf/src/tools/yew_fmt.rs | 4 +- mdsf/src/tools/zig_fmt.rs | 4 +- mdsf/src/tools/ziggy_fmt.rs | 2 +- mdsf/src/tools/zprint.rs | 4 +- 256 files changed, 641 insertions(+), 1826 deletions(-) diff --git a/codegen/src/tools.rs b/codegen/src/tools.rs index b9d4541c..8434bae3 100644 --- a/codegen/src/tools.rs +++ b/codegen/src/tools.rs @@ -165,7 +165,7 @@ impl Tool { {INDENT}{INDENT}{INDENT}crate::execution::setup_snippet(input, &file_ext).expect(\"it to create a snippet file\"); {INDENT}{INDENT}let result = -{INDENT}{INDENT}{INDENT}crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) +{INDENT}{INDENT}{INDENT}crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) {INDENT}{INDENT}{INDENT}{INDENT}.expect(\"it to be successful\") {INDENT}{INDENT}{INDENT}{INDENT}.1 {INDENT}{INDENT}{INDENT}{INDENT}.expect(\"it to be some\"); @@ -272,7 +272,7 @@ impl Tool { use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( {INDENT}mut cmd: std::process::Command, {INDENT}file_path: &std::path::Path, ) -> std::process::Command {{ @@ -374,7 +374,7 @@ impl AsRef for Tooling { )); format_snippet_values.insert(format!( - "{INDENT}{INDENT}{INDENT}Self::{enum_value} => run_tools(&{module_name}::COMMANDS, snippet_path, {module_name}::set_arguments, timeout)," + "{INDENT}{INDENT}{INDENT}Self::{enum_value} => (&{module_name}::COMMANDS, {module_name}::set_args)," )); as_ref_values.insert(format!( @@ -403,8 +403,6 @@ impl AsRef for Tooling { let mod_file_contents = format!( "{GENERATED_FILE_COMMENT} -use crate::execution::run_tools; - {} #[derive(serde::Serialize, serde::Deserialize, Hash, Clone, Copy)] @@ -422,9 +420,14 @@ impl Tooling {{ {INDENT}{INDENT}snippet_path: &std::path::Path, {INDENT}{INDENT}timeout: u64, {INDENT}) -> Result<(bool, Option), crate::error::MdsfError> {{ -{INDENT}{INDENT}match self {{ +{INDENT}{INDENT}let (commands, set_args_fn): ( +{INDENT}{INDENT}{INDENT}&[crate::runners::CommandType], +{INDENT}{INDENT}{INDENT}fn(std::process::Command, &std::path::Path) -> std::process::Command, +{INDENT}{INDENT}) = match self {{ {} -{INDENT}{INDENT}}} +{INDENT}{INDENT}}}; + +{INDENT}{INDENT}crate::execution::run_tools(commands, snippet_path, set_args_fn, timeout) {INDENT}}} }} diff --git a/mdsf/src/tools/actionlint.rs b/mdsf/src/tools/actionlint.rs index bb13d754..6efc7e58 100644 --- a/mdsf/src/tools/actionlint.rs +++ b/mdsf/src/tools/actionlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -42,7 +42,7 @@ jobs: crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/alejandra.rs b/mdsf/src/tools/alejandra.rs index 7731243c..cbcc18d5 100644 --- a/mdsf/src/tools/alejandra.rs +++ b/mdsf/src/tools/alejandra.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -84,7 +84,7 @@ buildPythonPackage rec { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/ameba.rs b/mdsf/src/tools/ameba.rs index f5adcd37..01aa56a6 100644 --- a/mdsf/src/tools/ameba.rs +++ b/mdsf/src/tools/ameba.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/ansible_lint.rs b/mdsf/src/tools/ansible_lint.rs index 1018cf2e..35a97966 100644 --- a/mdsf/src/tools/ansible_lint.rs +++ b/mdsf/src/tools/ansible_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/asmfmt.rs b/mdsf/src/tools/asmfmt.rs index 149936b1..90b2a896 100644 --- a/mdsf/src/tools/asmfmt.rs +++ b/mdsf/src/tools/asmfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/astyle.rs b/mdsf/src/tools/astyle.rs index 724db8dc..80457cd1 100644 --- a/mdsf/src/tools/astyle.rs +++ b/mdsf/src/tools/astyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/auto_optional.rs b/mdsf/src/tools/auto_optional.rs index 20af2e16..5377edf9 100644 --- a/mdsf/src/tools/auto_optional.rs +++ b/mdsf/src/tools/auto_optional.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -33,7 +33,7 @@ def foo(bar: Optional[str] = None): crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/autocorrect.rs b/mdsf/src/tools/autocorrect.rs index b2287561..1756f67c 100644 --- a/mdsf/src/tools/autocorrect.rs +++ b/mdsf/src/tools/autocorrect.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/autoflake.rs b/mdsf/src/tools/autoflake.rs index 7af31090..834d9344 100644 --- a/mdsf/src/tools/autoflake.rs +++ b/mdsf/src/tools/autoflake.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -58,7 +58,7 @@ def foo(): crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/autopep_8.rs b/mdsf/src/tools/autopep_8.rs index 7c99a478..b347e320 100644 --- a/mdsf/src/tools/autopep_8.rs +++ b/mdsf/src/tools/autopep_8.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -30,7 +30,7 @@ mod test_autopep_8 { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/beancount_black.rs b/mdsf/src/tools/beancount_black.rs index 56eae756..e54c243b 100644 --- a/mdsf/src/tools/beancount_black.rs +++ b/mdsf/src/tools/beancount_black.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/beautysh.rs b/mdsf/src/tools/beautysh.rs index 7216fbc6..17d81217 100644 --- a/mdsf/src/tools/beautysh.rs +++ b/mdsf/src/tools/beautysh.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -38,7 +38,7 @@ add() { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -68,7 +68,7 @@ add() { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/bibtex_tidy.rs b/mdsf/src/tools/bibtex_tidy.rs index 10f2151d..64b5b217 100644 --- a/mdsf/src/tools/bibtex_tidy.rs +++ b/mdsf/src/tools/bibtex_tidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/bicep_format.rs b/mdsf/src/tools/bicep_format.rs index 31b45686..627765f5 100644 --- a/mdsf/src/tools/bicep_format.rs +++ b/mdsf/src/tools/bicep_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/biome_check.rs b/mdsf/src/tools/biome_check.rs index 583be173..d84d82f5 100644 --- a/mdsf/src/tools/biome_check.rs +++ b/mdsf/src/tools/biome_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/biome_format.rs b/mdsf/src/tools/biome_format.rs index 52ba13c1..36bbd5b6 100644 --- a/mdsf/src/tools/biome_format.rs +++ b/mdsf/src/tools/biome_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -47,7 +47,7 @@ mod test_biome_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -77,7 +77,7 @@ mod test_biome_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -109,7 +109,7 @@ number> crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/biome_lint.rs b/mdsf/src/tools/biome_lint.rs index 14f7d55d..aa376405 100644 --- a/mdsf/src/tools/biome_lint.rs +++ b/mdsf/src/tools/biome_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/black.rs b/mdsf/src/tools/black.rs index 7ca79bef..8150a0e1 100644 --- a/mdsf/src/tools/black.rs +++ b/mdsf/src/tools/black.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ mod test_black { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/blade_formatter.rs b/mdsf/src/tools/blade_formatter.rs index 628104e0..702ab6e2 100644 --- a/mdsf/src/tools/blade_formatter.rs +++ b/mdsf/src/tools/blade_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -92,7 +92,7 @@ mod test_blade_formatter { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/blue.rs b/mdsf/src/tools/blue.rs index 540154c7..bdfbca20 100644 --- a/mdsf/src/tools/blue.rs +++ b/mdsf/src/tools/blue.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ mod test_blue { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/bpfmt.rs b/mdsf/src/tools/bpfmt.rs index 99577113..8646d6ec 100644 --- a/mdsf/src/tools/bpfmt.rs +++ b/mdsf/src/tools/bpfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/brittany.rs b/mdsf/src/tools/brittany.rs index 3063e5ba..a4e33d5c 100644 --- a/mdsf/src/tools/brittany.rs +++ b/mdsf/src/tools/brittany.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/brunette.rs b/mdsf/src/tools/brunette.rs index ec20e22f..2590ccff 100644 --- a/mdsf/src/tools/brunette.rs +++ b/mdsf/src/tools/brunette.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ mod test_brunette { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/bsfmt.rs b/mdsf/src/tools/bsfmt.rs index 8e1d31b9..fc415f9f 100644 --- a/mdsf/src/tools/bsfmt.rs +++ b/mdsf/src/tools/bsfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/bslint.rs b/mdsf/src/tools/bslint.rs index aa9f725b..b70ec36a 100644 --- a/mdsf/src/tools/bslint.rs +++ b/mdsf/src/tools/bslint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/buf_format.rs b/mdsf/src/tools/buf_format.rs index 188ad255..0cdc009d 100644 --- a/mdsf/src/tools/buf_format.rs +++ b/mdsf/src/tools/buf_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -39,7 +39,7 @@ mod test_buf_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/buildifier.rs b/mdsf/src/tools/buildifier.rs index 8acee40c..33976abf 100644 --- a/mdsf/src/tools/buildifier.rs +++ b/mdsf/src/tools/buildifier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/cabal_fmt.rs b/mdsf/src/tools/cabal_fmt.rs index fd7a8728..8bd073e7 100644 --- a/mdsf/src/tools/cabal_fmt.rs +++ b/mdsf/src/tools/cabal_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/cabal_format.rs b/mdsf/src/tools/cabal_format.rs index a0ee768d..c420e5dd 100644 --- a/mdsf/src/tools/cabal_format.rs +++ b/mdsf/src/tools/cabal_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -58,7 +58,7 @@ executable msdf crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/cabal_prettify.rs b/mdsf/src/tools/cabal_prettify.rs index 9872f76f..1dd25930 100644 --- a/mdsf/src/tools/cabal_prettify.rs +++ b/mdsf/src/tools/cabal_prettify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/caddy_fmt.rs b/mdsf/src/tools/caddy_fmt.rs index 03c22bd0..3b78373d 100644 --- a/mdsf/src/tools/caddy_fmt.rs +++ b/mdsf/src/tools/caddy_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/caramel_fmt.rs b/mdsf/src/tools/caramel_fmt.rs index 88163ba6..762ace78 100644 --- a/mdsf/src/tools/caramel_fmt.rs +++ b/mdsf/src/tools/caramel_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/clang_format.rs b/mdsf/src/tools/clang_format.rs index 3770812a..2a878a33 100644 --- a/mdsf/src/tools/clang_format.rs +++ b/mdsf/src/tools/clang_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -39,7 +39,7 @@ mod test_clang_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -62,7 +62,7 @@ mod test_clang_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -88,7 +88,7 @@ mod test_clang_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -114,7 +114,7 @@ mod test_clang_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -140,7 +140,7 @@ mod test_clang_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -174,7 +174,7 @@ class Adder { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -205,7 +205,7 @@ class Adder { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -231,7 +231,7 @@ class Adder { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/clang_tidy.rs b/mdsf/src/tools/clang_tidy.rs index c99dc866..89776c04 100644 --- a/mdsf/src/tools/clang_tidy.rs +++ b/mdsf/src/tools/clang_tidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/cljfmt_fix.rs b/mdsf/src/tools/cljfmt_fix.rs index f648c182..60db868d 100644 --- a/mdsf/src/tools/cljfmt_fix.rs +++ b/mdsf/src/tools/cljfmt_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/cljstyle.rs b/mdsf/src/tools/cljstyle.rs index 7fa82870..5e444232 100644 --- a/mdsf/src/tools/cljstyle.rs +++ b/mdsf/src/tools/cljstyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -61,7 +61,7 @@ mod test_cljstyle { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/cmake_format.rs b/mdsf/src/tools/cmake_format.rs index 53db6ba4..21d385be 100644 --- a/mdsf/src/tools/cmake_format.rs +++ b/mdsf/src/tools/cmake_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/codespell.rs b/mdsf/src/tools/codespell.rs index 70dfa585..9059756e 100644 --- a/mdsf/src/tools/codespell.rs +++ b/mdsf/src/tools/codespell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/crlfmt.rs b/mdsf/src/tools/crlfmt.rs index d175d8a7..3d6e51c8 100644 --- a/mdsf/src/tools/crlfmt.rs +++ b/mdsf/src/tools/crlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/crystal_format.rs b/mdsf/src/tools/crystal_format.rs index 5f19eba8..9ee36815 100644 --- a/mdsf/src/tools/crystal_format.rs +++ b/mdsf/src/tools/crystal_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -33,7 +33,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/csharpier.rs b/mdsf/src/tools/csharpier.rs index 3de1db7d..65fdc8b9 100644 --- a/mdsf/src/tools/csharpier.rs +++ b/mdsf/src/tools/csharpier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -47,7 +47,7 @@ mod test_csharpier { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/css_beautify.rs b/mdsf/src/tools/css_beautify.rs index 9ca7bbf9..fc77e647 100644 --- a/mdsf/src/tools/css_beautify.rs +++ b/mdsf/src/tools/css_beautify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -42,7 +42,7 @@ p { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/csscomb.rs b/mdsf/src/tools/csscomb.rs index b020957e..402259ac 100644 --- a/mdsf/src/tools/csscomb.rs +++ b/mdsf/src/tools/csscomb.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -42,7 +42,7 @@ p crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/csslint.rs b/mdsf/src/tools/csslint.rs index 62dce435..cb88b9f8 100644 --- a/mdsf/src/tools/csslint.rs +++ b/mdsf/src/tools/csslint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/curlylint.rs b/mdsf/src/tools/curlylint.rs index 5d45def2..8d918596 100644 --- a/mdsf/src/tools/curlylint.rs +++ b/mdsf/src/tools/curlylint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/d_2_fmt.rs b/mdsf/src/tools/d_2_fmt.rs index b5d41a54..4b873441 100644 --- a/mdsf/src/tools/d_2_fmt.rs +++ b/mdsf/src/tools/d_2_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dart_fix.rs b/mdsf/src/tools/dart_fix.rs index ba9472ab..b57d9776 100644 --- a/mdsf/src/tools/dart_fix.rs +++ b/mdsf/src/tools/dart_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dart_format.rs b/mdsf/src/tools/dart_format.rs index 69d017f8..8f833d63 100644 --- a/mdsf/src/tools/dart_format.rs +++ b/mdsf/src/tools/dart_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ mod test_dart_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/dcm_fix.rs b/mdsf/src/tools/dcm_fix.rs index 52bbcee3..1cbfb78c 100644 --- a/mdsf/src/tools/dcm_fix.rs +++ b/mdsf/src/tools/dcm_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dcm_format.rs b/mdsf/src/tools/dcm_format.rs index 83591ba7..94f8bff7 100644 --- a/mdsf/src/tools/dcm_format.rs +++ b/mdsf/src/tools/dcm_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/deadnix.rs b/mdsf/src/tools/deadnix.rs index 4df9ef91..998e6cc0 100644 --- a/mdsf/src/tools/deadnix.rs +++ b/mdsf/src/tools/deadnix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/deno_fmt.rs b/mdsf/src/tools/deno_fmt.rs index 4a966c3f..e295b803 100644 --- a/mdsf/src/tools/deno_fmt.rs +++ b/mdsf/src/tools/deno_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -38,7 +38,7 @@ mod test_deno_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -67,7 +67,7 @@ mod test_deno_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -105,7 +105,7 @@ mod test_deno_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/deno_lint.rs b/mdsf/src/tools/deno_lint.rs index b424c565..62e47688 100644 --- a/mdsf/src/tools/deno_lint.rs +++ b/mdsf/src/tools/deno_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dfmt.rs b/mdsf/src/tools/dfmt.rs index b35da38e..04703e1d 100644 --- a/mdsf/src/tools/dfmt.rs +++ b/mdsf/src/tools/dfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dhall.rs b/mdsf/src/tools/dhall.rs index 8518738e..e8a8a5e8 100644 --- a/mdsf/src/tools/dhall.rs +++ b/mdsf/src/tools/dhall.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/djade.rs b/mdsf/src/tools/djade.rs index 13ca5c8b..aa87e068 100644 --- a/mdsf/src/tools/djade.rs +++ b/mdsf/src/tools/djade.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/djlint.rs b/mdsf/src/tools/djlint.rs index 1f756723..bd4fcb37 100644 --- a/mdsf/src/tools/djlint.rs +++ b/mdsf/src/tools/djlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/docformatter.rs b/mdsf/src/tools/docformatter.rs index 3edb5a84..5f53b90a 100644 --- a/mdsf/src/tools/docformatter.rs +++ b/mdsf/src/tools/docformatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dockfmt.rs b/mdsf/src/tools/dockfmt.rs index 890ef164..0306c803 100644 --- a/mdsf/src/tools/dockfmt.rs +++ b/mdsf/src/tools/dockfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/docstrfmt.rs b/mdsf/src/tools/docstrfmt.rs index b543c342..e74bc66f 100644 --- a/mdsf/src/tools/docstrfmt.rs +++ b/mdsf/src/tools/docstrfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/doctoc.rs b/mdsf/src/tools/doctoc.rs index b4375c7c..2db4f61d 100644 --- a/mdsf/src/tools/doctoc.rs +++ b/mdsf/src/tools/doctoc.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dotenv_linter_fix.rs b/mdsf/src/tools/dotenv_linter_fix.rs index ec19f899..6a00c20f 100644 --- a/mdsf/src/tools/dotenv_linter_fix.rs +++ b/mdsf/src/tools/dotenv_linter_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/dprint_fmt.rs b/mdsf/src/tools/dprint_fmt.rs index 8f9f3d85..8bb725d8 100644 --- a/mdsf/src/tools/dprint_fmt.rs +++ b/mdsf/src/tools/dprint_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/easy_coding_standard.rs b/mdsf/src/tools/easy_coding_standard.rs index 0387a7f0..da1193f9 100644 --- a/mdsf/src/tools/easy_coding_standard.rs +++ b/mdsf/src/tools/easy_coding_standard.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/efmt.rs b/mdsf/src/tools/efmt.rs index 973f743a..6bdfaae5 100644 --- a/mdsf/src/tools/efmt.rs +++ b/mdsf/src/tools/efmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -33,7 +33,7 @@ case Erlang of movie->[hello(mike,joe,robert),credits]; language->formatting_arg crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/elm_format.rs b/mdsf/src/tools/elm_format.rs index b99dc9e8..199b34fa 100644 --- a/mdsf/src/tools/elm_format.rs +++ b/mdsf/src/tools/elm_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -48,7 +48,7 @@ main = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/erb_formatter.rs b/mdsf/src/tools/erb_formatter.rs index f49cabcc..fa12d9d3 100644 --- a/mdsf/src/tools/erb_formatter.rs +++ b/mdsf/src/tools/erb_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/erlfmt.rs b/mdsf/src/tools/erlfmt.rs index 47dab6a7..02f58ade 100644 --- a/mdsf/src/tools/erlfmt.rs +++ b/mdsf/src/tools/erlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -35,7 +35,7 @@ case Erlang of movie->[hello(mike,joe,robert),credits]; language->formatting_arg crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/eslint.rs b/mdsf/src/tools/eslint.rs index fdee468d..2df819f7 100644 --- a/mdsf/src/tools/eslint.rs +++ b/mdsf/src/tools/eslint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/fantomas.rs b/mdsf/src/tools/fantomas.rs index 855da681..cbfa995d 100644 --- a/mdsf/src/tools/fantomas.rs +++ b/mdsf/src/tools/fantomas.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ let add a b = a + b crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/fish_indent.rs b/mdsf/src/tools/fish_indent.rs index 57092a5d..07d2e502 100644 --- a/mdsf/src/tools/fish_indent.rs +++ b/mdsf/src/tools/fish_indent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/fixjson.rs b/mdsf/src/tools/fixjson.rs index 3fadd6a5..296822ca 100644 --- a/mdsf/src/tools/fixjson.rs +++ b/mdsf/src/tools/fixjson.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/floskell.rs b/mdsf/src/tools/floskell.rs index 4c8bce4c..b24a5749 100644 --- a/mdsf/src/tools/floskell.rs +++ b/mdsf/src/tools/floskell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/fnlfmt.rs b/mdsf/src/tools/fnlfmt.rs index d8d9019f..94b09b95 100644 --- a/mdsf/src/tools/fnlfmt.rs +++ b/mdsf/src/tools/fnlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/forge_fmt.rs b/mdsf/src/tools/forge_fmt.rs index ba84be6c..b37f79af 100644 --- a/mdsf/src/tools/forge_fmt.rs +++ b/mdsf/src/tools/forge_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/fourmolu.rs b/mdsf/src/tools/fourmolu.rs index 3b193d79..fb84ed4c 100644 --- a/mdsf/src/tools/fourmolu.rs +++ b/mdsf/src/tools/fourmolu.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -36,7 +36,7 @@ addNumbers a b = do crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/fprettify.rs b/mdsf/src/tools/fprettify.rs index 3d7c89f6..b00b821b 100644 --- a/mdsf/src/tools/fprettify.rs +++ b/mdsf/src/tools/fprettify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -53,7 +53,7 @@ end program crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/futhark_fmt.rs b/mdsf/src/tools/futhark_fmt.rs index 9b6cdfd0..9825ae05 100644 --- a/mdsf/src/tools/futhark_fmt.rs +++ b/mdsf/src/tools/futhark_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/gci.rs b/mdsf/src/tools/gci.rs index a50f7dbb..7f0db374 100644 --- a/mdsf/src/tools/gci.rs +++ b/mdsf/src/tools/gci.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/gdformat.rs b/mdsf/src/tools/gdformat.rs index f9794639..bd8101af 100644 --- a/mdsf/src/tools/gdformat.rs +++ b/mdsf/src/tools/gdformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/gersemi.rs b/mdsf/src/tools/gersemi.rs index 989c9f26..fdfdfeda 100644 --- a/mdsf/src/tools/gersemi.rs +++ b/mdsf/src/tools/gersemi.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/gleam_format.rs b/mdsf/src/tools/gleam_format.rs index 057e0919..27315ed9 100644 --- a/mdsf/src/tools/gleam_format.rs +++ b/mdsf/src/tools/gleam_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -32,7 +32,7 @@ mod test_gleam_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/gluon_fmt.rs b/mdsf/src/tools/gluon_fmt.rs index c858028c..b5b97a3b 100644 --- a/mdsf/src/tools/gluon_fmt.rs +++ b/mdsf/src/tools/gluon_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/gofmt.rs b/mdsf/src/tools/gofmt.rs index 7e5eab7b..edc97f41 100644 --- a/mdsf/src/tools/gofmt.rs +++ b/mdsf/src/tools/gofmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -40,7 +40,7 @@ func add(a int, b int) int { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/gofumpt.rs b/mdsf/src/tools/gofumpt.rs index bc6810c0..0a99616b 100644 --- a/mdsf/src/tools/gofumpt.rs +++ b/mdsf/src/tools/gofumpt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -40,7 +40,7 @@ func add(a int, b int) int { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/goimports.rs b/mdsf/src/tools/goimports.rs index 9671784c..10f7072c 100644 --- a/mdsf/src/tools/goimports.rs +++ b/mdsf/src/tools/goimports.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -52,7 +52,7 @@ func add(a int, b int) int { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/goimports_reviser.rs b/mdsf/src/tools/goimports_reviser.rs index 71def58f..c0cdee58 100644 --- a/mdsf/src/tools/goimports_reviser.rs +++ b/mdsf/src/tools/goimports_reviser.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/golines.rs b/mdsf/src/tools/golines.rs index b0813b63..755f91fa 100644 --- a/mdsf/src/tools/golines.rs +++ b/mdsf/src/tools/golines.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -52,7 +52,7 @@ func add(a int, b int) int { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/google_java_format.rs b/mdsf/src/tools/google_java_format.rs index 513c9317..5fb7393b 100644 --- a/mdsf/src/tools/google_java_format.rs +++ b/mdsf/src/tools/google_java_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -40,7 +40,7 @@ mod test_google_java_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/grain_format.rs b/mdsf/src/tools/grain_format.rs index 76ef23e9..d2ffc334 100644 --- a/mdsf/src/tools/grain_format.rs +++ b/mdsf/src/tools/grain_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ print("Hello, world!") crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/hadolint.rs b/mdsf/src/tools/hadolint.rs index 391a8da7..c087f1a9 100644 --- a/mdsf/src/tools/hadolint.rs +++ b/mdsf/src/tools/hadolint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/haml_lint.rs b/mdsf/src/tools/haml_lint.rs index 5494ce50..40491c5e 100644 --- a/mdsf/src/tools/haml_lint.rs +++ b/mdsf/src/tools/haml_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/hclfmt.rs b/mdsf/src/tools/hclfmt.rs index e9476547..84934987 100644 --- a/mdsf/src/tools/hclfmt.rs +++ b/mdsf/src/tools/hclfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/hfmt.rs b/mdsf/src/tools/hfmt.rs index 1508f416..911d1760 100644 --- a/mdsf/src/tools/hfmt.rs +++ b/mdsf/src/tools/hfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/hindent.rs b/mdsf/src/tools/hindent.rs index 73c4d282..5aea42e9 100644 --- a/mdsf/src/tools/hindent.rs +++ b/mdsf/src/tools/hindent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -35,7 +35,7 @@ addNumbers a b = do crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/hlint.rs b/mdsf/src/tools/hlint.rs index 1c28ae68..1b7415e9 100644 --- a/mdsf/src/tools/hlint.rs +++ b/mdsf/src/tools/hlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/html_beautify.rs b/mdsf/src/tools/html_beautify.rs index e368680b..357e91fd 100644 --- a/mdsf/src/tools/html_beautify.rs +++ b/mdsf/src/tools/html_beautify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -44,7 +44,7 @@ mod test_html_beautify { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/htmlbeautifier.rs b/mdsf/src/tools/htmlbeautifier.rs index 700a0765..d30b680d 100644 --- a/mdsf/src/tools/htmlbeautifier.rs +++ b/mdsf/src/tools/htmlbeautifier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ mod test_htmlbeautifier { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/htmlhint.rs b/mdsf/src/tools/htmlhint.rs index 6383726a..f565833c 100644 --- a/mdsf/src/tools/htmlhint.rs +++ b/mdsf/src/tools/htmlhint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/imba_fmt.rs b/mdsf/src/tools/imba_fmt.rs index 8a4b0db2..0c9a300d 100644 --- a/mdsf/src/tools/imba_fmt.rs +++ b/mdsf/src/tools/imba_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/inko_fmt.rs b/mdsf/src/tools/inko_fmt.rs index 1ba8f2db..7eec9472 100644 --- a/mdsf/src/tools/inko_fmt.rs +++ b/mdsf/src/tools/inko_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/isort.rs b/mdsf/src/tools/isort.rs index d47abf69..911436fe 100644 --- a/mdsf/src/tools/isort.rs +++ b/mdsf/src/tools/isort.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -45,7 +45,7 @@ def add(a: int, b: int) -> int: crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/joker.rs b/mdsf/src/tools/joker.rs index 5f60224f..3159667a 100644 --- a/mdsf/src/tools/joker.rs +++ b/mdsf/src/tools/joker.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/js_beautify.rs b/mdsf/src/tools/js_beautify.rs index 6bd9caf7..f6db53d0 100644 --- a/mdsf/src/tools/js_beautify.rs +++ b/mdsf/src/tools/js_beautify.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/json_5_format.rs b/mdsf/src/tools/json_5_format.rs index 19f5f83a..404e6d94 100644 --- a/mdsf/src/tools/json_5_format.rs +++ b/mdsf/src/tools/json_5_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/jsona_format.rs b/mdsf/src/tools/jsona_format.rs index 4ba7d8cd..45b3192b 100644 --- a/mdsf/src/tools/jsona_format.rs +++ b/mdsf/src/tools/jsona_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/jsona_lint.rs b/mdsf/src/tools/jsona_lint.rs index e814b6ee..51626d6e 100644 --- a/mdsf/src/tools/jsona_lint.rs +++ b/mdsf/src/tools/jsona_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/jsonlint.rs b/mdsf/src/tools/jsonlint.rs index f9b4d657..977372aa 100644 --- a/mdsf/src/tools/jsonlint.rs +++ b/mdsf/src/tools/jsonlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/jsonnet_lint.rs b/mdsf/src/tools/jsonnet_lint.rs index 2e86a69b..9c79c46a 100644 --- a/mdsf/src/tools/jsonnet_lint.rs +++ b/mdsf/src/tools/jsonnet_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/jsonnetfmt.rs b/mdsf/src/tools/jsonnetfmt.rs index e059887c..12ff25cc 100644 --- a/mdsf/src/tools/jsonnetfmt.rs +++ b/mdsf/src/tools/jsonnetfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/juliaformatter_jl.rs b/mdsf/src/tools/juliaformatter_jl.rs index a0d72265..e17a99d1 100644 --- a/mdsf/src/tools/juliaformatter_jl.rs +++ b/mdsf/src/tools/juliaformatter_jl.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/just.rs b/mdsf/src/tools/just.rs index 174d79f4..7da41dc7 100644 --- a/mdsf/src/tools/just.rs +++ b/mdsf/src/tools/just.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -41,7 +41,7 @@ mod test_just { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/kcl_fmt.rs b/mdsf/src/tools/kcl_fmt.rs index d5e574f1..2f2fac1a 100644 --- a/mdsf/src/tools/kcl_fmt.rs +++ b/mdsf/src/tools/kcl_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -61,7 +61,7 @@ spec = { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/kcl_lint.rs b/mdsf/src/tools/kcl_lint.rs index 02c094b5..d6b68abd 100644 --- a/mdsf/src/tools/kcl_lint.rs +++ b/mdsf/src/tools/kcl_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/kdlfmt.rs b/mdsf/src/tools/kdlfmt.rs index c6d49cb9..d755ab61 100644 --- a/mdsf/src/tools/kdlfmt.rs +++ b/mdsf/src/tools/kdlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/kdoc_formatter.rs b/mdsf/src/tools/kdoc_formatter.rs index 050e2025..3b49129c 100644 --- a/mdsf/src/tools/kdoc_formatter.rs +++ b/mdsf/src/tools/kdoc_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/ktfmt.rs b/mdsf/src/tools/ktfmt.rs index d8ebd770..ff5377a2 100644 --- a/mdsf/src/tools/ktfmt.rs +++ b/mdsf/src/tools/ktfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -36,7 +36,7 @@ mod test_ktfmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/ktlint.rs b/mdsf/src/tools/ktlint.rs index 5067242a..96fad673 100644 --- a/mdsf/src/tools/ktlint.rs +++ b/mdsf/src/tools/ktlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -41,7 +41,7 @@ fun add( crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/kulala_fmt.rs b/mdsf/src/tools/kulala_fmt.rs index fb4bec07..d77e56f0 100644 --- a/mdsf/src/tools/kulala_fmt.rs +++ b/mdsf/src/tools/kulala_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/leptosfmt.rs b/mdsf/src/tools/leptosfmt.rs index 94f26698..513f630b 100644 --- a/mdsf/src/tools/leptosfmt.rs +++ b/mdsf/src/tools/leptosfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/liquidsoap_prettier.rs b/mdsf/src/tools/liquidsoap_prettier.rs index 48504042..a6095a08 100644 --- a/mdsf/src/tools/liquidsoap_prettier.rs +++ b/mdsf/src/tools/liquidsoap_prettier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/luacheck.rs b/mdsf/src/tools/luacheck.rs index 62c9f3ed..fd799e19 100644 --- a/mdsf/src/tools/luacheck.rs +++ b/mdsf/src/tools/luacheck.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/luaformatter.rs b/mdsf/src/tools/luaformatter.rs index 53d6c35b..44c4ad25 100644 --- a/mdsf/src/tools/luaformatter.rs +++ b/mdsf/src/tools/luaformatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -43,7 +43,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/mado_check.rs b/mdsf/src/tools/mado_check.rs index af8b4754..52e25d5c 100644 --- a/mdsf/src/tools/mado_check.rs +++ b/mdsf/src/tools/mado_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -39,7 +39,7 @@ mod test_mado_check { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/markdownfmt.rs b/mdsf/src/tools/markdownfmt.rs index b2b055a5..2d49988f 100644 --- a/mdsf/src/tools/markdownfmt.rs +++ b/mdsf/src/tools/markdownfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -41,7 +41,7 @@ this text has weird spacing crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/markdownlint.rs b/mdsf/src/tools/markdownlint.rs index d48b75c9..4f3b6bce 100644 --- a/mdsf/src/tools/markdownlint.rs +++ b/mdsf/src/tools/markdownlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -41,7 +41,7 @@ mod test_markdownlint { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/markdownlint_cli_2.rs b/mdsf/src/tools/markdownlint_cli_2.rs index 7cf3955e..4b5c0c71 100644 --- a/mdsf/src/tools/markdownlint_cli_2.rs +++ b/mdsf/src/tools/markdownlint_cli_2.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -41,7 +41,7 @@ mod test_markdownlint_cli_2 { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/markuplint.rs b/mdsf/src/tools/markuplint.rs index b36584c2..df2e78cd 100644 --- a/mdsf/src/tools/markuplint.rs +++ b/mdsf/src/tools/markuplint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/mdformat.rs b/mdsf/src/tools/mdformat.rs index 4ad2e5b5..ee55e655 100644 --- a/mdsf/src/tools/mdformat.rs +++ b/mdsf/src/tools/mdformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/mdslw.rs b/mdsf/src/tools/mdslw.rs index 8b2c6389..ab516c47 100644 --- a/mdsf/src/tools/mdslw.rs +++ b/mdsf/src/tools/mdslw.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/meson_fmt.rs b/mdsf/src/tools/meson_fmt.rs index 5a430fad..5cedbc62 100644 --- a/mdsf/src/tools/meson_fmt.rs +++ b/mdsf/src/tools/meson_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/misspell.rs b/mdsf/src/tools/misspell.rs index 5d9226f0..444ff4c9 100644 --- a/mdsf/src/tools/misspell.rs +++ b/mdsf/src/tools/misspell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/mix_format.rs b/mdsf/src/tools/mix_format.rs index 159711b0..d2fc04ce 100644 --- a/mdsf/src/tools/mix_format.rs +++ b/mdsf/src/tools/mix_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -35,7 +35,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/mod.rs b/mdsf/src/tools/mod.rs index 24a01eb4..390cd676 100644 --- a/mdsf/src/tools/mod.rs +++ b/mdsf/src/tools/mod.rs @@ -1,8 +1,6 @@ /// /// THIS FILE IS GENERATED USING CODE - DO NOT EDIT MANUALLY /// -use crate::execution::run_tools; - pub mod actionlint; pub mod alejandra; pub mod ameba; @@ -1287,1462 +1285,276 @@ impl Tooling { snippet_path: &std::path::Path, timeout: u64, ) -> Result<(bool, Option), crate::error::MdsfError> { - match self { - Self::Actionlint => run_tools( - &actionlint::COMMANDS, - snippet_path, - actionlint::set_arguments, - timeout, - ), - Self::Alejandra => run_tools( - &alejandra::COMMANDS, - snippet_path, - alejandra::set_arguments, - timeout, - ), - Self::Ameba => run_tools( - &ameba::COMMANDS, - snippet_path, - ameba::set_arguments, - timeout, - ), - Self::AnsibleLint => run_tools( - &ansible_lint::COMMANDS, - snippet_path, - ansible_lint::set_arguments, - timeout, - ), - Self::Asmfmt => run_tools( - &asmfmt::COMMANDS, - snippet_path, - asmfmt::set_arguments, - timeout, - ), - Self::Astyle => run_tools( - &astyle::COMMANDS, - snippet_path, - astyle::set_arguments, - timeout, - ), - Self::AutoOptional => run_tools( - &auto_optional::COMMANDS, - snippet_path, - auto_optional::set_arguments, - timeout, - ), - Self::Autocorrect => run_tools( - &autocorrect::COMMANDS, - snippet_path, - autocorrect::set_arguments, - timeout, - ), - Self::Autoflake => run_tools( - &autoflake::COMMANDS, - snippet_path, - autoflake::set_arguments, - timeout, - ), - Self::Autopep8 => run_tools( - &autopep_8::COMMANDS, - snippet_path, - autopep_8::set_arguments, - timeout, - ), - Self::BeancountBlack => run_tools( - &beancount_black::COMMANDS, - snippet_path, - beancount_black::set_arguments, - timeout, - ), - Self::Beautysh => run_tools( - &beautysh::COMMANDS, - snippet_path, - beautysh::set_arguments, - timeout, - ), - Self::BibtexTidy => run_tools( - &bibtex_tidy::COMMANDS, - snippet_path, - bibtex_tidy::set_arguments, - timeout, - ), - Self::BicepFormat => run_tools( - &bicep_format::COMMANDS, - snippet_path, - bicep_format::set_arguments, - timeout, - ), - Self::BiomeCheck => run_tools( - &biome_check::COMMANDS, - snippet_path, - biome_check::set_arguments, - timeout, - ), - Self::BiomeFormat => run_tools( - &biome_format::COMMANDS, - snippet_path, - biome_format::set_arguments, - timeout, - ), - Self::BiomeLint => run_tools( - &biome_lint::COMMANDS, - snippet_path, - biome_lint::set_arguments, - timeout, - ), - Self::Black => run_tools( - &black::COMMANDS, - snippet_path, - black::set_arguments, - timeout, - ), - Self::BladeFormatter => run_tools( - &blade_formatter::COMMANDS, - snippet_path, - blade_formatter::set_arguments, - timeout, - ), - Self::Blue => run_tools(&blue::COMMANDS, snippet_path, blue::set_arguments, timeout), - Self::Bpfmt => run_tools( - &bpfmt::COMMANDS, - snippet_path, - bpfmt::set_arguments, - timeout, - ), - Self::Brittany => run_tools( - &brittany::COMMANDS, - snippet_path, - brittany::set_arguments, - timeout, - ), - Self::Brunette => run_tools( - &brunette::COMMANDS, - snippet_path, - brunette::set_arguments, - timeout, - ), - Self::Bsfmt => run_tools( - &bsfmt::COMMANDS, - snippet_path, - bsfmt::set_arguments, - timeout, - ), - Self::Bslint => run_tools( - &bslint::COMMANDS, - snippet_path, - bslint::set_arguments, - timeout, - ), - Self::BufFormat => run_tools( - &buf_format::COMMANDS, - snippet_path, - buf_format::set_arguments, - timeout, - ), - Self::Buildifier => run_tools( - &buildifier::COMMANDS, - snippet_path, - buildifier::set_arguments, - timeout, - ), - Self::CabalFmt => run_tools( - &cabal_fmt::COMMANDS, - snippet_path, - cabal_fmt::set_arguments, - timeout, - ), - Self::CabalFormat => run_tools( - &cabal_format::COMMANDS, - snippet_path, - cabal_format::set_arguments, - timeout, - ), - Self::CabalPrettify => run_tools( - &cabal_prettify::COMMANDS, - snippet_path, - cabal_prettify::set_arguments, - timeout, - ), - Self::CaddyFmt => run_tools( - &caddy_fmt::COMMANDS, - snippet_path, - caddy_fmt::set_arguments, - timeout, - ), - Self::CaramelFmt => run_tools( - &caramel_fmt::COMMANDS, - snippet_path, - caramel_fmt::set_arguments, - timeout, - ), - Self::ClangFormat => run_tools( - &clang_format::COMMANDS, - snippet_path, - clang_format::set_arguments, - timeout, - ), - Self::ClangTidy => run_tools( - &clang_tidy::COMMANDS, - snippet_path, - clang_tidy::set_arguments, - timeout, - ), - Self::CljfmtFix => run_tools( - &cljfmt_fix::COMMANDS, - snippet_path, - cljfmt_fix::set_arguments, - timeout, - ), - Self::Cljstyle => run_tools( - &cljstyle::COMMANDS, - snippet_path, - cljstyle::set_arguments, - timeout, - ), - Self::CmakeFormat => run_tools( - &cmake_format::COMMANDS, - snippet_path, - cmake_format::set_arguments, - timeout, - ), - Self::Codespell => run_tools( - &codespell::COMMANDS, - snippet_path, - codespell::set_arguments, - timeout, - ), - Self::Crlfmt => run_tools( - &crlfmt::COMMANDS, - snippet_path, - crlfmt::set_arguments, - timeout, - ), - Self::CrystalFormat => run_tools( - &crystal_format::COMMANDS, - snippet_path, - crystal_format::set_arguments, - timeout, - ), - Self::Csharpier => run_tools( - &csharpier::COMMANDS, - snippet_path, - csharpier::set_arguments, - timeout, - ), - Self::CssBeautify => run_tools( - &css_beautify::COMMANDS, - snippet_path, - css_beautify::set_arguments, - timeout, - ), - Self::Csscomb => run_tools( - &csscomb::COMMANDS, - snippet_path, - csscomb::set_arguments, - timeout, - ), - Self::Csslint => run_tools( - &csslint::COMMANDS, - snippet_path, - csslint::set_arguments, - timeout, - ), - Self::Curlylint => run_tools( - &curlylint::COMMANDS, - snippet_path, - curlylint::set_arguments, - timeout, - ), - Self::D2Fmt => run_tools( - &d_2_fmt::COMMANDS, - snippet_path, - d_2_fmt::set_arguments, - timeout, - ), - Self::DartFix => run_tools( - &dart_fix::COMMANDS, - snippet_path, - dart_fix::set_arguments, - timeout, - ), - Self::DartFormat => run_tools( - &dart_format::COMMANDS, - snippet_path, - dart_format::set_arguments, - timeout, - ), - Self::DcmFix => run_tools( - &dcm_fix::COMMANDS, - snippet_path, - dcm_fix::set_arguments, - timeout, - ), - Self::DcmFormat => run_tools( - &dcm_format::COMMANDS, - snippet_path, - dcm_format::set_arguments, - timeout, - ), - Self::Deadnix => run_tools( - &deadnix::COMMANDS, - snippet_path, - deadnix::set_arguments, - timeout, - ), - Self::DenoFmt => run_tools( - &deno_fmt::COMMANDS, - snippet_path, - deno_fmt::set_arguments, - timeout, - ), - Self::DenoLint => run_tools( - &deno_lint::COMMANDS, - snippet_path, - deno_lint::set_arguments, - timeout, - ), - Self::Dfmt => run_tools(&dfmt::COMMANDS, snippet_path, dfmt::set_arguments, timeout), - Self::Dhall => run_tools( - &dhall::COMMANDS, - snippet_path, - dhall::set_arguments, - timeout, - ), - Self::Djade => run_tools( - &djade::COMMANDS, - snippet_path, - djade::set_arguments, - timeout, - ), - Self::Djlint => run_tools( - &djlint::COMMANDS, - snippet_path, - djlint::set_arguments, - timeout, - ), - Self::Docformatter => run_tools( - &docformatter::COMMANDS, - snippet_path, - docformatter::set_arguments, - timeout, - ), - Self::Dockfmt => run_tools( - &dockfmt::COMMANDS, - snippet_path, - dockfmt::set_arguments, - timeout, - ), - Self::Docstrfmt => run_tools( - &docstrfmt::COMMANDS, - snippet_path, - docstrfmt::set_arguments, - timeout, - ), - Self::Doctoc => run_tools( - &doctoc::COMMANDS, - snippet_path, - doctoc::set_arguments, - timeout, - ), - Self::DotenvLinterFix => run_tools( - &dotenv_linter_fix::COMMANDS, - snippet_path, - dotenv_linter_fix::set_arguments, - timeout, - ), - Self::DprintFmt => run_tools( - &dprint_fmt::COMMANDS, - snippet_path, - dprint_fmt::set_arguments, - timeout, - ), - Self::EasyCodingStandard => run_tools( + let (commands, set_args_fn): ( + &[crate::runners::CommandType], + fn(std::process::Command, &std::path::Path) -> std::process::Command, + ) = match self { + Self::Actionlint => (&actionlint::COMMANDS, actionlint::set_args), + Self::Alejandra => (&alejandra::COMMANDS, alejandra::set_args), + Self::Ameba => (&ameba::COMMANDS, ameba::set_args), + Self::AnsibleLint => (&ansible_lint::COMMANDS, ansible_lint::set_args), + Self::Asmfmt => (&asmfmt::COMMANDS, asmfmt::set_args), + Self::Astyle => (&astyle::COMMANDS, astyle::set_args), + Self::AutoOptional => (&auto_optional::COMMANDS, auto_optional::set_args), + Self::Autocorrect => (&autocorrect::COMMANDS, autocorrect::set_args), + Self::Autoflake => (&autoflake::COMMANDS, autoflake::set_args), + Self::Autopep8 => (&autopep_8::COMMANDS, autopep_8::set_args), + Self::BeancountBlack => (&beancount_black::COMMANDS, beancount_black::set_args), + Self::Beautysh => (&beautysh::COMMANDS, beautysh::set_args), + Self::BibtexTidy => (&bibtex_tidy::COMMANDS, bibtex_tidy::set_args), + Self::BicepFormat => (&bicep_format::COMMANDS, bicep_format::set_args), + Self::BiomeCheck => (&biome_check::COMMANDS, biome_check::set_args), + Self::BiomeFormat => (&biome_format::COMMANDS, biome_format::set_args), + Self::BiomeLint => (&biome_lint::COMMANDS, biome_lint::set_args), + Self::Black => (&black::COMMANDS, black::set_args), + Self::BladeFormatter => (&blade_formatter::COMMANDS, blade_formatter::set_args), + Self::Blue => (&blue::COMMANDS, blue::set_args), + Self::Bpfmt => (&bpfmt::COMMANDS, bpfmt::set_args), + Self::Brittany => (&brittany::COMMANDS, brittany::set_args), + Self::Brunette => (&brunette::COMMANDS, brunette::set_args), + Self::Bsfmt => (&bsfmt::COMMANDS, bsfmt::set_args), + Self::Bslint => (&bslint::COMMANDS, bslint::set_args), + Self::BufFormat => (&buf_format::COMMANDS, buf_format::set_args), + Self::Buildifier => (&buildifier::COMMANDS, buildifier::set_args), + Self::CabalFmt => (&cabal_fmt::COMMANDS, cabal_fmt::set_args), + Self::CabalFormat => (&cabal_format::COMMANDS, cabal_format::set_args), + Self::CabalPrettify => (&cabal_prettify::COMMANDS, cabal_prettify::set_args), + Self::CaddyFmt => (&caddy_fmt::COMMANDS, caddy_fmt::set_args), + Self::CaramelFmt => (&caramel_fmt::COMMANDS, caramel_fmt::set_args), + Self::ClangFormat => (&clang_format::COMMANDS, clang_format::set_args), + Self::ClangTidy => (&clang_tidy::COMMANDS, clang_tidy::set_args), + Self::CljfmtFix => (&cljfmt_fix::COMMANDS, cljfmt_fix::set_args), + Self::Cljstyle => (&cljstyle::COMMANDS, cljstyle::set_args), + Self::CmakeFormat => (&cmake_format::COMMANDS, cmake_format::set_args), + Self::Codespell => (&codespell::COMMANDS, codespell::set_args), + Self::Crlfmt => (&crlfmt::COMMANDS, crlfmt::set_args), + Self::CrystalFormat => (&crystal_format::COMMANDS, crystal_format::set_args), + Self::Csharpier => (&csharpier::COMMANDS, csharpier::set_args), + Self::CssBeautify => (&css_beautify::COMMANDS, css_beautify::set_args), + Self::Csscomb => (&csscomb::COMMANDS, csscomb::set_args), + Self::Csslint => (&csslint::COMMANDS, csslint::set_args), + Self::Curlylint => (&curlylint::COMMANDS, curlylint::set_args), + Self::D2Fmt => (&d_2_fmt::COMMANDS, d_2_fmt::set_args), + Self::DartFix => (&dart_fix::COMMANDS, dart_fix::set_args), + Self::DartFormat => (&dart_format::COMMANDS, dart_format::set_args), + Self::DcmFix => (&dcm_fix::COMMANDS, dcm_fix::set_args), + Self::DcmFormat => (&dcm_format::COMMANDS, dcm_format::set_args), + Self::Deadnix => (&deadnix::COMMANDS, deadnix::set_args), + Self::DenoFmt => (&deno_fmt::COMMANDS, deno_fmt::set_args), + Self::DenoLint => (&deno_lint::COMMANDS, deno_lint::set_args), + Self::Dfmt => (&dfmt::COMMANDS, dfmt::set_args), + Self::Dhall => (&dhall::COMMANDS, dhall::set_args), + Self::Djade => (&djade::COMMANDS, djade::set_args), + Self::Djlint => (&djlint::COMMANDS, djlint::set_args), + Self::Docformatter => (&docformatter::COMMANDS, docformatter::set_args), + Self::Dockfmt => (&dockfmt::COMMANDS, dockfmt::set_args), + Self::Docstrfmt => (&docstrfmt::COMMANDS, docstrfmt::set_args), + Self::Doctoc => (&doctoc::COMMANDS, doctoc::set_args), + Self::DotenvLinterFix => (&dotenv_linter_fix::COMMANDS, dotenv_linter_fix::set_args), + Self::DprintFmt => (&dprint_fmt::COMMANDS, dprint_fmt::set_args), + Self::EasyCodingStandard => ( &easy_coding_standard::COMMANDS, - snippet_path, - easy_coding_standard::set_arguments, - timeout, - ), - Self::Efmt => run_tools(&efmt::COMMANDS, snippet_path, efmt::set_arguments, timeout), - Self::ElmFormat => run_tools( - &elm_format::COMMANDS, - snippet_path, - elm_format::set_arguments, - timeout, - ), - Self::ErbFormatter => run_tools( - &erb_formatter::COMMANDS, - snippet_path, - erb_formatter::set_arguments, - timeout, - ), - Self::Erlfmt => run_tools( - &erlfmt::COMMANDS, - snippet_path, - erlfmt::set_arguments, - timeout, - ), - Self::Eslint => run_tools( - &eslint::COMMANDS, - snippet_path, - eslint::set_arguments, - timeout, - ), - Self::Fantomas => run_tools( - &fantomas::COMMANDS, - snippet_path, - fantomas::set_arguments, - timeout, - ), - Self::FishIndent => run_tools( - &fish_indent::COMMANDS, - snippet_path, - fish_indent::set_arguments, - timeout, - ), - Self::Fixjson => run_tools( - &fixjson::COMMANDS, - snippet_path, - fixjson::set_arguments, - timeout, - ), - Self::Floskell => run_tools( - &floskell::COMMANDS, - snippet_path, - floskell::set_arguments, - timeout, - ), - Self::Fnlfmt => run_tools( - &fnlfmt::COMMANDS, - snippet_path, - fnlfmt::set_arguments, - timeout, - ), - Self::ForgeFmt => run_tools( - &forge_fmt::COMMANDS, - snippet_path, - forge_fmt::set_arguments, - timeout, - ), - Self::Fourmolu => run_tools( - &fourmolu::COMMANDS, - snippet_path, - fourmolu::set_arguments, - timeout, - ), - Self::Fprettify => run_tools( - &fprettify::COMMANDS, - snippet_path, - fprettify::set_arguments, - timeout, - ), - Self::FutharkFmt => run_tools( - &futhark_fmt::COMMANDS, - snippet_path, - futhark_fmt::set_arguments, - timeout, - ), - Self::Gci => run_tools(&gci::COMMANDS, snippet_path, gci::set_arguments, timeout), - Self::Gdformat => run_tools( - &gdformat::COMMANDS, - snippet_path, - gdformat::set_arguments, - timeout, - ), - Self::Gersemi => run_tools( - &gersemi::COMMANDS, - snippet_path, - gersemi::set_arguments, - timeout, - ), - Self::GleamFormat => run_tools( - &gleam_format::COMMANDS, - snippet_path, - gleam_format::set_arguments, - timeout, - ), - Self::GluonFmt => run_tools( - &gluon_fmt::COMMANDS, - snippet_path, - gluon_fmt::set_arguments, - timeout, - ), - Self::Gofmt => run_tools( - &gofmt::COMMANDS, - snippet_path, - gofmt::set_arguments, - timeout, - ), - Self::Gofumpt => run_tools( - &gofumpt::COMMANDS, - snippet_path, - gofumpt::set_arguments, - timeout, - ), - Self::Goimports => run_tools( - &goimports::COMMANDS, - snippet_path, - goimports::set_arguments, - timeout, - ), - Self::GoimportsReviser => run_tools( - &goimports_reviser::COMMANDS, - snippet_path, - goimports_reviser::set_arguments, - timeout, - ), - Self::Golines => run_tools( - &golines::COMMANDS, - snippet_path, - golines::set_arguments, - timeout, - ), - Self::GoogleJavaFormat => run_tools( - &google_java_format::COMMANDS, - snippet_path, - google_java_format::set_arguments, - timeout, - ), - Self::GrainFormat => run_tools( - &grain_format::COMMANDS, - snippet_path, - grain_format::set_arguments, - timeout, - ), - Self::Hadolint => run_tools( - &hadolint::COMMANDS, - snippet_path, - hadolint::set_arguments, - timeout, - ), - Self::HamlLint => run_tools( - &haml_lint::COMMANDS, - snippet_path, - haml_lint::set_arguments, - timeout, - ), - Self::Hclfmt => run_tools( - &hclfmt::COMMANDS, - snippet_path, - hclfmt::set_arguments, - timeout, - ), - Self::Hfmt => run_tools(&hfmt::COMMANDS, snippet_path, hfmt::set_arguments, timeout), - Self::Hindent => run_tools( - &hindent::COMMANDS, - snippet_path, - hindent::set_arguments, - timeout, - ), - Self::Hlint => run_tools( - &hlint::COMMANDS, - snippet_path, - hlint::set_arguments, - timeout, - ), - Self::HtmlBeautify => run_tools( - &html_beautify::COMMANDS, - snippet_path, - html_beautify::set_arguments, - timeout, - ), - Self::Htmlbeautifier => run_tools( - &htmlbeautifier::COMMANDS, - snippet_path, - htmlbeautifier::set_arguments, - timeout, - ), - Self::Htmlhint => run_tools( - &htmlhint::COMMANDS, - snippet_path, - htmlhint::set_arguments, - timeout, - ), - Self::ImbaFmt => run_tools( - &imba_fmt::COMMANDS, - snippet_path, - imba_fmt::set_arguments, - timeout, - ), - Self::InkoFmt => run_tools( - &inko_fmt::COMMANDS, - snippet_path, - inko_fmt::set_arguments, - timeout, - ), - Self::Isort => run_tools( - &isort::COMMANDS, - snippet_path, - isort::set_arguments, - timeout, - ), - Self::Joker => run_tools( - &joker::COMMANDS, - snippet_path, - joker::set_arguments, - timeout, - ), - Self::JsBeautify => run_tools( - &js_beautify::COMMANDS, - snippet_path, - js_beautify::set_arguments, - timeout, - ), - Self::Json5Format => run_tools( - &json_5_format::COMMANDS, - snippet_path, - json_5_format::set_arguments, - timeout, - ), - Self::JsonaFormat => run_tools( - &jsona_format::COMMANDS, - snippet_path, - jsona_format::set_arguments, - timeout, - ), - Self::JsonaLint => run_tools( - &jsona_lint::COMMANDS, - snippet_path, - jsona_lint::set_arguments, - timeout, - ), - Self::Jsonlint => run_tools( - &jsonlint::COMMANDS, - snippet_path, - jsonlint::set_arguments, - timeout, - ), - Self::JsonnetLint => run_tools( - &jsonnet_lint::COMMANDS, - snippet_path, - jsonnet_lint::set_arguments, - timeout, - ), - Self::Jsonnetfmt => run_tools( - &jsonnetfmt::COMMANDS, - snippet_path, - jsonnetfmt::set_arguments, - timeout, - ), - Self::JuliaformatterJl => run_tools( - &juliaformatter_jl::COMMANDS, - snippet_path, - juliaformatter_jl::set_arguments, - timeout, - ), - Self::Just => run_tools(&just::COMMANDS, snippet_path, just::set_arguments, timeout), - Self::KclFmt => run_tools( - &kcl_fmt::COMMANDS, - snippet_path, - kcl_fmt::set_arguments, - timeout, - ), - Self::KclLint => run_tools( - &kcl_lint::COMMANDS, - snippet_path, - kcl_lint::set_arguments, - timeout, - ), - Self::Kdlfmt => run_tools( - &kdlfmt::COMMANDS, - snippet_path, - kdlfmt::set_arguments, - timeout, - ), - Self::KdocFormatter => run_tools( - &kdoc_formatter::COMMANDS, - snippet_path, - kdoc_formatter::set_arguments, - timeout, - ), - Self::Ktfmt => run_tools( - &ktfmt::COMMANDS, - snippet_path, - ktfmt::set_arguments, - timeout, - ), - Self::Ktlint => run_tools( - &ktlint::COMMANDS, - snippet_path, - ktlint::set_arguments, - timeout, - ), - Self::KulalaFmt => run_tools( - &kulala_fmt::COMMANDS, - snippet_path, - kulala_fmt::set_arguments, - timeout, - ), - Self::Leptosfmt => run_tools( - &leptosfmt::COMMANDS, - snippet_path, - leptosfmt::set_arguments, - timeout, - ), - Self::LiquidsoapPrettier => run_tools( + easy_coding_standard::set_args, + ), + Self::Efmt => (&efmt::COMMANDS, efmt::set_args), + Self::ElmFormat => (&elm_format::COMMANDS, elm_format::set_args), + Self::ErbFormatter => (&erb_formatter::COMMANDS, erb_formatter::set_args), + Self::Erlfmt => (&erlfmt::COMMANDS, erlfmt::set_args), + Self::Eslint => (&eslint::COMMANDS, eslint::set_args), + Self::Fantomas => (&fantomas::COMMANDS, fantomas::set_args), + Self::FishIndent => (&fish_indent::COMMANDS, fish_indent::set_args), + Self::Fixjson => (&fixjson::COMMANDS, fixjson::set_args), + Self::Floskell => (&floskell::COMMANDS, floskell::set_args), + Self::Fnlfmt => (&fnlfmt::COMMANDS, fnlfmt::set_args), + Self::ForgeFmt => (&forge_fmt::COMMANDS, forge_fmt::set_args), + Self::Fourmolu => (&fourmolu::COMMANDS, fourmolu::set_args), + Self::Fprettify => (&fprettify::COMMANDS, fprettify::set_args), + Self::FutharkFmt => (&futhark_fmt::COMMANDS, futhark_fmt::set_args), + Self::Gci => (&gci::COMMANDS, gci::set_args), + Self::Gdformat => (&gdformat::COMMANDS, gdformat::set_args), + Self::Gersemi => (&gersemi::COMMANDS, gersemi::set_args), + Self::GleamFormat => (&gleam_format::COMMANDS, gleam_format::set_args), + Self::GluonFmt => (&gluon_fmt::COMMANDS, gluon_fmt::set_args), + Self::Gofmt => (&gofmt::COMMANDS, gofmt::set_args), + Self::Gofumpt => (&gofumpt::COMMANDS, gofumpt::set_args), + Self::Goimports => (&goimports::COMMANDS, goimports::set_args), + Self::GoimportsReviser => (&goimports_reviser::COMMANDS, goimports_reviser::set_args), + Self::Golines => (&golines::COMMANDS, golines::set_args), + Self::GoogleJavaFormat => (&google_java_format::COMMANDS, google_java_format::set_args), + Self::GrainFormat => (&grain_format::COMMANDS, grain_format::set_args), + Self::Hadolint => (&hadolint::COMMANDS, hadolint::set_args), + Self::HamlLint => (&haml_lint::COMMANDS, haml_lint::set_args), + Self::Hclfmt => (&hclfmt::COMMANDS, hclfmt::set_args), + Self::Hfmt => (&hfmt::COMMANDS, hfmt::set_args), + Self::Hindent => (&hindent::COMMANDS, hindent::set_args), + Self::Hlint => (&hlint::COMMANDS, hlint::set_args), + Self::HtmlBeautify => (&html_beautify::COMMANDS, html_beautify::set_args), + Self::Htmlbeautifier => (&htmlbeautifier::COMMANDS, htmlbeautifier::set_args), + Self::Htmlhint => (&htmlhint::COMMANDS, htmlhint::set_args), + Self::ImbaFmt => (&imba_fmt::COMMANDS, imba_fmt::set_args), + Self::InkoFmt => (&inko_fmt::COMMANDS, inko_fmt::set_args), + Self::Isort => (&isort::COMMANDS, isort::set_args), + Self::Joker => (&joker::COMMANDS, joker::set_args), + Self::JsBeautify => (&js_beautify::COMMANDS, js_beautify::set_args), + Self::Json5Format => (&json_5_format::COMMANDS, json_5_format::set_args), + Self::JsonaFormat => (&jsona_format::COMMANDS, jsona_format::set_args), + Self::JsonaLint => (&jsona_lint::COMMANDS, jsona_lint::set_args), + Self::Jsonlint => (&jsonlint::COMMANDS, jsonlint::set_args), + Self::JsonnetLint => (&jsonnet_lint::COMMANDS, jsonnet_lint::set_args), + Self::Jsonnetfmt => (&jsonnetfmt::COMMANDS, jsonnetfmt::set_args), + Self::JuliaformatterJl => (&juliaformatter_jl::COMMANDS, juliaformatter_jl::set_args), + Self::Just => (&just::COMMANDS, just::set_args), + Self::KclFmt => (&kcl_fmt::COMMANDS, kcl_fmt::set_args), + Self::KclLint => (&kcl_lint::COMMANDS, kcl_lint::set_args), + Self::Kdlfmt => (&kdlfmt::COMMANDS, kdlfmt::set_args), + Self::KdocFormatter => (&kdoc_formatter::COMMANDS, kdoc_formatter::set_args), + Self::Ktfmt => (&ktfmt::COMMANDS, ktfmt::set_args), + Self::Ktlint => (&ktlint::COMMANDS, ktlint::set_args), + Self::KulalaFmt => (&kulala_fmt::COMMANDS, kulala_fmt::set_args), + Self::Leptosfmt => (&leptosfmt::COMMANDS, leptosfmt::set_args), + Self::LiquidsoapPrettier => ( &liquidsoap_prettier::COMMANDS, - snippet_path, - liquidsoap_prettier::set_arguments, - timeout, - ), - Self::Luacheck => run_tools( - &luacheck::COMMANDS, - snippet_path, - luacheck::set_arguments, - timeout, - ), - Self::Luaformatter => run_tools( - &luaformatter::COMMANDS, - snippet_path, - luaformatter::set_arguments, - timeout, - ), - Self::MadoCheck => run_tools( - &mado_check::COMMANDS, - snippet_path, - mado_check::set_arguments, - timeout, - ), - Self::Markdownfmt => run_tools( - &markdownfmt::COMMANDS, - snippet_path, - markdownfmt::set_arguments, - timeout, - ), - Self::Markdownlint => run_tools( - &markdownlint::COMMANDS, - snippet_path, - markdownlint::set_arguments, - timeout, - ), - Self::MarkdownlintCli2 => run_tools( - &markdownlint_cli_2::COMMANDS, - snippet_path, - markdownlint_cli_2::set_arguments, - timeout, - ), - Self::Markuplint => run_tools( - &markuplint::COMMANDS, - snippet_path, - markuplint::set_arguments, - timeout, - ), - Self::Mdformat => run_tools( - &mdformat::COMMANDS, - snippet_path, - mdformat::set_arguments, - timeout, - ), - Self::Mdslw => run_tools( - &mdslw::COMMANDS, - snippet_path, - mdslw::set_arguments, - timeout, - ), - Self::MesonFmt => run_tools( - &meson_fmt::COMMANDS, - snippet_path, - meson_fmt::set_arguments, - timeout, - ), - Self::Misspell => run_tools( - &misspell::COMMANDS, - snippet_path, - misspell::set_arguments, - timeout, - ), - Self::MixFormat => run_tools( - &mix_format::COMMANDS, - snippet_path, - mix_format::set_arguments, - timeout, - ), - Self::MojoFormat => run_tools( - &mojo_format::COMMANDS, - snippet_path, - mojo_format::set_arguments, - timeout, - ), - Self::Mypy => run_tools(&mypy::COMMANDS, snippet_path, mypy::set_arguments, timeout), - Self::Nginxbeautifier => run_tools( - &nginxbeautifier::COMMANDS, - snippet_path, - nginxbeautifier::set_arguments, - timeout, - ), - Self::Nginxfmt => run_tools( - &nginxfmt::COMMANDS, - snippet_path, - nginxfmt::set_arguments, - timeout, - ), - Self::NickelFormat => run_tools( - &nickel_format::COMMANDS, - snippet_path, - nickel_format::set_arguments, - timeout, - ), - Self::Nimpretty => run_tools( - &nimpretty::COMMANDS, - snippet_path, - nimpretty::set_arguments, - timeout, - ), - Self::Nixfmt => run_tools( - &nixfmt::COMMANDS, - snippet_path, - nixfmt::set_arguments, - timeout, - ), - Self::NixpkgsFmt => run_tools( - &nixpkgs_fmt::COMMANDS, - snippet_path, - nixpkgs_fmt::set_arguments, - timeout, - ), - Self::NomadFmt => run_tools( - &nomad_fmt::COMMANDS, - snippet_path, - nomad_fmt::set_arguments, - timeout, - ), - Self::Nph => run_tools(&nph::COMMANDS, snippet_path, nph::set_arguments, timeout), - Self::NpmGroovyLint => run_tools( - &npm_groovy_lint::COMMANDS, - snippet_path, - npm_groovy_lint::set_arguments, - timeout, - ), - Self::Nufmt => run_tools( - &nufmt::COMMANDS, - snippet_path, - nufmt::set_arguments, - timeout, - ), - Self::Ocamlformat => run_tools( - &ocamlformat::COMMANDS, - snippet_path, - ocamlformat::set_arguments, - timeout, - ), - Self::OcpIndent => run_tools( - &ocp_indent::COMMANDS, - snippet_path, - ocp_indent::set_arguments, - timeout, - ), - Self::Odinfmt => run_tools( - &odinfmt::COMMANDS, - snippet_path, - odinfmt::set_arguments, - timeout, - ), - Self::OelintAdv => run_tools( - &oelint_adv::COMMANDS, - snippet_path, - oelint_adv::set_arguments, - timeout, - ), - Self::OpaFmt => run_tools( - &opa_fmt::COMMANDS, - snippet_path, - opa_fmt::set_arguments, - timeout, - ), - Self::Ormolu => run_tools( - &ormolu::COMMANDS, - snippet_path, - ormolu::set_arguments, - timeout, - ), - Self::Oxlint => run_tools( - &oxlint::COMMANDS, - snippet_path, - oxlint::set_arguments, - timeout, - ), - Self::PackerFix => run_tools( - &packer_fix::COMMANDS, - snippet_path, - packer_fix::set_arguments, - timeout, - ), - Self::PackerFmt => run_tools( - &packer_fmt::COMMANDS, - snippet_path, - packer_fmt::set_arguments, - timeout, - ), - Self::Perltidy => run_tools( - &perltidy::COMMANDS, - snippet_path, - perltidy::set_arguments, - timeout, - ), - Self::PgFormat => run_tools( - &pg_format::COMMANDS, - snippet_path, - pg_format::set_arguments, - timeout, - ), - Self::PhpCsFixerFix => run_tools( - &php_cs_fixer_fix::COMMANDS, - snippet_path, - php_cs_fixer_fix::set_arguments, - timeout, - ), - Self::Phpcbf => run_tools( - &phpcbf::COMMANDS, - snippet_path, - phpcbf::set_arguments, - timeout, - ), - Self::PhpinsightsFix => run_tools( - &phpinsights_fix::COMMANDS, - snippet_path, - phpinsights_fix::set_arguments, - timeout, - ), - Self::Pint => run_tools(&pint::COMMANDS, snippet_path, pint::set_arguments, timeout), - Self::Prettier => run_tools( - &prettier::COMMANDS, - snippet_path, - prettier::set_arguments, - timeout, - ), - Self::PrettyPhp => run_tools( - &pretty_php::COMMANDS, - snippet_path, - pretty_php::set_arguments, - timeout, - ), - Self::Prettypst => run_tools( - &prettypst::COMMANDS, - snippet_path, - prettypst::set_arguments, - timeout, - ), - Self::PrismaFormat => run_tools( - &prisma_format::COMMANDS, - snippet_path, - prisma_format::set_arguments, - timeout, - ), - Self::Protolint => run_tools( - &protolint::COMMANDS, - snippet_path, - protolint::set_arguments, - timeout, - ), - Self::Ptop => run_tools(&ptop::COMMANDS, snippet_path, ptop::set_arguments, timeout), - Self::PuppetLint => run_tools( - &puppet_lint::COMMANDS, - snippet_path, - puppet_lint::set_arguments, - timeout, - ), - Self::PursTidy => run_tools( - &purs_tidy::COMMANDS, - snippet_path, - purs_tidy::set_arguments, - timeout, - ), - Self::Purty => run_tools( - &purty::COMMANDS, - snippet_path, - purty::set_arguments, - timeout, - ), - Self::Pycln => run_tools( - &pycln::COMMANDS, - snippet_path, - pycln::set_arguments, - timeout, - ), - Self::Pycodestyle => run_tools( - &pycodestyle::COMMANDS, - snippet_path, - pycodestyle::set_arguments, - timeout, - ), - Self::Pyink => run_tools( - &pyink::COMMANDS, - snippet_path, - pyink::set_arguments, - timeout, - ), - Self::Pyment => run_tools( - &pyment::COMMANDS, - snippet_path, - pyment::set_arguments, - timeout, - ), - Self::Qmlfmt => run_tools( - &qmlfmt::COMMANDS, - snippet_path, - qmlfmt::set_arguments, - timeout, - ), - Self::QuickLintJs => run_tools( - &quick_lint_js::COMMANDS, - snippet_path, - quick_lint_js::set_arguments, - timeout, - ), - Self::RacoFmt => run_tools( - &raco_fmt::COMMANDS, - snippet_path, - raco_fmt::set_arguments, - timeout, - ), - Self::Refmt => run_tools( - &refmt::COMMANDS, - snippet_path, - refmt::set_arguments, - timeout, - ), - Self::ReformatGherkin => run_tools( - &reformat_gherkin::COMMANDS, - snippet_path, - reformat_gherkin::set_arguments, - timeout, - ), - Self::RegalFix => run_tools( - ®al_fix::COMMANDS, - snippet_path, - regal_fix::set_arguments, - timeout, - ), - Self::RegalLint => run_tools( - ®al_lint::COMMANDS, - snippet_path, - regal_lint::set_arguments, - timeout, - ), - Self::ReorderPythonImports => run_tools( + liquidsoap_prettier::set_args, + ), + Self::Luacheck => (&luacheck::COMMANDS, luacheck::set_args), + Self::Luaformatter => (&luaformatter::COMMANDS, luaformatter::set_args), + Self::MadoCheck => (&mado_check::COMMANDS, mado_check::set_args), + Self::Markdownfmt => (&markdownfmt::COMMANDS, markdownfmt::set_args), + Self::Markdownlint => (&markdownlint::COMMANDS, markdownlint::set_args), + Self::MarkdownlintCli2 => (&markdownlint_cli_2::COMMANDS, markdownlint_cli_2::set_args), + Self::Markuplint => (&markuplint::COMMANDS, markuplint::set_args), + Self::Mdformat => (&mdformat::COMMANDS, mdformat::set_args), + Self::Mdslw => (&mdslw::COMMANDS, mdslw::set_args), + Self::MesonFmt => (&meson_fmt::COMMANDS, meson_fmt::set_args), + Self::Misspell => (&misspell::COMMANDS, misspell::set_args), + Self::MixFormat => (&mix_format::COMMANDS, mix_format::set_args), + Self::MojoFormat => (&mojo_format::COMMANDS, mojo_format::set_args), + Self::Mypy => (&mypy::COMMANDS, mypy::set_args), + Self::Nginxbeautifier => (&nginxbeautifier::COMMANDS, nginxbeautifier::set_args), + Self::Nginxfmt => (&nginxfmt::COMMANDS, nginxfmt::set_args), + Self::NickelFormat => (&nickel_format::COMMANDS, nickel_format::set_args), + Self::Nimpretty => (&nimpretty::COMMANDS, nimpretty::set_args), + Self::Nixfmt => (&nixfmt::COMMANDS, nixfmt::set_args), + Self::NixpkgsFmt => (&nixpkgs_fmt::COMMANDS, nixpkgs_fmt::set_args), + Self::NomadFmt => (&nomad_fmt::COMMANDS, nomad_fmt::set_args), + Self::Nph => (&nph::COMMANDS, nph::set_args), + Self::NpmGroovyLint => (&npm_groovy_lint::COMMANDS, npm_groovy_lint::set_args), + Self::Nufmt => (&nufmt::COMMANDS, nufmt::set_args), + Self::Ocamlformat => (&ocamlformat::COMMANDS, ocamlformat::set_args), + Self::OcpIndent => (&ocp_indent::COMMANDS, ocp_indent::set_args), + Self::Odinfmt => (&odinfmt::COMMANDS, odinfmt::set_args), + Self::OelintAdv => (&oelint_adv::COMMANDS, oelint_adv::set_args), + Self::OpaFmt => (&opa_fmt::COMMANDS, opa_fmt::set_args), + Self::Ormolu => (&ormolu::COMMANDS, ormolu::set_args), + Self::Oxlint => (&oxlint::COMMANDS, oxlint::set_args), + Self::PackerFix => (&packer_fix::COMMANDS, packer_fix::set_args), + Self::PackerFmt => (&packer_fmt::COMMANDS, packer_fmt::set_args), + Self::Perltidy => (&perltidy::COMMANDS, perltidy::set_args), + Self::PgFormat => (&pg_format::COMMANDS, pg_format::set_args), + Self::PhpCsFixerFix => (&php_cs_fixer_fix::COMMANDS, php_cs_fixer_fix::set_args), + Self::Phpcbf => (&phpcbf::COMMANDS, phpcbf::set_args), + Self::PhpinsightsFix => (&phpinsights_fix::COMMANDS, phpinsights_fix::set_args), + Self::Pint => (&pint::COMMANDS, pint::set_args), + Self::Prettier => (&prettier::COMMANDS, prettier::set_args), + Self::PrettyPhp => (&pretty_php::COMMANDS, pretty_php::set_args), + Self::Prettypst => (&prettypst::COMMANDS, prettypst::set_args), + Self::PrismaFormat => (&prisma_format::COMMANDS, prisma_format::set_args), + Self::Protolint => (&protolint::COMMANDS, protolint::set_args), + Self::Ptop => (&ptop::COMMANDS, ptop::set_args), + Self::PuppetLint => (&puppet_lint::COMMANDS, puppet_lint::set_args), + Self::PursTidy => (&purs_tidy::COMMANDS, purs_tidy::set_args), + Self::Purty => (&purty::COMMANDS, purty::set_args), + Self::Pycln => (&pycln::COMMANDS, pycln::set_args), + Self::Pycodestyle => (&pycodestyle::COMMANDS, pycodestyle::set_args), + Self::Pyink => (&pyink::COMMANDS, pyink::set_args), + Self::Pyment => (&pyment::COMMANDS, pyment::set_args), + Self::Qmlfmt => (&qmlfmt::COMMANDS, qmlfmt::set_args), + Self::QuickLintJs => (&quick_lint_js::COMMANDS, quick_lint_js::set_args), + Self::RacoFmt => (&raco_fmt::COMMANDS, raco_fmt::set_args), + Self::Refmt => (&refmt::COMMANDS, refmt::set_args), + Self::ReformatGherkin => (&reformat_gherkin::COMMANDS, reformat_gherkin::set_args), + Self::RegalFix => (®al_fix::COMMANDS, regal_fix::set_args), + Self::RegalLint => (®al_lint::COMMANDS, regal_lint::set_args), + Self::ReorderPythonImports => ( &reorder_python_imports::COMMANDS, - snippet_path, - reorder_python_imports::set_arguments, - timeout, - ), - Self::RescriptFormat => run_tools( - &rescript_format::COMMANDS, - snippet_path, - rescript_format::set_arguments, - timeout, - ), - Self::RocFormat => run_tools( - &roc_format::COMMANDS, - snippet_path, - roc_format::set_arguments, - timeout, - ), - Self::Rstfmt => run_tools( - &rstfmt::COMMANDS, - snippet_path, - rstfmt::set_arguments, - timeout, - ), - Self::Rubocop => run_tools( - &rubocop::COMMANDS, - snippet_path, - rubocop::set_arguments, - timeout, - ), - Self::Rubyfmt => run_tools( - &rubyfmt::COMMANDS, - snippet_path, - rubyfmt::set_arguments, - timeout, - ), - Self::RuffCheck => run_tools( - &ruff_check::COMMANDS, - snippet_path, - ruff_check::set_arguments, - timeout, - ), - Self::RuffFormat => run_tools( - &ruff_format::COMMANDS, - snippet_path, - ruff_format::set_arguments, - timeout, - ), - Self::Rufo => run_tools(&rufo::COMMANDS, snippet_path, rufo::set_arguments, timeout), - Self::RuneFmt => run_tools( - &rune_fmt::COMMANDS, - snippet_path, - rune_fmt::set_arguments, - timeout, - ), - Self::Rustfmt => run_tools( - &rustfmt::COMMANDS, - snippet_path, - rustfmt::set_arguments, - timeout, - ), - Self::Rustywind => run_tools( - &rustywind::COMMANDS, - snippet_path, - rustywind::set_arguments, - timeout, - ), - Self::SaltLint => run_tools( - &salt_lint::COMMANDS, - snippet_path, - salt_lint::set_arguments, - timeout, - ), - Self::Scalafmt => run_tools( - &scalafmt::COMMANDS, - snippet_path, - scalafmt::set_arguments, - timeout, - ), - Self::Scalariform => run_tools( - &scalariform::COMMANDS, - snippet_path, - scalariform::set_arguments, - timeout, - ), - Self::Selene => run_tools( - &selene::COMMANDS, - snippet_path, - selene::set_arguments, - timeout, - ), - Self::Shellcheck => run_tools( - &shellcheck::COMMANDS, - snippet_path, - shellcheck::set_arguments, - timeout, - ), - Self::Shellharden => run_tools( - &shellharden::COMMANDS, - snippet_path, - shellharden::set_arguments, - timeout, - ), - Self::Shfmt => run_tools( - &shfmt::COMMANDS, - snippet_path, - shfmt::set_arguments, - timeout, - ), - Self::Sleek => run_tools( - &sleek::COMMANDS, - snippet_path, - sleek::set_arguments, - timeout, - ), - Self::Smlfmt => run_tools( - &smlfmt::COMMANDS, - snippet_path, - smlfmt::set_arguments, - timeout, - ), - Self::Snakefmt => run_tools( - &snakefmt::COMMANDS, - snippet_path, - snakefmt::set_arguments, - timeout, - ), - Self::Solhint => run_tools( - &solhint::COMMANDS, - snippet_path, - solhint::set_arguments, - timeout, - ), - Self::SqlFormatter => run_tools( - &sql_formatter::COMMANDS, - snippet_path, - sql_formatter::set_arguments, - timeout, - ), - Self::SqlfluffFix => run_tools( - &sqlfluff_fix::COMMANDS, - snippet_path, - sqlfluff_fix::set_arguments, - timeout, - ), - Self::SqlfluffFormat => run_tools( - &sqlfluff_format::COMMANDS, - snippet_path, - sqlfluff_format::set_arguments, - timeout, - ), - Self::Sqlfmt => run_tools( - &sqlfmt::COMMANDS, - snippet_path, - sqlfmt::set_arguments, - timeout, - ), - Self::Sqruff => run_tools( - &sqruff::COMMANDS, - snippet_path, - sqruff::set_arguments, - timeout, - ), - Self::Standardjs => run_tools( - &standardjs::COMMANDS, - snippet_path, - standardjs::set_arguments, - timeout, - ), - Self::Standardrb => run_tools( - &standardrb::COMMANDS, - snippet_path, - standardrb::set_arguments, - timeout, - ), - Self::StatixCheck => run_tools( - &statix_check::COMMANDS, - snippet_path, - statix_check::set_arguments, - timeout, - ), - Self::StatixFix => run_tools( - &statix_fix::COMMANDS, - snippet_path, - statix_fix::set_arguments, - timeout, - ), - Self::Stylefmt => run_tools( - &stylefmt::COMMANDS, - snippet_path, - stylefmt::set_arguments, - timeout, - ), - Self::Stylelint => run_tools( - &stylelint::COMMANDS, - snippet_path, - stylelint::set_arguments, - timeout, - ), - Self::StylishHaskell => run_tools( - &stylish_haskell::COMMANDS, - snippet_path, - stylish_haskell::set_arguments, - timeout, - ), - Self::Stylua => run_tools( - &stylua::COMMANDS, - snippet_path, - stylua::set_arguments, - timeout, - ), - Self::SuperhtmlFmt => run_tools( - &superhtml_fmt::COMMANDS, - snippet_path, - superhtml_fmt::set_arguments, - timeout, - ), - Self::SwiftFormat => run_tools( - &swift_format::COMMANDS, - snippet_path, - swift_format::set_arguments, - timeout, - ), - Self::Swiftformat => run_tools( - &swiftformat::COMMANDS, - snippet_path, - swiftformat::set_arguments, - timeout, - ), - Self::Taplo => run_tools( - &taplo::COMMANDS, - snippet_path, - taplo::set_arguments, - timeout, - ), - Self::TemplFmt => run_tools( - &templ_fmt::COMMANDS, - snippet_path, - templ_fmt::set_arguments, - timeout, - ), - Self::TerraformFmt => run_tools( - &terraform_fmt::COMMANDS, - snippet_path, - terraform_fmt::set_arguments, - timeout, - ), - Self::TerragruntHclfmt => run_tools( - &terragrunt_hclfmt::COMMANDS, - snippet_path, - terragrunt_hclfmt::set_arguments, - timeout, - ), - Self::TexFmt => run_tools( - &tex_fmt::COMMANDS, - snippet_path, - tex_fmt::set_arguments, - timeout, - ), - Self::TlintFormat => run_tools( - &tlint_format::COMMANDS, - snippet_path, - tlint_format::set_arguments, - timeout, - ), - Self::TofuFmt => run_tools( - &tofu_fmt::COMMANDS, - snippet_path, - tofu_fmt::set_arguments, - timeout, - ), - Self::TomlSort => run_tools( - &toml_sort::COMMANDS, - snippet_path, - toml_sort::set_arguments, - timeout, - ), - Self::Topiary => run_tools( - &topiary::COMMANDS, - snippet_path, - topiary::set_arguments, - timeout, - ), - Self::TsStandard => run_tools( - &ts_standard::COMMANDS, - snippet_path, - ts_standard::set_arguments, - timeout, - ), - Self::Tsqllint => run_tools( - &tsqllint::COMMANDS, - snippet_path, - tsqllint::set_arguments, - timeout, - ), - Self::TwigCsFixerLint => run_tools( - &twig_cs_fixer_lint::COMMANDS, - snippet_path, - twig_cs_fixer_lint::set_arguments, - timeout, - ), - Self::Typos => run_tools( - &typos::COMMANDS, - snippet_path, - typos::set_arguments, - timeout, - ), - Self::Typstfmt => run_tools( - &typstfmt::COMMANDS, - snippet_path, - typstfmt::set_arguments, - timeout, - ), - Self::Typstyle => run_tools( - &typstyle::COMMANDS, - snippet_path, - typstyle::set_arguments, - timeout, - ), - Self::Ufmt => run_tools(&ufmt::COMMANDS, snippet_path, ufmt::set_arguments, timeout), - Self::UiuaFmt => run_tools( - &uiua_fmt::COMMANDS, - snippet_path, - uiua_fmt::set_arguments, - timeout, - ), - Self::Unimport => run_tools( - &unimport::COMMANDS, - snippet_path, - unimport::set_arguments, - timeout, - ), - Self::Usort => run_tools( - &usort::COMMANDS, - snippet_path, - usort::set_arguments, - timeout, - ), - Self::VFmt => run_tools( - &v_fmt::COMMANDS, - snippet_path, - v_fmt::set_arguments, - timeout, - ), - Self::VacuumLint => run_tools( - &vacuum_lint::COMMANDS, - snippet_path, - vacuum_lint::set_arguments, - timeout, - ), - Self::VerylFmt => run_tools( - &veryl_fmt::COMMANDS, - snippet_path, - veryl_fmt::set_arguments, - timeout, - ), - Self::VhdlStyleGuide => run_tools( - &vhdl_style_guide::COMMANDS, - snippet_path, - vhdl_style_guide::set_arguments, - timeout, - ), - Self::WaFmt => run_tools( - &wa_fmt::COMMANDS, - snippet_path, - wa_fmt::set_arguments, - timeout, - ), - Self::Wfindent => run_tools( - &wfindent::COMMANDS, - snippet_path, - wfindent::set_arguments, - timeout, - ), - Self::Xmlformat => run_tools( - &xmlformat::COMMANDS, - snippet_path, - xmlformat::set_arguments, - timeout, - ), - Self::Xmllint => run_tools( - &xmllint::COMMANDS, - snippet_path, - xmllint::set_arguments, - timeout, - ), - Self::Xo => run_tools(&xo::COMMANDS, snippet_path, xo::set_arguments, timeout), - Self::Yamlfix => run_tools( - &yamlfix::COMMANDS, - snippet_path, - yamlfix::set_arguments, - timeout, - ), - Self::Yamlfmt => run_tools( - &yamlfmt::COMMANDS, - snippet_path, - yamlfmt::set_arguments, - timeout, - ), - Self::Yapf => run_tools(&yapf::COMMANDS, snippet_path, yapf::set_arguments, timeout), - Self::YewFmt => run_tools( - &yew_fmt::COMMANDS, - snippet_path, - yew_fmt::set_arguments, - timeout, - ), - Self::ZigFmt => run_tools( - &zig_fmt::COMMANDS, - snippet_path, - zig_fmt::set_arguments, - timeout, - ), - Self::ZiggyFmt => run_tools( - &ziggy_fmt::COMMANDS, - snippet_path, - ziggy_fmt::set_arguments, - timeout, - ), - Self::Zprint => run_tools( - &zprint::COMMANDS, - snippet_path, - zprint::set_arguments, - timeout, - ), - } + reorder_python_imports::set_args, + ), + Self::RescriptFormat => (&rescript_format::COMMANDS, rescript_format::set_args), + Self::RocFormat => (&roc_format::COMMANDS, roc_format::set_args), + Self::Rstfmt => (&rstfmt::COMMANDS, rstfmt::set_args), + Self::Rubocop => (&rubocop::COMMANDS, rubocop::set_args), + Self::Rubyfmt => (&rubyfmt::COMMANDS, rubyfmt::set_args), + Self::RuffCheck => (&ruff_check::COMMANDS, ruff_check::set_args), + Self::RuffFormat => (&ruff_format::COMMANDS, ruff_format::set_args), + Self::Rufo => (&rufo::COMMANDS, rufo::set_args), + Self::RuneFmt => (&rune_fmt::COMMANDS, rune_fmt::set_args), + Self::Rustfmt => (&rustfmt::COMMANDS, rustfmt::set_args), + Self::Rustywind => (&rustywind::COMMANDS, rustywind::set_args), + Self::SaltLint => (&salt_lint::COMMANDS, salt_lint::set_args), + Self::Scalafmt => (&scalafmt::COMMANDS, scalafmt::set_args), + Self::Scalariform => (&scalariform::COMMANDS, scalariform::set_args), + Self::Selene => (&selene::COMMANDS, selene::set_args), + Self::Shellcheck => (&shellcheck::COMMANDS, shellcheck::set_args), + Self::Shellharden => (&shellharden::COMMANDS, shellharden::set_args), + Self::Shfmt => (&shfmt::COMMANDS, shfmt::set_args), + Self::Sleek => (&sleek::COMMANDS, sleek::set_args), + Self::Smlfmt => (&smlfmt::COMMANDS, smlfmt::set_args), + Self::Snakefmt => (&snakefmt::COMMANDS, snakefmt::set_args), + Self::Solhint => (&solhint::COMMANDS, solhint::set_args), + Self::SqlFormatter => (&sql_formatter::COMMANDS, sql_formatter::set_args), + Self::SqlfluffFix => (&sqlfluff_fix::COMMANDS, sqlfluff_fix::set_args), + Self::SqlfluffFormat => (&sqlfluff_format::COMMANDS, sqlfluff_format::set_args), + Self::Sqlfmt => (&sqlfmt::COMMANDS, sqlfmt::set_args), + Self::Sqruff => (&sqruff::COMMANDS, sqruff::set_args), + Self::Standardjs => (&standardjs::COMMANDS, standardjs::set_args), + Self::Standardrb => (&standardrb::COMMANDS, standardrb::set_args), + Self::StatixCheck => (&statix_check::COMMANDS, statix_check::set_args), + Self::StatixFix => (&statix_fix::COMMANDS, statix_fix::set_args), + Self::Stylefmt => (&stylefmt::COMMANDS, stylefmt::set_args), + Self::Stylelint => (&stylelint::COMMANDS, stylelint::set_args), + Self::StylishHaskell => (&stylish_haskell::COMMANDS, stylish_haskell::set_args), + Self::Stylua => (&stylua::COMMANDS, stylua::set_args), + Self::SuperhtmlFmt => (&superhtml_fmt::COMMANDS, superhtml_fmt::set_args), + Self::SwiftFormat => (&swift_format::COMMANDS, swift_format::set_args), + Self::Swiftformat => (&swiftformat::COMMANDS, swiftformat::set_args), + Self::Taplo => (&taplo::COMMANDS, taplo::set_args), + Self::TemplFmt => (&templ_fmt::COMMANDS, templ_fmt::set_args), + Self::TerraformFmt => (&terraform_fmt::COMMANDS, terraform_fmt::set_args), + Self::TerragruntHclfmt => (&terragrunt_hclfmt::COMMANDS, terragrunt_hclfmt::set_args), + Self::TexFmt => (&tex_fmt::COMMANDS, tex_fmt::set_args), + Self::TlintFormat => (&tlint_format::COMMANDS, tlint_format::set_args), + Self::TofuFmt => (&tofu_fmt::COMMANDS, tofu_fmt::set_args), + Self::TomlSort => (&toml_sort::COMMANDS, toml_sort::set_args), + Self::Topiary => (&topiary::COMMANDS, topiary::set_args), + Self::TsStandard => (&ts_standard::COMMANDS, ts_standard::set_args), + Self::Tsqllint => (&tsqllint::COMMANDS, tsqllint::set_args), + Self::TwigCsFixerLint => (&twig_cs_fixer_lint::COMMANDS, twig_cs_fixer_lint::set_args), + Self::Typos => (&typos::COMMANDS, typos::set_args), + Self::Typstfmt => (&typstfmt::COMMANDS, typstfmt::set_args), + Self::Typstyle => (&typstyle::COMMANDS, typstyle::set_args), + Self::Ufmt => (&ufmt::COMMANDS, ufmt::set_args), + Self::UiuaFmt => (&uiua_fmt::COMMANDS, uiua_fmt::set_args), + Self::Unimport => (&unimport::COMMANDS, unimport::set_args), + Self::Usort => (&usort::COMMANDS, usort::set_args), + Self::VFmt => (&v_fmt::COMMANDS, v_fmt::set_args), + Self::VacuumLint => (&vacuum_lint::COMMANDS, vacuum_lint::set_args), + Self::VerylFmt => (&veryl_fmt::COMMANDS, veryl_fmt::set_args), + Self::VhdlStyleGuide => (&vhdl_style_guide::COMMANDS, vhdl_style_guide::set_args), + Self::WaFmt => (&wa_fmt::COMMANDS, wa_fmt::set_args), + Self::Wfindent => (&wfindent::COMMANDS, wfindent::set_args), + Self::Xmlformat => (&xmlformat::COMMANDS, xmlformat::set_args), + Self::Xmllint => (&xmllint::COMMANDS, xmllint::set_args), + Self::Xo => (&xo::COMMANDS, xo::set_args), + Self::Yamlfix => (&yamlfix::COMMANDS, yamlfix::set_args), + Self::Yamlfmt => (&yamlfmt::COMMANDS, yamlfmt::set_args), + Self::Yapf => (&yapf::COMMANDS, yapf::set_args), + Self::YewFmt => (&yew_fmt::COMMANDS, yew_fmt::set_args), + Self::ZigFmt => (&zig_fmt::COMMANDS, zig_fmt::set_args), + Self::ZiggyFmt => (&ziggy_fmt::COMMANDS, ziggy_fmt::set_args), + Self::Zprint => (&zprint::COMMANDS, zprint::set_args), + }; + + crate::execution::run_tools(commands, snippet_path, set_args_fn, timeout) } } diff --git a/mdsf/src/tools/mojo_format.rs b/mdsf/src/tools/mojo_format.rs index 1ae4bfef..0cf3e1c2 100644 --- a/mdsf/src/tools/mojo_format.rs +++ b/mdsf/src/tools/mojo_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/mypy.rs b/mdsf/src/tools/mypy.rs index 8435b120..a53f5a6a 100644 --- a/mdsf/src/tools/mypy.rs +++ b/mdsf/src/tools/mypy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/nginxbeautifier.rs b/mdsf/src/tools/nginxbeautifier.rs index 7aca5940..a23ac709 100644 --- a/mdsf/src/tools/nginxbeautifier.rs +++ b/mdsf/src/tools/nginxbeautifier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/nginxfmt.rs b/mdsf/src/tools/nginxfmt.rs index 822f56b8..8520b6e1 100644 --- a/mdsf/src/tools/nginxfmt.rs +++ b/mdsf/src/tools/nginxfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/nickel_format.rs b/mdsf/src/tools/nickel_format.rs index 3edae735..4d024615 100644 --- a/mdsf/src/tools/nickel_format.rs +++ b/mdsf/src/tools/nickel_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/nimpretty.rs b/mdsf/src/tools/nimpretty.rs index dfa70d0b..fdd33783 100644 --- a/mdsf/src/tools/nimpretty.rs +++ b/mdsf/src/tools/nimpretty.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ mod test_nimpretty { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/nixfmt.rs b/mdsf/src/tools/nixfmt.rs index 89f7aeb4..4c076b41 100644 --- a/mdsf/src/tools/nixfmt.rs +++ b/mdsf/src/tools/nixfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -78,7 +78,7 @@ buildPythonPackage rec { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/nixpkgs_fmt.rs b/mdsf/src/tools/nixpkgs_fmt.rs index e39e8f03..07d8a585 100644 --- a/mdsf/src/tools/nixpkgs_fmt.rs +++ b/mdsf/src/tools/nixpkgs_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -83,7 +83,7 @@ buildPythonPackage rec { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/nomad_fmt.rs b/mdsf/src/tools/nomad_fmt.rs index 292f5546..68f66a7f 100644 --- a/mdsf/src/tools/nomad_fmt.rs +++ b/mdsf/src/tools/nomad_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/nph.rs b/mdsf/src/tools/nph.rs index 6a86953c..80662b0d 100644 --- a/mdsf/src/tools/nph.rs +++ b/mdsf/src/tools/nph.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/npm_groovy_lint.rs b/mdsf/src/tools/npm_groovy_lint.rs index e7e03550..078796ee 100644 --- a/mdsf/src/tools/npm_groovy_lint.rs +++ b/mdsf/src/tools/npm_groovy_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -42,7 +42,7 @@ assert add(1, 2) == 3 crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/nufmt.rs b/mdsf/src/tools/nufmt.rs index 450a75c7..110d9849 100644 --- a/mdsf/src/tools/nufmt.rs +++ b/mdsf/src/tools/nufmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/ocamlformat.rs b/mdsf/src/tools/ocamlformat.rs index bf30e98e..45ad9a6f 100644 --- a/mdsf/src/tools/ocamlformat.rs +++ b/mdsf/src/tools/ocamlformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ let add a b = a + b crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/ocp_indent.rs b/mdsf/src/tools/ocp_indent.rs index 3904573a..1fca1cb5 100644 --- a/mdsf/src/tools/ocp_indent.rs +++ b/mdsf/src/tools/ocp_indent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -35,7 +35,7 @@ let add a b crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/odinfmt.rs b/mdsf/src/tools/odinfmt.rs index 8fb582eb..bd46b44b 100644 --- a/mdsf/src/tools/odinfmt.rs +++ b/mdsf/src/tools/odinfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/oelint_adv.rs b/mdsf/src/tools/oelint_adv.rs index 2343d353..59ae9f2e 100644 --- a/mdsf/src/tools/oelint_adv.rs +++ b/mdsf/src/tools/oelint_adv.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/opa_fmt.rs b/mdsf/src/tools/opa_fmt.rs index e025b25d..c5229bad 100644 --- a/mdsf/src/tools/opa_fmt.rs +++ b/mdsf/src/tools/opa_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/ormolu.rs b/mdsf/src/tools/ormolu.rs index 121ca795..2d88ecd8 100644 --- a/mdsf/src/tools/ormolu.rs +++ b/mdsf/src/tools/ormolu.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ addNumbers a b = do crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/oxlint.rs b/mdsf/src/tools/oxlint.rs index accd6536..48eaf079 100644 --- a/mdsf/src/tools/oxlint.rs +++ b/mdsf/src/tools/oxlint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/packer_fix.rs b/mdsf/src/tools/packer_fix.rs index c840ae88..b74de81d 100644 --- a/mdsf/src/tools/packer_fix.rs +++ b/mdsf/src/tools/packer_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/packer_fmt.rs b/mdsf/src/tools/packer_fmt.rs index 3860ebb6..b2a4b94c 100644 --- a/mdsf/src/tools/packer_fmt.rs +++ b/mdsf/src/tools/packer_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/perltidy.rs b/mdsf/src/tools/perltidy.rs index 7ac8d500..8f6c6c81 100644 --- a/mdsf/src/tools/perltidy.rs +++ b/mdsf/src/tools/perltidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/pg_format.rs b/mdsf/src/tools/pg_format.rs index acd35b7d..9dce076c 100644 --- a/mdsf/src/tools/pg_format.rs +++ b/mdsf/src/tools/pg_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/php_cs_fixer_fix.rs b/mdsf/src/tools/php_cs_fixer_fix.rs index cbba515e..1dba64ab 100644 --- a/mdsf/src/tools/php_cs_fixer_fix.rs +++ b/mdsf/src/tools/php_cs_fixer_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/phpcbf.rs b/mdsf/src/tools/phpcbf.rs index eb5b6e6a..55bbab8e 100644 --- a/mdsf/src/tools/phpcbf.rs +++ b/mdsf/src/tools/phpcbf.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/phpinsights_fix.rs b/mdsf/src/tools/phpinsights_fix.rs index bf0b3749..330d4ced 100644 --- a/mdsf/src/tools/phpinsights_fix.rs +++ b/mdsf/src/tools/phpinsights_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/pint.rs b/mdsf/src/tools/pint.rs index aa8cb796..31036568 100644 --- a/mdsf/src/tools/pint.rs +++ b/mdsf/src/tools/pint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/prettier.rs b/mdsf/src/tools/prettier.rs index 0efb4747..9d329bbb 100644 --- a/mdsf/src/tools/prettier.rs +++ b/mdsf/src/tools/prettier.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -50,7 +50,7 @@ mod test_prettier { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -80,7 +80,7 @@ mod test_prettier { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/pretty_php.rs b/mdsf/src/tools/pretty_php.rs index a097b569..e04692d8 100644 --- a/mdsf/src/tools/pretty_php.rs +++ b/mdsf/src/tools/pretty_php.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/prettypst.rs b/mdsf/src/tools/prettypst.rs index fc229255..ff5eb5b4 100644 --- a/mdsf/src/tools/prettypst.rs +++ b/mdsf/src/tools/prettypst.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/prisma_format.rs b/mdsf/src/tools/prisma_format.rs index b37fbe5b..af3357fb 100644 --- a/mdsf/src/tools/prisma_format.rs +++ b/mdsf/src/tools/prisma_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -46,7 +46,7 @@ mod test_prisma_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/protolint.rs b/mdsf/src/tools/protolint.rs index 6e5fd22f..5db6cc12 100644 --- a/mdsf/src/tools/protolint.rs +++ b/mdsf/src/tools/protolint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/ptop.rs b/mdsf/src/tools/ptop.rs index 156fc941..4adcc321 100644 --- a/mdsf/src/tools/ptop.rs +++ b/mdsf/src/tools/ptop.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/puppet_lint.rs b/mdsf/src/tools/puppet_lint.rs index e9ec5e67..307d4905 100644 --- a/mdsf/src/tools/puppet_lint.rs +++ b/mdsf/src/tools/puppet_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/purs_tidy.rs b/mdsf/src/tools/purs_tidy.rs index e7f8cf6e..c40563c7 100644 --- a/mdsf/src/tools/purs_tidy.rs +++ b/mdsf/src/tools/purs_tidy.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -51,7 +51,7 @@ main = do crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/purty.rs b/mdsf/src/tools/purty.rs index 66d6ec99..d0f15260 100644 --- a/mdsf/src/tools/purty.rs +++ b/mdsf/src/tools/purty.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/pycln.rs b/mdsf/src/tools/pycln.rs index 3395b14b..a4dc4f45 100644 --- a/mdsf/src/tools/pycln.rs +++ b/mdsf/src/tools/pycln.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -30,7 +30,7 @@ mod test_pycln { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/pycodestyle.rs b/mdsf/src/tools/pycodestyle.rs index 34a3e70c..95b7e6ab 100644 --- a/mdsf/src/tools/pycodestyle.rs +++ b/mdsf/src/tools/pycodestyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/pyink.rs b/mdsf/src/tools/pyink.rs index 164c4191..a02974d5 100644 --- a/mdsf/src/tools/pyink.rs +++ b/mdsf/src/tools/pyink.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ mod test_pyink { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/pyment.rs b/mdsf/src/tools/pyment.rs index 916a6acc..6dae9d84 100644 --- a/mdsf/src/tools/pyment.rs +++ b/mdsf/src/tools/pyment.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/qmlfmt.rs b/mdsf/src/tools/qmlfmt.rs index 13df1a7f..697892a0 100644 --- a/mdsf/src/tools/qmlfmt.rs +++ b/mdsf/src/tools/qmlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/quick_lint_js.rs b/mdsf/src/tools/quick_lint_js.rs index 7688edd2..1a3ec697 100644 --- a/mdsf/src/tools/quick_lint_js.rs +++ b/mdsf/src/tools/quick_lint_js.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/raco_fmt.rs b/mdsf/src/tools/raco_fmt.rs index f077af72..f132c365 100644 --- a/mdsf/src/tools/raco_fmt.rs +++ b/mdsf/src/tools/raco_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/refmt.rs b/mdsf/src/tools/refmt.rs index 911f03fc..5b7c7246 100644 --- a/mdsf/src/tools/refmt.rs +++ b/mdsf/src/tools/refmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/reformat_gherkin.rs b/mdsf/src/tools/reformat_gherkin.rs index fba73208..a6959eec 100644 --- a/mdsf/src/tools/reformat_gherkin.rs +++ b/mdsf/src/tools/reformat_gherkin.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/regal_fix.rs b/mdsf/src/tools/regal_fix.rs index 6115af57..94d2c486 100644 --- a/mdsf/src/tools/regal_fix.rs +++ b/mdsf/src/tools/regal_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/regal_lint.rs b/mdsf/src/tools/regal_lint.rs index 48b03a77..9dce14e2 100644 --- a/mdsf/src/tools/regal_lint.rs +++ b/mdsf/src/tools/regal_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/reorder_python_imports.rs b/mdsf/src/tools/reorder_python_imports.rs index 1541fb8c..f2a303b1 100644 --- a/mdsf/src/tools/reorder_python_imports.rs +++ b/mdsf/src/tools/reorder_python_imports.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/rescript_format.rs b/mdsf/src/tools/rescript_format.rs index 3dc19d70..0549a8e3 100644 --- a/mdsf/src/tools/rescript_format.rs +++ b/mdsf/src/tools/rescript_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -58,7 +58,7 @@ mod test_rescript_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/roc_format.rs b/mdsf/src/tools/roc_format.rs index 3c017888..8b1be509 100644 --- a/mdsf/src/tools/roc_format.rs +++ b/mdsf/src/tools/roc_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -50,7 +50,7 @@ main = crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/rstfmt.rs b/mdsf/src/tools/rstfmt.rs index 14baa476..f636bcf1 100644 --- a/mdsf/src/tools/rstfmt.rs +++ b/mdsf/src/tools/rstfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/rubocop.rs b/mdsf/src/tools/rubocop.rs index 3b5be60f..0ddc557b 100644 --- a/mdsf/src/tools/rubocop.rs +++ b/mdsf/src/tools/rubocop.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/rubyfmt.rs b/mdsf/src/tools/rubyfmt.rs index ce9fa09b..e5efc190 100644 --- a/mdsf/src/tools/rubyfmt.rs +++ b/mdsf/src/tools/rubyfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/ruff_check.rs b/mdsf/src/tools/ruff_check.rs index 1ff547fa..39bb12a7 100644 --- a/mdsf/src/tools/ruff_check.rs +++ b/mdsf/src/tools/ruff_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/ruff_format.rs b/mdsf/src/tools/ruff_format.rs index 4bea2b4a..cbf6012f 100644 --- a/mdsf/src/tools/ruff_format.rs +++ b/mdsf/src/tools/ruff_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -32,7 +32,7 @@ mod test_ruff_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/rufo.rs b/mdsf/src/tools/rufo.rs index 920df107..905a6542 100644 --- a/mdsf/src/tools/rufo.rs +++ b/mdsf/src/tools/rufo.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/rune_fmt.rs b/mdsf/src/tools/rune_fmt.rs index a65e165f..a5384e96 100644 --- a/mdsf/src/tools/rune_fmt.rs +++ b/mdsf/src/tools/rune_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/rustfmt.rs b/mdsf/src/tools/rustfmt.rs index 417142d4..ec0dccee 100644 --- a/mdsf/src/tools/rustfmt.rs +++ b/mdsf/src/tools/rustfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -38,7 +38,7 @@ mod test_rustfmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/rustywind.rs b/mdsf/src/tools/rustywind.rs index d9a61a82..8d2feb67 100644 --- a/mdsf/src/tools/rustywind.rs +++ b/mdsf/src/tools/rustywind.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/salt_lint.rs b/mdsf/src/tools/salt_lint.rs index ce739d70..a3c35cfb 100644 --- a/mdsf/src/tools/salt_lint.rs +++ b/mdsf/src/tools/salt_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/scalafmt.rs b/mdsf/src/tools/scalafmt.rs index 89d6436b..ab1d6243 100644 --- a/mdsf/src/tools/scalafmt.rs +++ b/mdsf/src/tools/scalafmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -40,7 +40,7 @@ mod test_scalafmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/scalariform.rs b/mdsf/src/tools/scalariform.rs index 62c3b26d..2cd08b41 100644 --- a/mdsf/src/tools/scalariform.rs +++ b/mdsf/src/tools/scalariform.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/selene.rs b/mdsf/src/tools/selene.rs index 1f4b84f2..60415406 100644 --- a/mdsf/src/tools/selene.rs +++ b/mdsf/src/tools/selene.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/shellcheck.rs b/mdsf/src/tools/shellcheck.rs index 916a8859..86ba9062 100644 --- a/mdsf/src/tools/shellcheck.rs +++ b/mdsf/src/tools/shellcheck.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/shellharden.rs b/mdsf/src/tools/shellharden.rs index 6fcc383d..1d391712 100644 --- a/mdsf/src/tools/shellharden.rs +++ b/mdsf/src/tools/shellharden.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/shfmt.rs b/mdsf/src/tools/shfmt.rs index 59d30f20..83ec16bd 100644 --- a/mdsf/src/tools/shfmt.rs +++ b/mdsf/src/tools/shfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -49,7 +49,7 @@ add() { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -89,7 +89,7 @@ add() { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -129,7 +129,7 @@ add() { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/sleek.rs b/mdsf/src/tools/sleek.rs index 8593a5c7..52bc3998 100644 --- a/mdsf/src/tools/sleek.rs +++ b/mdsf/src/tools/sleek.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/smlfmt.rs b/mdsf/src/tools/smlfmt.rs index b90e64c3..4202fb25 100644 --- a/mdsf/src/tools/smlfmt.rs +++ b/mdsf/src/tools/smlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/snakefmt.rs b/mdsf/src/tools/snakefmt.rs index 5c27f203..01be1b34 100644 --- a/mdsf/src/tools/snakefmt.rs +++ b/mdsf/src/tools/snakefmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/solhint.rs b/mdsf/src/tools/solhint.rs index 61e8c3b3..4df21bcf 100644 --- a/mdsf/src/tools/solhint.rs +++ b/mdsf/src/tools/solhint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/sql_formatter.rs b/mdsf/src/tools/sql_formatter.rs index 319734a8..5e66fedb 100644 --- a/mdsf/src/tools/sql_formatter.rs +++ b/mdsf/src/tools/sql_formatter.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -39,7 +39,7 @@ WHERE crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/sqlfluff_fix.rs b/mdsf/src/tools/sqlfluff_fix.rs index 0bc28438..4dec23c3 100644 --- a/mdsf/src/tools/sqlfluff_fix.rs +++ b/mdsf/src/tools/sqlfluff_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/sqlfluff_format.rs b/mdsf/src/tools/sqlfluff_format.rs index 6b38e893..b5bae4e5 100644 --- a/mdsf/src/tools/sqlfluff_format.rs +++ b/mdsf/src/tools/sqlfluff_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ WHERE foo = 'bar'; crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/sqlfmt.rs b/mdsf/src/tools/sqlfmt.rs index b95e3fc4..e85384da 100644 --- a/mdsf/src/tools/sqlfmt.rs +++ b/mdsf/src/tools/sqlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/sqruff.rs b/mdsf/src/tools/sqruff.rs index d3dc176a..79897ac8 100644 --- a/mdsf/src/tools/sqruff.rs +++ b/mdsf/src/tools/sqruff.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/standardjs.rs b/mdsf/src/tools/standardjs.rs index 993dd8af..5754bb3e 100644 --- a/mdsf/src/tools/standardjs.rs +++ b/mdsf/src/tools/standardjs.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/standardrb.rs b/mdsf/src/tools/standardrb.rs index fe089d99..aaa0bd0a 100644 --- a/mdsf/src/tools/standardrb.rs +++ b/mdsf/src/tools/standardrb.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/statix_check.rs b/mdsf/src/tools/statix_check.rs index 02eb45e6..c83891fe 100644 --- a/mdsf/src/tools/statix_check.rs +++ b/mdsf/src/tools/statix_check.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/statix_fix.rs b/mdsf/src/tools/statix_fix.rs index 9e617a0c..6aa4b471 100644 --- a/mdsf/src/tools/statix_fix.rs +++ b/mdsf/src/tools/statix_fix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/stylefmt.rs b/mdsf/src/tools/stylefmt.rs index 731c29a7..d4b63956 100644 --- a/mdsf/src/tools/stylefmt.rs +++ b/mdsf/src/tools/stylefmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -97,7 +97,7 @@ padding: 12px crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); @@ -227,7 +227,7 @@ table { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/stylelint.rs b/mdsf/src/tools/stylelint.rs index 3f566459..9929fe40 100644 --- a/mdsf/src/tools/stylelint.rs +++ b/mdsf/src/tools/stylelint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/stylish_haskell.rs b/mdsf/src/tools/stylish_haskell.rs index c455b57d..6f82eb12 100644 --- a/mdsf/src/tools/stylish_haskell.rs +++ b/mdsf/src/tools/stylish_haskell.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -36,7 +36,7 @@ addNumbers a b = do crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/stylua.rs b/mdsf/src/tools/stylua.rs index 3fff8083..30abeae3 100644 --- a/mdsf/src/tools/stylua.rs +++ b/mdsf/src/tools/stylua.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -46,7 +46,7 @@ end crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/superhtml_fmt.rs b/mdsf/src/tools/superhtml_fmt.rs index 725e4707..214412b7 100644 --- a/mdsf/src/tools/superhtml_fmt.rs +++ b/mdsf/src/tools/superhtml_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ mod test_superhtml_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/swift_format.rs b/mdsf/src/tools/swift_format.rs index 9fc1afa6..2936f56d 100644 --- a/mdsf/src/tools/swift_format.rs +++ b/mdsf/src/tools/swift_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ mod test_swift_format { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/swiftformat.rs b/mdsf/src/tools/swiftformat.rs index dd147979..5a032748 100644 --- a/mdsf/src/tools/swiftformat.rs +++ b/mdsf/src/tools/swiftformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -34,7 +34,7 @@ mod test_swiftformat { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/taplo.rs b/mdsf/src/tools/taplo.rs index 7d7ce7ca..217f02e8 100644 --- a/mdsf/src/tools/taplo.rs +++ b/mdsf/src/tools/taplo.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ author = "Mads Hougesen" crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/templ_fmt.rs b/mdsf/src/tools/templ_fmt.rs index 211c7e4d..b4b3ff0d 100644 --- a/mdsf/src/tools/templ_fmt.rs +++ b/mdsf/src/tools/templ_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/terraform_fmt.rs b/mdsf/src/tools/terraform_fmt.rs index 07f2e475..cedcee8b 100644 --- a/mdsf/src/tools/terraform_fmt.rs +++ b/mdsf/src/tools/terraform_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -42,7 +42,7 @@ mod test_terraform_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/terragrunt_hclfmt.rs b/mdsf/src/tools/terragrunt_hclfmt.rs index f13f28b1..8f45037d 100644 --- a/mdsf/src/tools/terragrunt_hclfmt.rs +++ b/mdsf/src/tools/terragrunt_hclfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/tex_fmt.rs b/mdsf/src/tools/tex_fmt.rs index 3972e036..414bdd08 100644 --- a/mdsf/src/tools/tex_fmt.rs +++ b/mdsf/src/tools/tex_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/tlint_format.rs b/mdsf/src/tools/tlint_format.rs index e0589cca..dcd404ef 100644 --- a/mdsf/src/tools/tlint_format.rs +++ b/mdsf/src/tools/tlint_format.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/tofu_fmt.rs b/mdsf/src/tools/tofu_fmt.rs index 9c725496..41857277 100644 --- a/mdsf/src/tools/tofu_fmt.rs +++ b/mdsf/src/tools/tofu_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -42,7 +42,7 @@ mod test_tofu_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/toml_sort.rs b/mdsf/src/tools/toml_sort.rs index 300c409b..c97ccdc3 100644 --- a/mdsf/src/tools/toml_sort.rs +++ b/mdsf/src/tools/toml_sort.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/topiary.rs b/mdsf/src/tools/topiary.rs index c23e5dec..cc0f235c 100644 --- a/mdsf/src/tools/topiary.rs +++ b/mdsf/src/tools/topiary.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -47,7 +47,7 @@ mod test_topiary { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/ts_standard.rs b/mdsf/src/tools/ts_standard.rs index 022eda36..0b82cd4b 100644 --- a/mdsf/src/tools/ts_standard.rs +++ b/mdsf/src/tools/ts_standard.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/tsqllint.rs b/mdsf/src/tools/tsqllint.rs index 0901c3e5..f2d18daa 100644 --- a/mdsf/src/tools/tsqllint.rs +++ b/mdsf/src/tools/tsqllint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/twig_cs_fixer_lint.rs b/mdsf/src/tools/twig_cs_fixer_lint.rs index 07260aa6..de729e5a 100644 --- a/mdsf/src/tools/twig_cs_fixer_lint.rs +++ b/mdsf/src/tools/twig_cs_fixer_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/typos.rs b/mdsf/src/tools/typos.rs index 18f66df0..da2b16cd 100644 --- a/mdsf/src/tools/typos.rs +++ b/mdsf/src/tools/typos.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ mod test_typos { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/typstfmt.rs b/mdsf/src/tools/typstfmt.rs index 65ed4368..fc37c322 100644 --- a/mdsf/src/tools/typstfmt.rs +++ b/mdsf/src/tools/typstfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/typstyle.rs b/mdsf/src/tools/typstyle.rs index 2ea76a12..112ff5db 100644 --- a/mdsf/src/tools/typstyle.rs +++ b/mdsf/src/tools/typstyle.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/ufmt.rs b/mdsf/src/tools/ufmt.rs index 42b0ffd3..7039e9e9 100644 --- a/mdsf/src/tools/ufmt.rs +++ b/mdsf/src/tools/ufmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/uiua_fmt.rs b/mdsf/src/tools/uiua_fmt.rs index 5b63c30a..6f5b7b24 100644 --- a/mdsf/src/tools/uiua_fmt.rs +++ b/mdsf/src/tools/uiua_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/unimport.rs b/mdsf/src/tools/unimport.rs index 159b72dd..4662ec55 100644 --- a/mdsf/src/tools/unimport.rs +++ b/mdsf/src/tools/unimport.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/usort.rs b/mdsf/src/tools/usort.rs index 8e6d9487..e2383a09 100644 --- a/mdsf/src/tools/usort.rs +++ b/mdsf/src/tools/usort.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -45,7 +45,7 @@ def add(a: int, b: int) -> int: crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/v_fmt.rs b/mdsf/src/tools/v_fmt.rs index 9b07ca14..8f7853d8 100644 --- a/mdsf/src/tools/v_fmt.rs +++ b/mdsf/src/tools/v_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/vacuum_lint.rs b/mdsf/src/tools/vacuum_lint.rs index eb96491c..cf7c217e 100644 --- a/mdsf/src/tools/vacuum_lint.rs +++ b/mdsf/src/tools/vacuum_lint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/veryl_fmt.rs b/mdsf/src/tools/veryl_fmt.rs index f5129b6b..4cd84cc6 100644 --- a/mdsf/src/tools/veryl_fmt.rs +++ b/mdsf/src/tools/veryl_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -79,7 +79,7 @@ pub module Delay #( // visibility control by `pub` keyword crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/vhdl_style_guide.rs b/mdsf/src/tools/vhdl_style_guide.rs index b697b38f..38b562c5 100644 --- a/mdsf/src/tools/vhdl_style_guide.rs +++ b/mdsf/src/tools/vhdl_style_guide.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/wa_fmt.rs b/mdsf/src/tools/wa_fmt.rs index cbd2e706..3b3ebff1 100644 --- a/mdsf/src/tools/wa_fmt.rs +++ b/mdsf/src/tools/wa_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/wfindent.rs b/mdsf/src/tools/wfindent.rs index 42224afe..f6ed429a 100644 --- a/mdsf/src/tools/wfindent.rs +++ b/mdsf/src/tools/wfindent.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/xmlformat.rs b/mdsf/src/tools/xmlformat.rs index 8b684720..1d64fa05 100644 --- a/mdsf/src/tools/xmlformat.rs +++ b/mdsf/src/tools/xmlformat.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -40,7 +40,7 @@ mod test_xmlformat { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/xmllint.rs b/mdsf/src/tools/xmllint.rs index 343a6515..a64082d7 100644 --- a/mdsf/src/tools/xmllint.rs +++ b/mdsf/src/tools/xmllint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -44,7 +44,7 @@ mod test_xmllint { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/xo.rs b/mdsf/src/tools/xo.rs index 158d6568..2711b811 100644 --- a/mdsf/src/tools/xo.rs +++ b/mdsf/src/tools/xo.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/yamlfix.rs b/mdsf/src/tools/yamlfix.rs index 6562103e..a64ef38b 100644 --- a/mdsf/src/tools/yamlfix.rs +++ b/mdsf/src/tools/yamlfix.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -65,7 +65,7 @@ updates: crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/yamlfmt.rs b/mdsf/src/tools/yamlfmt.rs index df03727b..a3942b38 100644 --- a/mdsf/src/tools/yamlfmt.rs +++ b/mdsf/src/tools/yamlfmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -67,7 +67,7 @@ updates: crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/yapf.rs b/mdsf/src/tools/yapf.rs index 725f5643..0dd559f5 100644 --- a/mdsf/src/tools/yapf.rs +++ b/mdsf/src/tools/yapf.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -31,7 +31,7 @@ mod test_yapf { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/yew_fmt.rs b/mdsf/src/tools/yew_fmt.rs index b83af6fe..0e603d1e 100644 --- a/mdsf/src/tools/yew_fmt.rs +++ b/mdsf/src/tools/yew_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -38,7 +38,7 @@ mod test_yew_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/zig_fmt.rs b/mdsf/src/tools/zig_fmt.rs index 357d41af..11f4b82d 100644 --- a/mdsf/src/tools/zig_fmt.rs +++ b/mdsf/src/tools/zig_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -37,7 +37,7 @@ mod test_zig_fmt { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some"); diff --git a/mdsf/src/tools/ziggy_fmt.rs b/mdsf/src/tools/ziggy_fmt.rs index 471301a9..1dce937f 100644 --- a/mdsf/src/tools/ziggy_fmt.rs +++ b/mdsf/src/tools/ziggy_fmt.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { diff --git a/mdsf/src/tools/zprint.rs b/mdsf/src/tools/zprint.rs index 4dd6a6f4..aa3b8af5 100644 --- a/mdsf/src/tools/zprint.rs +++ b/mdsf/src/tools/zprint.rs @@ -4,7 +4,7 @@ use crate::runners::CommandType; #[inline] -pub fn set_arguments( +pub fn set_args( mut cmd: std::process::Command, file_path: &std::path::Path, ) -> std::process::Command { @@ -52,7 +52,7 @@ mod test_zprint { crate::execution::setup_snippet(input, &file_ext).expect("it to create a snippet file"); let result = - crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_arguments, 0) + crate::execution::run_tools(&super::COMMANDS, snippet.path(), super::set_args, 0) .expect("it to be successful") .1 .expect("it to be some");