foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.33k stars 1.76k forks source link

feat: add global `--json` flag #9244

Closed zerosnacks closed 2 weeks ago

zerosnacks commented 3 weeks ago

Motivation

Related: https://github.com/foundry-rs/foundry/issues/8794

Adds a global --json flag on the Shell level

Solution

Ideally we would have a FormatChoice similar to ColorChoice but to avoid breaking changes the current approach is preferred.

Whilst JSON output is currently not supported everywhere this makes it easier to support it going forward. A future PR aims to correct the flag compatibility for all arguments making support / non-support explicit to the user.

DaniPopes commented 3 weeks ago

I think we should really just drop -j as short for json, it is not common anywhere and usually means jobs (threads), like in makefile

grandizzy commented 2 weeks ago

I think we should really just drop -j as short for json, it is not common anywhere and usually means jobs (threads), like in makefile

makes sense, we introduced -j for tests jobs already and dropped it from json