-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(forge build -vvvvv
): If verbosity level is 5 or higher show files to compile
#9325
feat(forge build -vvvvv
): If verbosity level is 5 or higher show files to compile
#9325
Conversation
forge build -v
): If verbosity level is 1 or higher, it shows dirty files.
forge build -v
): If verbosity level is 1 or higher, it shows dirty files.forge build -v
): If verbosity level is 1 or higher, it shows dirty files.
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.
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 |
@zerosnacks @grandizzy is there currently a way to write tests for this? I've tried the tests in |
@mgiagante I think that's fine without a test, sorry for back and forth, could you remove the newly added variant |
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.
thank you! pending one more review before merging
…te/foundry into show-compiled-files-when-verbose
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.
Made some minor modifications to the rendered output
Now renders as (path trimmed, sorted, prefixed):
[⠊] Compiling...
[⠒] Files to compile:
- lib/forge-std/src/Base.sol
- lib/forge-std/src/Script.sol
- lib/forge-std/src/StdAssertions.sol
- lib/forge-std/src/StdChains.sol
- lib/forge-std/src/StdCheats.sol
- lib/forge-std/src/StdError.sol
- lib/forge-std/src/StdInvariant.sol
- lib/forge-std/src/StdJson.sol
- lib/forge-std/src/StdMath.sol
- lib/forge-std/src/StdStorage.sol
- lib/forge-std/src/StdStyle.sol
- lib/forge-std/src/StdToml.sol
- lib/forge-std/src/StdUtils.sol
- lib/forge-std/src/Test.sol
- lib/forge-std/src/Vm.sol
- lib/forge-std/src/console.sol
- lib/forge-std/src/console2.sol
- lib/forge-std/src/interfaces/IERC165.sol
- lib/forge-std/src/interfaces/IERC20.sol
- lib/forge-std/src/interfaces/IERC721.sol
- lib/forge-std/src/interfaces/IMulticall3.sol
- lib/forge-std/src/mocks/MockERC20.sol
- lib/forge-std/src/mocks/MockERC721.sol
- lib/forge-std/src/safeconsole.sol
- script/Counter.s.sol
- src/Counter.sol
- src/Counter2.sol
- src/Counter3.sol
- src/Counter4.sol
- test/Counter.t.sol
[⠒] Compiling 30 files with Solc 0.8.28
[⠆] Solc 0.8.28 finished in 950.06ms
Compiler run successful!
As opposed to
[⠒] Compiling files
[⠊] Compiling...
[⠒] Compiling files
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdChains.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/interfaces/IERC165.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/Test.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/interfaces/IERC20.sol
/home/zerosnacks/Projects/counter/src/Counter.sol
/home/zerosnacks/Projects/counter/src/Counter3.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/interfaces/IERC721.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdStyle.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdToml.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/mocks/MockERC721.sol
/home/zerosnacks/Projects/counter/test/Counter.t.sol
/home/zerosnacks/Projects/counter/src/Counter2.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/Base.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/mocks/MockERC20.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdError.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdMath.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdCheats.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/Vm.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdInvariant.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/Script.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/interfaces/IMulticall3.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/console2.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/console.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdStorage.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdAssertions.sol
/home/zerosnacks/Projects/counter/src/Counter4.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/safeconsole.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdJson.sol
/home/zerosnacks/Projects/counter/lib/forge-std/src/StdUtils.sol
/home/zerosnacks/Projects/counter/script/Counter.s.sol
[⠢] Compiling 30 files with Solc 0.8.28
[⠆] Solc 0.8.28 finished in 984.73ms
Compiler run successful
cc @grandizzy
forge build -v
): If verbosity level is 1 or higher, it shows dirty files.forge build -v
): If verbosity level is 1 or higher show files to compile
This is extremely verbose, and it is common for verbosity to be set to 2 or 3 when running I'd argue this should be like a trace level log, so 5 or above |
forge build -v
): If verbosity level is 1 or higher show files to compileforge build -vvvvv
): If verbosity level is 5 or higher show files to compile
That makes a lot of sense. I'll go with 5 then. |
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Hmm.. yeah this is not great. For now let's do Ideally we would have a way to distinguish if the user intentionally runs |
Just created #9340 to track this. |
…les to compile (foundry-rs#9325) * If verbosity level is 1 or higher, it shows dirty files. * Adds verbose message variant for compilation. * Removing `if..else` statement to always display `self.send_msg`. * Changes order of messages. * Removes semicolons and adds comment on message order. * Removes verbose variant in favor of the already existing variant. * nits, sort the dirty files list and prefix with - * Raises verbosity level to 5+ * Update crates/common/src/term.rs Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> --------- Co-authored-by: mgiagante <251503-mgiagante@users.noreply.gitlab.com> Co-authored-by: zerosnacks <zerosnacks@protonmail.com> Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Closes #7888
This PR is to address Issue 7888 by leveraging the new global verbosity level flag implemented by #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.