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.
This PR adds new test data from the spdx-spec repo to the migration branch and adapts the code according to the changes in the
spdx-tools
.With the refactored version of
spdx-tools
the parser is stricter in terms of mandatory properties and their types and wouldn't allow empty fields for creator, created or any spdx_id. Therefore we need to catch a possibly thrownSPDXParsingError
and adapt the output generated from the conformance checker. Additionally, the refactored version has a separate validation layer to check if documents are valid according to the spec. This is used to e.g. check that all spdx_ids used in the document are unique. If a document is not valid it is makred as not ntia-conformant (although it could contain all minimum fields).I also changed the formatting of the html output as the test was failing due to a different number of whitespaces. Using a string there prevents this, although I wasn't sure where this output is used and if the generated output if the provided document can't be parsed is correctly formatted.
There are still 4 failing tests due to bugs in the
spdx-tools
. Three of these bugs are already solved, as soon as spdx/tools-python#653 is merged we will make a second alpha release which should then be used as the dependency for the migration here and make the last tests pass.