@@ -24,16 +24,15 @@ def print_brick_imports(brick_imports: dict) -> None:
2424 )
2525
2626
27- def print_missing_deps (diff : Set [str ], project_name : str ) -> bool :
27+ def print_missing_deps (diff : Set [str ], project_name : str ) -> None :
2828 if not diff :
29- return True
29+ return
3030
3131 console = Console (theme = theme .poly_theme )
3232
3333 missing = ", " .join (sorted (diff ))
3434
3535 console .print (f":thinking_face: Cannot locate { missing } in { project_name } " )
36- return False
3736
3837
3938def fetch_brick_imports (root : Path , ns : str , all_imports : dict ) -> dict :
@@ -42,14 +41,12 @@ def fetch_brick_imports(root: Path, ns: str, all_imports: dict) -> dict:
4241 return collect .with_unknown_components (root , ns , extracted )
4342
4443
45- def print_report (
44+ def create_report (
4645 root : Path ,
4746 ns : str ,
4847 project_data : dict ,
4948 third_party_libs : Set ,
50- ) -> Tuple [bool , dict , dict ]:
51- name = project_data ["name" ]
52-
49+ ) -> Tuple [bool , dict ]:
5350 bases = {b for b in project_data .get ("bases" , [])}
5451 components = {c for c in project_data .get ("components" , [])}
5552
@@ -70,9 +67,15 @@ def print_report(
7067 }
7168
7269 brick_diff = collect .imports_diff (brick_imports , list (bases ), list (components ))
73- brick_result = print_missing_deps (brick_diff , name )
74-
7570 libs_diff = libs .report .calculate_diff (third_party_imports , third_party_libs )
76- libs_result = print_missing_deps (libs_diff , name )
7771
78- return all ([brick_result , libs_result ]), brick_imports , third_party_imports
72+ res = all ([not brick_diff , not libs_diff ])
73+
74+ report_details = {
75+ "brick_imports" : brick_imports ,
76+ "third_party_imports" : third_party_imports ,
77+ "brick_diff" : brick_diff ,
78+ "libs_diff" : libs_diff ,
79+ }
80+
81+ return res , report_details
0 commit comments