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

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

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
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)