rust-secure-code / cargo-supply-chain

Gather author, contributor and publisher data on crates in your dependency graph.
Apache License 2.0
316 stars 19 forks source link

Output is not available in json #49

Closed zebambam closed 3 years ago

zebambam commented 3 years ago

Hey - I think it'd be useful if there were a json output format selectable with --json on the command line for all options.

I'd like to base some automation on this tooling but it's hard to do without an output format that I can connect to other things.

I may have a stab at doing this myself if you're okay with that.

Shnatsel commented 3 years ago

JSON output sounds good to me. I'd be happy to accept a PR adding it.

Shnatsel commented 3 years ago

I don't think we need the different groupings for this info that crates and publishers commands provide (they present the same data, it's just grouped differently).

So I suppose adding another subcommand called json or some such would be the simplest way to expose this info for parsing. It could always group by crate and let the consumer code perform any desired transformations.

zebambam commented 3 years ago

Ah yeah. Your idea is better than my idea lol. I was just going to dish out the same info but in json.

zebambam commented 3 years ago

Okay so in the end I just slapped a json interface on what is already there. Maybe more data can be gotten with a separate subcommand? For now this solves my problem though, and I assume it's helpful to others as well.

zebambam commented 3 years ago

Er. PR #50

Shnatsel commented 3 years ago

Fixed in #51