Support --pretty-json
and --json-indent
for all CLI options
#12011
Labels
closed due inactivity
The issue/PR was automatically closed due to inactivity.
easy difficulty
good first issue candidate
Could be a "good first issue" but something is blocking it or it has open questions.
stale
The issue/PR was marked as stale because it has been open for too long.
In #11583 we made
--pretty-print
affect Standard JSON and also added the--json-indent
option. There are still some command-line options that ignore these:--asm-json
--ast-compact-json
--abi
--userdoc
--devdoc
--storage-layout
--metadata
Some of them always pretty-print the JSON but with hard-coded indent size, some do not pretty-print at all. Change them all so that by default the JSON output is compact and changes when
--pretty-print
/json-indent
is used.We might want to exempt
--metadata
from this since we embed its hash in the bytecode and a pretty-printed version would not match it. But maybe that's ok - it's meant to be reproducible and being able to easily inspect it is also important. And in any case--combined-json metadata
does get affected by--pretty-print
so we already have this problem.After changing it, we'll need to add pretty printing options to command-line tests to keep them readable. Alternatively, we could implement #7665 first.
Backwards Compatibility
I don't think that we guarantee stable JSON formatting between versions so I'd say this is not breaking.
Changing the formatting for
--metadata
might affect tools that hash its output but also use--pretty-json
to get nice output from--combined-json
at the same time. I think it's a pretty obscure case though.The text was updated successfully, but these errors were encountered: