diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs b/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs index 8504a924544..fa0f4cef7bf 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs @@ -17,18 +17,17 @@ async fn prettier(shell: Shell, extension: Extension, check: bool) -> anyhow::Re let spinner = Spinner::new(&msg_running_fmt_for_extension_spinner(extension)); let files = get_unignored_files(&shell, &extension)?; + if files.is_empty() { + return Ok(()); + } + spinner.freeze(); let mode = if check { "--check" } else { "--write" }; - let glob = format!("**/*.{extension}"); let config = format!("etc/prettier-config/{extension}.js"); - Ok(Cmd::new( - cmd!( - shell, - "yarn --silent prettier {glob} {mode} --config {config}" - ) - .args(files), + Ok( + Cmd::new(cmd!(shell, "yarn --silent prettier {mode} --config {config}").args(files)) + .run()?, ) - .run()?) } async fn prettier_contracts(shell: Shell, check: bool) -> anyhow::Result<()> { diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs b/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs index 7b910041185..92fac6ea815 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs @@ -43,7 +43,7 @@ pub enum Extension { pub fn get_unignored_files(shell: &Shell, extension: &Extension) -> anyhow::Result> { let mut files = Vec::new(); - let output = cmd!(shell, "git ls-files").read()?; + let output = cmd!(shell, "git ls-files --recurse-submodules").read()?; for line in output.lines() { let path = line.to_string();