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

Add forc plugins command flag for outputting JSON or TOML for easier machine readability #1216

Open
mitchmindtree opened this issue Apr 11, 2022 · 3 comments
Labels
enhancement New feature or request forc good first issue Good for newcomers P: low

Comments

@mitchmindtree
Copy link
Contributor

This would potentially make it easier for downstream tooling to integrate with forc plugins.

Follow-up to #1199.

@mitchmindtree mitchmindtree added enhancement New feature or request good first issue Good for newcomers forc labels Apr 11, 2022
@adlerjohn adlerjohn moved this to Todo in Fuel Network Apr 11, 2022
@kayagokalp
Copy link
Member

kayagokalp commented May 4, 2022

Is this still relevant? If so maybe we can clarify this a little bit and I can take a look into this one (if it is ok).

The part that I would like to clarify is the content of JSON or TOML output. Is it going to include:

  • Name of the plugin
  • Path of the plugin
  • Description of the plugin
  • (all above)

I can see that there are separate issues (#1214, #1215) for the printing path of the plugin and the description of the plugins with a flag. I think we have two main possibilities here:

  1. We can include all mentioned information (paths, names, descriptions) by default to the JSON output
  2. We can include the information if the corresponding flag is present

I think option 2 is closer to the default behavior but option 1 is also logical since the output is going to be parsed the output can include everything by default.

@mitchmindtree
Copy link
Contributor Author

mitchmindtree commented May 11, 2022

Sorry about the delayed response to this! Caught me while I was out-of-action :)

Is this still relevant?

I think this is still relevant, but I think the issues @JoshuaBatty picked are probably more useful in the meantime as we don't have any direct use-cases for this just yet.

I think we have two main possibilities here:

I have no major preference on either approach, you make a good case for both! When we get around to this, we could possibly find a similar tool and see what they do, or alternatively just choose the approach that integrates into our existing code in the easiest manner.

I think this is also vaguely related to #885, where we want to offer a serializable, structured alternative to human-readable content that gets written to stdout.

@mitchmindtree
Copy link
Contributor Author

Was just reading some cargo docs and came across this section which describes how they support JSON output in a bit more detail: https://doc.rust-lang.org/cargo/reference/external-tools.html#json-messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc good first issue Good for newcomers P: low
Projects
None yet
Development

No branches or pull requests

3 participants