You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sources/reference/cli/fmt.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,13 @@ Otherwise, `fmt` reads and formats the file from disk specified by the argument.
29
29
The `--write` flag can be specified to replace the contents of the original file on disk with the formatted results.
30
30
`--write` can only be provided when `fmt` isn't reading from standard input.
31
31
32
+
The `--test` flag can be specified to test if the contents of the file are formatted correctly.
33
+
34
+
The `--write` and `--test` flags are mutually exclusive.
35
+
32
36
The command fails if the file being formatted has syntactically incorrect {{< param "PRODUCT_NAME" >}} configuration, but doesn't validate whether {{< param "PRODUCT_NAME" >}} components are configured properly.
33
37
34
38
The following flags are supported:
35
39
36
40
*`--write`, `-w`: Write the formatted file back to disk when not reading from standard input.
41
+
*`--test`, `-t`: Only test the input and return a non-zero exit code if changes would have been made.
0 commit comments