Skip to content

Conversation

@meretp
Copy link
Collaborator

@meretp meretp commented Mar 28, 2023

Reading through the migration guideline I came across the line

Now, when calling write_file(), by default a Document will be validated against the specification before it can be written to a file.

which lead me to this addition.

part of #402

def write_document_to_file(document: Document, file_name: str, validate: bool = True):
if validate:
validation_messages: List[ValidationMessage] = validate_full_spdx_document(document,
document.creation_info.spdx_version)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need to specify the version, it will be automatically inferred from the creation_info

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright, I deleted the argument in the other writer functions as well.

…y inferred from the creation_info

Signed-off-by: Meret Behrens <[email protected]>
Copy link
Collaborator

@armintaenzertng armintaenzertng left a comment

Choose a reason for hiding this comment

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

Thanks, looks good :)

@meretp meretp merged commit d1c01f8 into spdx:refactor-python-tools Mar 28, 2023
@meretp meretp deleted the issue-402-validation-tag-value-writer branch March 28, 2023 09:42
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