-
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): export gas reports #887
Conversation
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.
--gre
is essentially > <output>
right?
pub fn new(report_for: Vec<String>, export: bool) -> Self { | ||
Self { report_for, stdout: !export, ..Default::default() } |
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.
should this rather be colors
?
if gas_reporting_export { | ||
let table_view = format!("{}", gas_report); | ||
if let Err(e) = std::fs::write(".gas-report", table_view) { | ||
println!( |
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.
println!( | |
eprintln!( |
@transmissions11 what is the recommended way for moving forward with this? |
imo we should remove forge test --gas-report entirely (and not add this new --gas-report-export flag) and swap out the logic in forge snapshot to output these gas report tables into the .gas-snapshot file instead of the per test breakdown the telegram seems to agree as well i can probably do that with this PR as a base this week unless anyone wants to frontrun me |
Sounds great! Let's go with that then. |
supportive of that |
Yeah printing to a file should be without colors! |
Closing in support of @transmissions11 integrating this functionality as part of |
Adds the ability to export gas reports to
.gas-report
via cli input--gas-report-export
or--gre