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.31k stars 1.75k forks source link

feat(`forge build -v`): If verbosity level is 1 or higher, it shows dirty files. #9325

Open mgiagante opened 16 hours ago

mgiagante commented 16 hours ago

Closes #7888

This PR is to address Issue 7888 by leveraging the new global verbosity level flag implemented by https://github.com/foundry-rs/foundry/pull/9273

Motivation

This aims to provide users with a way to see which files have changes relative to what's cached, and thus are effectively picked up by the compiler when running forge build.

Solution

If forge build -v is run, this will set the verbosity level to 1. A level of 1 or higher (with additional v's) will display the list of files being compiled.

zerosnacks commented 6 hours ago

thank you! I think this could also close #9304 so when passing -v flag avoids confusion re files that are compiled, @zerosnacks wdyt?

Supportive, I think a warning here would still be beneficial as well as this -v flag would indicate the files being compiled but that doesn't offer an explanation as to why they are. I think raising a warning on the fallback trigger (if a path is specified) would still be the right way but this PR is in the right direction