-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[issue-403] change spdx version handling during validation #404
[issue-403] change spdx version handling during validation #404
Conversation
48c4e72
to
5eb63e4
Compare
23d7208
to
f78e2af
Compare
src/validation/document_validator.py
Outdated
validation_messages: List[ValidationMessage] = [] | ||
|
||
validation_messages.extend(validate_creation_info(document.creation_info)) | ||
if not spdx_version: | ||
spdx_version = document.creation_info.spdx_version |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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:
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 |
There was a problem hiding this comment.
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>
f78e2af
to
c3f78a1
Compare
fixes #403
Signed-off-by: Armin Tänzer armin.taenzer@tngtech.com