Skip to content

Commit 1ccce6d

Browse files
committed
Add return type Document for parse_file
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
1 parent a25937f commit 1ccce6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/spdx_tools/spdx/parser/parse_anything.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
import logging
1313

1414
from spdx_tools.spdx.formats import FileFormat, file_name_to_format
15+
from spdx_tools.spdx.model import Document
1516
from spdx_tools.spdx.parser.json import json_parser
1617
from spdx_tools.spdx.parser.rdf import rdf_parser
1718
from spdx_tools.spdx.parser.tagvalue import tagvalue_parser
1819
from spdx_tools.spdx.parser.xml import xml_parser
1920
from spdx_tools.spdx.parser.yaml import yaml_parser
2021

2122

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

0 commit comments

Comments
 (0)