@@ -17,7 +17,7 @@ class Config:
1717 thread_local = threading .local ()
1818
1919
20- def parse_json (path : Path ):
20+ def parse_json (path : Path ) -> dict :
2121 if not isinstance (path , Path ):
2222 raise TypeError (f"Expected Path, got { type (path )} " )
2323 if not path .is_file ():
@@ -27,7 +27,7 @@ def parse_json(path: Path):
2727 return json .load (f )
2828
2929
30- def compare_json (a : Path , b : Path ):
30+ def compare_json (a : Path , b : Path ) -> bool :
3131 if not isinstance (a , Path ) or not isinstance (b , Path ):
3232 raise TypeError ("Both arguments must be of type Path" )
3333 if not a .is_file () or not b .is_file ():
@@ -38,7 +38,7 @@ def compare_json(a: Path, b: Path):
3838 return json_a == json_b
3939
4040
41- def compare_html (a : Path , b : Path , browser = None , diff_output : Path = None ):
41+ def compare_html (a : Path , b : Path , browser = None , diff_output : Path = None ) -> bool :
4242 if not isinstance (a , Path ) or not isinstance (b , Path ):
4343 raise TypeError ("Both arguments must be of type Path" )
4444 if not a .is_file () or not b .is_file ():
@@ -56,7 +56,7 @@ def compare_html(a: Path, b: Path, browser=None, diff_output: Path = None):
5656 return result
5757
5858
59- def compare_files (a : Path , b : Path , ** kwargs ):
59+ def compare_files (a : Path , b : Path , ** kwargs ) -> bool :
6060 if not isinstance (a , Path ) or not isinstance (b , Path ):
6161 raise TypeError ("Both arguments must be of type Path" )
6262 if not a .is_file () or not b .is_file ():
@@ -70,7 +70,7 @@ def compare_files(a: Path, b: Path, **kwargs):
7070 return compare_html (a , b , ** kwargs )
7171
7272
73- def comparable_file (path : Path ):
73+ def comparable_file (path : Path ) -> bool :
7474 if not isinstance (path , Path ):
7575 raise TypeError (f"Expected Path, got { type (path )} " )
7676 if not path .is_file ():
@@ -83,7 +83,9 @@ def comparable_file(path: Path):
8383 return False
8484
8585
86- def submit_compare_dirs (a : Path , b : Path , executor , diff_output : Path = None , ** kwargs ):
86+ def submit_compare_dirs (
87+ a : Path , b : Path , executor , diff_output : Path = None , ** kwargs
88+ ) -> dict [str , list [Path ]]:
8789 if not isinstance (a , Path ) or not isinstance (b , Path ):
8890 raise TypeError ("Both arguments must be of type Path" )
8991 if not a .is_dir () or not b .is_dir ():
@@ -155,7 +157,7 @@ def compare(path_a, path_b, diff_output):
155157
156158def print_results (
157159 results : dict [str , list [Path ]], a : Path , b : Path , level : int = 0 , prefix : str = ""
158- ):
160+ ) -> dict [ str , list [ Path ]] :
159161 if not isinstance (a , Path ) or not isinstance (b , Path ):
160162 raise TypeError ("Both arguments must be of type Path" )
161163 if not a .is_dir () or not b .is_dir ():
0 commit comments