Skip to main content

run_shellcheck_linter

Function run_shellcheck_linter 

Source
pub fn run_shellcheck_linter() -> Result<()>
Expand description

Run the ShellCheck linter

ยงErrors

Returns an error if shellcheck is not available, cannot be installed, or if the linting fails.

Examples found in repository?
examples/custom_cli.rs (line 50)
30fn main() -> Result<()> {
31    // Initialize logging (you can customize this)
32    torrust_linting::init_tracing();
33
34    let cli = Cli::parse();
35
36    match cli.command {
37        Commands::Rust => {
38            println!("๐Ÿฆ€ Running Rust linters...");
39            run_clippy_linter()?;
40            run_rustfmt_linter()?;
41        }
42        Commands::Markup => {
43            println!("๐Ÿ“„ Running markup linters...");
44            run_markdown_linter()?;
45            run_yaml_linter()?;
46            run_toml_linter()?;
47        }
48        Commands::Shell => {
49            println!("๐Ÿš Running shell script linter...");
50            run_shellcheck_linter()?;
51        }
52    }
53
54    println!("โœ… All selected linters passed!");
55    Ok(())
56}