Skip to content

Commit

Permalink
set validate=True as default value in the rdf writer to be consistent…
Browse files Browse the repository at this point in the history
… with the writers of the other formats

Signed-off-by: Armin Tänzer <[email protected]>
  • Loading branch information
armintaenzertng committed Jul 19, 2023
1 parent 2402596 commit 52bb91a
Showing 1 changed file with 4 additions and 2 deletions.
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 comments on commit 52bb91a

Please sign in to comment.