summaryrefslogtreecommitdiff
path: root/cli/tools/fmt.rs
diff options
context:
space:
mode:
authorZheyu Zhang <zheyuzhang03@gmail.com>2021-10-31 01:20:56 +0800
committerGitHub <noreply@github.com>2021-10-30 19:20:56 +0200
commit3fb23ab772e87b9314cd8608eb589c72a53efaee (patch)
tree702262c57f3ac3c32046e6443983f58d6c962686 /cli/tools/fmt.rs
parent94a81e5e9bda5a7da51bc864e544bf35ef26910e (diff)
fix(cli): linter/formater watches current directory without args (#12550)
Diffstat (limited to 'cli/tools/fmt.rs')
-rw-r--r--cli/tools/fmt.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs
index 2cc276c5b..d70c95d29 100644
--- a/cli/tools/fmt.rs
+++ b/cli/tools/fmt.rs
@@ -73,6 +73,10 @@ pub async fn format(
}
}
+ if include_files.is_empty() {
+ include_files = [std::env::current_dir()?].to_vec();
+ }
+
// Now do the same for options
let fmt_options = resolve_fmt_options(
&fmt_flags,