foundry
foundry copied to clipboard
Make `--gas-report` w/ `--json` output one JSON blob and add `contract_path` to output
Component
Forge
Describe the feature you would like
Follow up of https://github.com/foundry-rs/foundry/pull/9063
Ref: https://github.com/foundry-rs/foundry/pull/9063#issuecomment-2411355213
the emitted json data loses the contract path completely, which is unfortunate as in projects with more than one contracts this information is actually quite important. Especially if multiple contracts have the same signatures it's becoming impossible to distinguish.
the emitted json is not valid json - each line for itself, yes, but the overall generated output is not(as it's missing separators and a bounding array). Imo the goal should be that piping forge test --gas-report --json > some.json, i receive a valid json i can post-process.
cc @sakulstra
Additional context
No response