Skip to content

CLI: fully structured output for easier parsing, send to a file #748

@singerb

Description

@singerb

I'm integrating plugin-check into a testing pipeline via wp-cli, and consuming the output programmatically is a little annoying (though totally doable) at the moment. Two things that would make it easier:

  • Have a fully JSON output, rather than the mix of FILE: path.php\n<json blob> there is now. This is relatively easy to parse, but still requires custom code to do so (and associate the path with each entry). Either a nested structure like [{path: "path.php", items: <same json blob as now>}, ...] or just a straight list like [<single item as now but with path added>,...] would work fine for this. If memory is a concern, then the second option would also work in a line-by-line format, rather than one big JSON array.
  • Allow directing the results to a file, so the status messages can still show on the console (and thus in the logs of a pipeline running this) while the output is clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InfrastructureIssues for the overall plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions