cyclonedx-python icon indicating copy to clipboard operation
cyclonedx-python copied to clipboard

Single-line SBOM file is not diff-friendly

Open thbeu opened this issue 2 years ago • 1 comments

Using v3.6.3, I noticed that the generated SBOM is just a single-line file, thus not diff-friendly. Is there any reason to not have a pretty-printed output file generated?

thbeu avatar Oct 10 '22 18:10 thbeu

feel free to open a pull-request for the feature

jkowalleck avatar Oct 10 '22 19:10 jkowalleck

I solved it in my setup by post-processing the created output file.

Oterwise, it also seems to be an issue for the underlying https://github.com/CycloneDX/cyclonedx-python-lib.

thbeu avatar Nov 09 '22 09:11 thbeu

This needs to be implemented separately for the JSON and XML output formats. I created a PR for JSON. Will leave XML for someone else. Makes for a good first PR :-)

rolweber avatar Dec 14 '22 12:12 rolweber

the feature should net simply be implemented, but be an option. so a new CLI switch like --output-humanreadable or something should enable the new behavior.

jkowalleck avatar Dec 14 '22 15:12 jkowalleck

might depend on https://github.com/CycloneDX/cyclonedx-python-lib/pull/458

jkowalleck avatar Oct 02 '23 17:10 jkowalleck

Underlying library is able to produce human-friendly XML and JSON. So this feature is planned for the upcoming release :partying_face:

jkowalleck avatar Oct 24 '23 08:10 jkowalleck

fixed by #605

jkowalleck avatar Dec 25 '23 15:12 jkowalleck