Skip to content

Conversation

@armintaenzertng
Copy link
Collaborator

fixes #403

Signed-off-by: Armin Tänzer armin.taenzer@tngtech.com


validation_messages.extend(validate_creation_info(document.creation_info))
if not spdx_version:
spdx_version = document.creation_info.spdx_version
Copy link
Member

Choose a reason for hiding this comment

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

instead of setting the version here, I think it would be cleaner to make the version optional in the validation_messages.extend(validate_creation_info( call and only assert on it, if it is set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree that it should be optional in validate_creation_info(), but we have to set the version here, nevertheless, as it is a mandatory field for other validations like validate_relationships() (and more to come later).

Copy link
Member

Choose a reason for hiding this comment

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

you could still move the spdx version validation up, to have it cleaner

Copy link
Member

Choose a reason for hiding this comment

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

Its just a minor improvement, but:

Suggested change
spdx_version = document.creation_info.spdx_version
validation_messages.extend(validate_creation_info(document.creation_info, spdx_version))
if not spdx_version:
spdx_version = document.creation_info.spdx_version

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have extracted the version validation to be handled before everything else, now.

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
@armintaenzertng armintaenzertng force-pushed the validationVersionFromDoc branch from f78e2af to c3f78a1 Compare January 5, 2023 11:04
@armintaenzertng armintaenzertng merged commit e455066 into spdx:refactor-python-tools Jan 5, 2023
@armintaenzertng armintaenzertng deleted the validationVersionFromDoc branch January 5, 2023 14:21
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