Skip to content

Conversation

@JoeyShapiro
Copy link
Contributor

Description

It would be nice if the syft package allowed for pretty printing SBOMs with custom indenting. The default for most formats is only 1 space, but I personally use a tab.

This change is in the works, but I wanted to bring attention to it because I have a few issues.

  • the cyclone formats use a separate encoder package, that do not allow setting the indent
    • I can make a PR and do the changes to that package, but it would require a bit more coordination.
  • Some formats do not have a Pretty option.
    • I can add an Indent option, but I feel like I should add a Pretty option while I'm at it. Unless there is a reason they do not have a Pretty option
    • But adding an Indent option without a Pretty option feels wrong for some reason

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

return EncoderConfig{
Version: spdxutil.DefaultVersion,
Pretty: false,
Indent: " ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should default this to either 2 or 4 spaces, probably.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine by me. I was just copying the default from what it was before. I think the rest of the code uses 2, so I will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants