8000 set `validate=True` as default value in the rdf writer by armintaenzertng · Pull Request #734 · spdx/tools-python · GitHub
[go: up one dir, main page]

Skip to content

set validate=True as default value in the rdf writer #734

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
set validate=True as default value in the rdf writer to be consistent…
… with the writers of the other formats

Signed-off-by: Armin Tänzer <armin.taenzer@tngtech.com>
  • Loading branch information
armintaenzertng committed Jul 19, 2023
commit 52bb91ab401b48620f7d1d6f80f2e154760db74c
6 changes: 4 additions & 2 deletions src/spdx_tools/spdx/writer/rdf/rdf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
from spdx_tools.spdx.writer.write_utils import validate_and_deduplicate


def write_document_to_stream(document: Document, stream: IO[bytes], validate: bool, drop_duplicates: bool = True):
def write_document_to_stream(
document: Document, stream: IO[bytes], validate: bool = True, drop_duplicates: bool = True
):
document = validate_and_deduplicate(document, validate, drop_duplicates)
graph = Graph()
doc_namespace = document.creation_info.document_namespace
Expand Down Expand Up @@ -51,6 +53,6 @@ def write_document_to_stream(document: Document, stream: IO[bytes], validate: bo
graph.serialize(stream, "pretty-xml", encoding="UTF-8", max_depth=100)


def write_document_to_file(document: Document, file_name: str, validate: bool, drop_duplicates: bool = True):
def write_document_to_file(document: Document, file_name: str, validate: bool = True, drop_duplicates: bool = True):
with open(file_name, "wb") as out:
write_document_to_stream(document, out, validate, drop_duplicates)
0