anchore / vunnel

Tool for collecting vulnerability data from various sources (used to build the grype database)
Apache License 2.0
69 stars 25 forks source link

chore: pretty-print JSON in snapshots #647

Closed willmurphyscode closed 1 month ago

willmurphyscode commented 1 month ago

Otherwise, it can be very hard to review a PR that updates a snapshot.

For some added context, #645 shows some differences in snapshot JSON that look like they're just reordering keys, but it's very hard to tell. Therefore, sort and indent the JSON on snapshot comparison so that the diffs are more obvious.

This was discovered on the way to fixing #644.

Note for reviewers: there are only a few manual changes in this PR: