Skip to content
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

Output to a readable file? #91

Closed
liron-navon opened this issue Feb 1, 2022 · 2 comments
Closed

Output to a readable file? #91

liron-navon opened this issue Feb 1, 2022 · 2 comments

Comments

@liron-navon
Copy link

can we make an output to MD/HTML? anything that is a bit more human readable? it is seen nicely in the console, but is not readable once it's a file, also maybe JSON/XML? to make it machine-readable more easily?

@cgewecke
Copy link
Owner

cgewecke commented Feb 1, 2022

Hi @liron-navon

it is seen nicely in the console, but is not readable once it's a file,

Are you seeing the table mangled with extra characters? If so you can prevent that by setting the noColors option to true.

Alternative formats is a great idea and there is some prior work in this direction:

  • an .md formatted table used to represent the data in the Github UI for people using the codechecks integration is generated at eth-gas-reporter in lib/codechecksReport.js.
  • a reStructured text formatted table (useful for ReadTheDocs) can be generated by using the rst option.

Lastly, the gas reporter writes all the data it collects to a JSON file at ./gasReporterOutput.json whenever the environment variable CI is set to true. This might be useful for experimenting with alternative table formats.

@cgewecke cgewecke mentioned this issue Feb 27, 2024
54 tasks
@cgewecke
Copy link
Owner

Markdown was added in the latest version (2.0). If someone is interested in adding HTML am happy to accept a pull request - there's architecture in place for arbitrary output formats in the codebase now.

Closing for now.

https://github.com/cgewecke/hardhat-gas-reporter/releases/tag/v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants