Skip to content

Conversation

@HarshvMahawar
Copy link
Contributor

No description provided.

@HarshvMahawar HarshvMahawar force-pushed the refactor-python-tools branch from 2a18110 to bc60bc9 Compare March 23, 2023 08:33
@HarshvMahawar HarshvMahawar marked this pull request as draft March 23, 2023 08:35
@HarshvMahawar HarshvMahawar marked this pull request as ready for review March 23, 2023 08:36
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 for your contribution! :)
If you like, you can also include a unit test for this under tests/spdx/test_document_utils.py. If not, I'm happy to include it after this PR is merged.

element_ids.extend([package.spdx_id for package in document.packages])
element_ids.extend([snippet.spdx_id for snippet in document.snippets])
return element_ids
def get_element_from_spdx_id(document: Document, spdx_id: str) -> Union[Package, File, Snippet, None]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

PEP8 requires two blank lines between methods.
Which IDE are you using for your python development? There might be a plugin for your IDE to detect PEP8 violations.

@armintaenzertng armintaenzertng linked an issue Mar 23, 2023 that may be closed by this pull request
@HarshvMahawar HarshvMahawar force-pushed the refactor-python-tools branch 2 times, most recently from 34b8bc8 to ecca0da Compare March 23, 2023 18:36
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! :)

@armintaenzertng armintaenzertng merged commit ea92a1c into spdx:refactor-python-tools Mar 24, 2023
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.

Add convenience function to extract SPDX elements by their Id

2 participants