Sitelet https://web.archive.org/web/20210806010210/https://github.com/ethereum/solidity/issues/11583
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make --pretty-json work with Standard JSON output #11583

Closed
cameel opened this issue Jun 26, 2021 · 1 comment
Closed

Make --pretty-json work with Standard JSON output #11583

cameel opened this issue Jun 26, 2021 · 1 comment

Comments

@cameel
Copy link
Member

@cameel cameel commented Jun 26, 2021

By default the compiler prints any JSON output in a compact form:

echo "contract C {}" | solc - --combined-json abi
{"contracts":{"<stdin>:C":{"abi":[]}},"version":"0.8.6+commit.11564f7e.Linux.g++"}

You can use --pretty-json option to get nicely indented output from --combined-json option:

echo "contract C {}" | solc - --combined-json abi --pretty-json
{
  "contracts":
  {
    "<stdin>:C":
    {
      "abi": []
    }
  },
  "version": "0.8.6+commit.11564f7e.Linux.g++"
}

This does not work with --standard-json. Make --pretty-json affect it too.

Optionally, it would also be nice if you could specify the indent size for the option to make the output easier to read (e.g. --pretty-json 4).

@cameel cameel added this to To do in SOLC Overhaul via automation Jun 26, 2021
@cameel cameel added this to New issues in Solidity via automation Jun 26, 2021
@cameel cameel moved this from New issues to Implementation Backlog in Solidity Jun 26, 2021
@cameel
Copy link
Member Author

@cameel cameel commented Jun 26, 2021

Once this is done, we could also make test/cmdlineTest.sh use that option to print test output in a more readable way.

@cameel cameel changed the title Make --pretty-json affect Standard JSON output Make --pretty-json work with Standard JSON output Jun 26, 2021
sladecek added a commit to sladecek/solidity that referenced this issue Jul 3, 2021
@ethereum ethereum deleted a comment Jul 5, 2021
sladecek added a commit to sladecek/solidity that referenced this issue Jul 6, 2021
sladecek added a commit to sladecek/solidity that referenced this issue Jul 6, 2021
sladecek added a commit to sladecek/solidity that referenced this issue Jul 6, 2021
Solidity automation moved this from Implementation Backlog to Done Jul 26, 2021
SOLC Overhaul automation moved this from To do to Done Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Solidity
  
Done
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant