Skip to content

Commit 82c489f

Browse files
committed
Auto merge of #14677 - weihanglo:message-format, r=epage
docs: tools should only interpret a line starting with `{` as JSON
2 parents de128be + 402cb17 commit 82c489f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/doc/src/reference/external-tools.md

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ The `package_id` field is a unique identifier for referring to the package, and
4646
as the `--package` argument to many commands. The syntax grammar can be found in
4747
chapter [Package ID Specifications].
4848

49+
> **Note:** `--message-format=json` only controls Cargo and Rustc's output.
50+
> This cannot control the output of other tools,
51+
> e.g. `cargo run --message-format=json`,
52+
> or arbitrary output from procedural macros.
53+
> A possible workaround in these situations is to only interpret a line as JSON if it starts with `{`.
54+
4955
The `--message-format` option can also take additional formatting values which
5056
alter the way the JSON messages are computed and rendered. See the description
5157
of the `--message-format` option in the [build command documentation] for more

0 commit comments

Comments
 (0)