Repository navigation
Add support for SPDX JSON, XML, and YAML output formats - #5590
Open
chinyeungli wants to merge 3 commits into
Open
chinyeungli wants to merge 3 commits into
chinyeungli wants to merge 3 commits into
Conversation
* Use `spdx-tools` to support additional SPDX output formats. * Update tests, test fixtures, and CLI documentation. * Remove the "No results for package" message to ensure empty scans produce valid SPDX documents across all output formats. * Update CHANGELOG Signed-off-by: Chin Yeung Li <tli@nexb.com>
* Add `_safe_test_path()` to validate test fixture and temporary file paths. Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
AyanSinhaMahapatra
approved these changes
Dec 4, 2026
AyanSinhaMahapatra
left a comment
Member
There was a problem hiding this comment.
Thanks++ @chinyeungli LGTM!
See minor comments for your consideration, I've dismissed all the codeql alerts as these are entirely used in tests, on inputs we explicitly set ourselves, so these are not applicable IMHO
| result = result.decode('utf-8') | ||
|
|
||
| output_file.write(result) | ||
| try: |
Member
There was a problem hiding this comment.
Do we need to have a try-catch here because this function is only called by us from the plugin definitions with correct options.
| for name in roots: | ||
| root = allowed.get(name) | ||
| if root: | ||
| normalized_root = os.path.normcase(root) |
Member
There was a problem hiding this comment.
Suggested change
| normalized_root = os.path.normcase(root) | |
| normalized_root = os.path.normcase(os.path.realpath(root)) |
Maybe this is actually not a bad idea indeed
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spdx-toolsto support additional SPDX output formats.Fixes #3698
Tasks
Run tests locally to check for errors.
Signed-off-by: Chin Yeung Li tli@nexb.com