Skip to content

Commit

Permalink
removed glob, added submodules files
Browse files Browse the repository at this point in the history
  • Loading branch information
sanekmelnikov committed Aug 20, 2024
1 parent 9e13cbc commit 259934a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions zk_toolbox/crates/zk_supervisor/src/commands/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down
2 changes: 1 addition & 1 deletion zk_toolbox/crates/zk_supervisor/src/commands/lint_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub enum Extension {

pub fn get_unignored_files(shell: &Shell, extension: &Extension) -> anyhow::Result<Vec<String>> {
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();
Expand Down

0 comments on commit 259934a

Please sign in to comment.