Skip to content
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-307] implement validation #371

Merged

Conversation

armintaenzertng
Copy link
Collaborator

will fix #307

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
external document references are not implemented correctly here, yet

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
…alidator.py

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
@armintaenzertng armintaenzertng changed the title Refactor validation [issue-307] refactor validation Dec 12, 2022
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
@armintaenzertng armintaenzertng changed the title [issue-307] refactor validation [issue-307] implement validation Dec 14, 2022
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
@armintaenzertng armintaenzertng marked this pull request as ready for review December 14, 2022 13:34
Copy link
Collaborator

@meretp meretp left a comment

Choose a reason for hiding this comment

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

Thanks for all the effort and especially dealing with the whole spec to get all validations, that must have been quite a lot! I have not dealt with the spec in such detail, but I think that you managed to implement all possible validations (except for the open issues of course), congrats on that! 🥇
I left quite a lot comments but most of them deal with double quotes or unused imports. I also left a comment about the architecture what we possibly should discuss. I have to admit: The more I looked into your code, the more unsure i became whether your way isn't the most suitable after all.

src/validation/document_validator.py Outdated Show resolved Hide resolved
src/validation/document_validator.py Outdated Show resolved Hide resolved
tests/validation/test_document_validator.py Outdated Show resolved Hide resolved
tests/validation/test_document_validator.py Outdated Show resolved Hide resolved
src/validation/document_validator.py Outdated Show resolved Hide resolved
tests/validation/test_uri_validators.py Outdated Show resolved Hide resolved
tests/validation/test_uri_validators.py Outdated Show resolved Hide resolved
tests/validation/test_uri_validators.py Outdated Show resolved Hide resolved
tests/validation/test_uri_validators.py Outdated Show resolved Hide resolved
tests/validation/test_relationship_validator.py Outdated Show resolved Hide resolved
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
(will be properly implemented in test_spdx_id_validators.py)

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
…ually

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Copy link
Collaborator

@meretp meretp left a comment

Choose a reason for hiding this comment

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

Looks very good to me, thanks for addressing the other comments! I have only a few small remarks left.
One remark concerning usage: To test the validation I used the following code

test_pack = Package(spdx_id="spdxid", name="jusst a test", download_location="I have to put this here")
validate_package(test_pack)

and got an error Missing context. As ValidationContext can be instantiated without further parameter, I was wondering if we can make this parameter optional for all validation-methods. What do you think?

Edit: We should also add a license header to the new files.

src/validation/external_document_ref_validator.py Outdated Show resolved Hide resolved
src/validation/package_validator.py Outdated Show resolved Hide resolved
src/validation/package_verification_code_validator.py Outdated Show resolved Hide resolved
src/validation/package_validator.py Outdated Show resolved Hide resolved
…alls of packages, files and snippets

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
Copy link
Collaborator

@meretp meretp left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you very much for addressing all comments! 👍

@armintaenzertng armintaenzertng merged commit 5747050 into spdx:refactor-python-tools Dec 28, 2022
@armintaenzertng armintaenzertng deleted the refactor-validation branch December 28, 2022 12: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