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

Single-line SBOM file is not diff-friendly #424

Closed
thbeu opened this issue Oct 10, 2022 · 7 comments
Closed

Single-line SBOM file is not diff-friendly #424

thbeu opened this issue Oct 10, 2022 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@thbeu
Copy link
Contributor

thbeu commented Oct 10, 2022

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 thbeu changed the title Single-line output is not diff-friendly Single-line SBOM file is not diff-friendly Oct 10, 2022
@jkowalleck
Copy link
Member

jkowalleck commented Oct 10, 2022

feel free to open a pull-request for the feature

@jkowalleck jkowalleck added the enhancement New feature or request label Oct 10, 2022
@thbeu
Copy link
Contributor Author

thbeu commented Nov 9, 2022

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.

@rolweber
Copy link
Contributor

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 :-)

@jkowalleck
Copy link
Member

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
Copy link
Member

might depend on CycloneDX/cyclonedx-python-lib#458

jkowalleck added a commit to CycloneDX/cyclonedx-python-lib that referenced this issue Oct 4, 2023
add indention to outputters. this may come at a cost!


Breaking Changes
------------------
* abstract Method `output.BaseOutput.output_as_string()` got new optional kwarg `indent`
* abstract Method `output.BaseOutput.output_as_string()` accepts arbitrary kwargs

Changed
----------
* XML output uses a default namespace, which makes results smaller.


Added
------------------
* All outputters' method `output_as_string()` got new optional kwarg `indent`
* All outputters' method `output_as_string()` accepts arbitrary kwargs
* All outputters' method `output_to_file()` got new optional kwarg `indent`
* All outputters' method `output_to_file()` accepts arbitrary kwargs

-----

- [x] implementation
- [x] tests (snapshot binary compare; structural equal compare) 

-----

enables CycloneDX/cyclonedx-python#424
fixes #437
fixes #438
supersedes #449

---------

Signed-off-by: Jan Kowalleck <[email protected]>
@jkowalleck jkowalleck added this to the 4.0.0 milestone Oct 24, 2023
@jkowalleck
Copy link
Member

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

@jkowalleck jkowalleck removed the help wanted Extra attention is needed label Oct 24, 2023
@jkowalleck
Copy link
Member

fixed by #605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants