-
Notifications
You must be signed in to change notification settings - Fork 481
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
[solcjs] --pretty-json
and --verbose
options
#534
Conversation
if (program.verbose) | ||
console.log('>>> Retrying compilation with SMT:\n' + toFormattedJson(inputJSON) + "\n") | ||
output = reformatJsonIfRequested(solc.compile(JSON.stringify(inputJSON), callbacks)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leonardoalt This is a bit off-topic in this PR, but why do we have to retry here? Can't it be detected based on input alone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal and changes look ok to me (except the question to @leonardoalt), but I am a bit wary of adding too many features here, as that also means maintaining them.
I'd also suggest to ensure the options which are available match 100% with solc.
9ecef3a
to
aa49a83
Compare
These two are actually worth it in my opinion. Maintenance cost is minimal and they save time when debugging solc-js.
They're unfortunately not but I think they're close enough.
|
I guess as long as the behaviour is not different (just lacks features) it is fine. |
Somewhat related to ethereum/solidity#11583.
This PR adds two options
--pretty-print
- we already have that in solc and soon it will work for Standard jSON too (Make --pretty-json work with Standard JSON output solidity#11639).--verbose
- prints extra info, most importantly the Standard JSON input to the compiler. It's most useful when not using--standard-json
option because then it's the script that constructs the input JSON. I wanted to see it pretty much every time I was solving a problem with solc-js and I always ended up hacking it in with debug prints. Having this as an option would make working with solc-js much more convenient for me and I think it might be useful for others too.