Skip to content

Commit

Permalink
Add return type Document for parse_file
Browse files Browse the repository at this point in the history
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
  • Loading branch information
bact committed Nov 26, 2024
1 parent a25937f commit 1ccce6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/spdx_tools/spdx/parser/parse_anything.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
import logging

from spdx_tools.spdx.formats import FileFormat, file_name_to_format
from spdx_tools.spdx.model import Document
from spdx_tools.spdx.parser.json import json_parser
from spdx_tools.spdx.parser.rdf import rdf_parser
from spdx_tools.spdx.parser.tagvalue import tagvalue_parser
from spdx_tools.spdx.parser.xml import xml_parser
from spdx_tools.spdx.parser.yaml import yaml_parser


def parse_file(file_name: str, encoding: str = "utf-8"):
def parse_file(file_name: str, encoding: str = "utf-8") -> Document:
if encoding != "utf-8":
logging.warning(
"It's recommended to use the UTF-8 encoding for any SPDX file. Consider changing the encoding of the file."
Expand Down

0 comments on commit 1ccce6d

Please sign in to comment.