1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00

feat: add --check for deno fmt (#3369)

This commit is contained in:
罗文 2019-11-19 02:19:59 +08:00 committed by Ry Dahl
parent 5671d38d8f
commit 542ec461c4

View file

@ -340,6 +340,12 @@ Automatically downloads Prettier dependencies on first run.
deno fmt myfile1.ts myfile2.ts",
)
.arg(
Arg::with_name("check")
.long("check")
.help("Check if the source files are formatted.")
.takes_value(false),
)
.arg(
Arg::with_name("prettierrc")
.long("prettierrc")
@ -992,6 +998,7 @@ pub fn flags_from_vec(
}
let prettier_flags = [
["0", "check"],
["1", "prettierrc"],
["1", "ignore-path"],
["1", "print-width"],
@ -2088,6 +2095,7 @@ mod tests {
let (flags, subcommand, argv) = flags_from_vec(svec![
"deno",
"fmt",
"--check",
"--prettierrc=auto",
"--print-width=100",
"--tab-width=4",
@ -2119,6 +2127,7 @@ mod tests {
PRETTIER_URL,
"script.ts",
"--write",
"--check",
"--config",
"auto",
"--ignore-path",